dfarc-3.12/ 0002775 0001750 0001751 00000000000 12420023266 007521 5 0000000 0000000 dfarc-3.12/src/ 0002775 0001750 0001751 00000000000 12420023266 010310 5 0000000 0000000 dfarc-3.12/src/DFArcFrame_Base.wxg 0000664 0001750 0001751 00000034311 12400712453 013604 0000000 0000000
dfarc-3.12/src/DFArcFrame.hpp 0000664 0001750 0001751 00000004571 12340110733 012635 0000000 0000000 /**
* DFArc main frame
* Copyright (C) 2005, 2006 Dan Walma
* Copyright (C) 2008, 2010 Sylvain Beucler
* This file is part of GNU FreeDink
* GNU FreeDink 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.
* GNU FreeDink 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
* .
*/
#ifndef _DFARCFRAME_HPP
#define _DFARCFRAME_HPP
#include "DFArcFrame_Base.h"
#include "DMod.hpp"
#include "ClientData.hpp"
#include
#include
class Config;
// Main Frame Class, no arguments.
class DFArcFrame : public DFArcFrame_Base
{
public:
DFArcFrame();
void onShow(wxShowEvent& aEvent);
void OnQuit(wxCommandEvent &Event);
void Install(wxCommandEvent &Event);
void onDownload(wxCommandEvent& aEvent);
void onRefresh(wxCommandEvent& aEvent);
void onBrowse(wxCommandEvent& aEvent);
void uninstall(wxCommandEvent& aEvent);
void showOptions(wxCommandEvent& aEvent);
void showIntroductionText(wxCommandEvent& aEvent);
void onWalkthroughs( wxCommandEvent& aEvent);
void onForums(wxCommandEvent& aEvent);
void OnAbout(wxCommandEvent &Event);
void OnEvtListBox(wxCommandEvent &Event);
void OnSetPlayOption(wxCommandEvent &Event);
void OnPlay(wxCommandEvent& aEvent);
void onEdit(wxCommandEvent& aEvent);
void onPackage(wxCommandEvent &Event);
wxBitmap mAllLogos;
private:
void PrepareGUI();
void showDeveloperButtons(bool visible);
void initializeConfig();
void refreshDmodList();
void refreshDmodLogos();
void RestoreListBoxFromConfig();
void SelectDModFromListBox();
void updateConfig();
void updateDescription();
void populateAvailableDModsList();
bool launchURL(wxString url);
enum program { GAME, EDITOR };
wxString BuildCommand(enum program);
Config *mConfig;
std::vector mAvailableDModsList;
bool mNoDmods;
int mSelectedDModIndex;
wxBitmap mDefaultLogoBitmap;
DECLARE_EVENT_TABLE()
};
#endif
dfarc-3.12/src/Package.cpp 0000664 0001750 0001751 00000015307 12417511650 012300 0000000 0000000 /**
* D-Mod packaging wizard
* Copyright (C) 2004 Andrew Reading
* Copyright (C) 2005, 2006 Dan Walma
* Copyright (C) 2008 Sylvain Beucler
* This file is part of GNU FreeDink
* GNU FreeDink 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.
* GNU FreeDink 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
* .
*/
#include
#include
#include
#include "Package.hpp"
#include "BZip.hpp"
#include "Tar.hpp"
#include "IOUtils.hpp"
BEGIN_EVENT_TABLE(Package, wxDialog)
EVT_BUTTON(wxID_OK, Package::onOkay)
END_EVENT_TABLE()
Package::Package(const DMod aDMod) :
Package_Base(NULL, wxID_ANY, _T("")),
mDMod(aDMod)
{
prepareDialog();
return;
}
void Package::prepareDialog()
{
wxString introText = wxString::Format(
lIntroText->GetLabel().c_str(),
mDMod.GetTitle().c_str(), mDMod.GetFullPath().c_str());
lIntroText->SetLabel(introText);
mIdentifier->SetValue(mDMod.GetBaseName());
mIdentifier->SetValidator(wxTextValidator(wxFILTER_ALPHANUMERIC));
mIdentifier->SetMaxLength(8);
this->SetMinSize(this->GetBestSize());
this->SetSize(this->GetMinSize());
// Dmod.diz
// TODO: this was disabled in DFArc2 - can it be reused somehow?
/*
wxStaticText* lDmodDizTitleText = new wxStaticText( lPanel, -1, "Dmod.diz title" );
mDmodDizTitle = new wxTextCtrl( lPanel, -1, lTitle );
wxBoxSizer* lDmodDizTitleBox = new wxBoxSizer( wxHORIZONTAL );
lDmodDizTitleBox->Add( lDmodDizTitleText, lLeftFlags );
lDmodDizTitleBox->Add( mDmodDizTitle, lRightFlags );
wxStaticText* lDmodDizInfo1Text = new wxStaticText( lPanel, -1, "Dmod.diz author/copyright information 1" );
mDmodDizInfo1 = new wxTextCtrl( lPanel, -1, lInfo1 );
wxBoxSizer* lDmodDizInfo1Box = new wxBoxSizer( wxHORIZONTAL );
lDmodDizInfo1Box->Add( lDmodDizInfo1Text, lLeftFlags );
lDmodDizInfo1Box->Add( mDmodDizInfo1, lRightFlags );
wxStaticText* lDmodDizInfo2Text = new wxStaticText( lPanel, -1, "Dmod.diz author/copyright information 2" );
mDmodDizInfo2 = new wxTextCtrl( lPanel, -1, lInfo2 );
wxBoxSizer* lDmodDizInfo2Box = new wxBoxSizer( wxHORIZONTAL );
lDmodDizInfo2Box->Add( lDmodDizInfo2Text, lLeftFlags );
lDmodDizInfo2Box->Add( mDmodDizInfo2, lRightFlags );
wxStaticText* lDmodDizDescriptionText = new wxStaticText( lPanel, -1, "Dmod.diz description" );
mDmodDizDescription = new wxTextCtrl( lPanel, -1, lDescription, wxDefaultPosition,
wxSize( -1, 100 ), wxTE_MULTILINE | wxTE_LEFT | wxTE_BESTWRAP );
wxBoxSizer* lDmodDizDescriptionBox = new wxBoxSizer( wxHORIZONTAL );
lDmodDizDescriptionBox->Add( lDmodDizDescriptionText, lLeftFlags );
lDmodDizDescriptionBox->Add( mDmodDizDescription, lRightFlags );
wxStaticBoxSizer* lDmodDizBox = new wxStaticBoxSizer( wxVERTICAL, lPanel, "Dmod.diz" );
lDmodDizBox->Add( lDmodDizTitleBox, wxSizerFlags( 0 ).Left().Expand() );
lDmodDizBox->Add( lDmodDizInfo1Box, wxSizerFlags( 0 ).Left().Expand() );
lDmodDizBox->Add( lDmodDizInfo2Box, wxSizerFlags( 0 ).Left().Expand() );
lDmodDizBox->Add( lDmodDizDescriptionBox, wxSizerFlags( 0 ).Left().Expand() );*/
// Cleanup
/*mCleanupSaveDat = new wxCheckBox( lPanel, -1, "Include save game files?" );
mCleanupThumbsDb = new wxCheckBox( lPanel, -1, "Include thumbs.db files?" );
wxStaticBoxSizer* lCleanupBox = new wxStaticBoxSizer( wxHORIZONTAL, lPanel, "Cleanup" );
lCleanupBox->Add( mCleanupSaveDat, lLeftFlags );
lCleanupBox->Add( mCleanupThumbsDb, lLeftFlags );*/
// Patch
/*mPatch = new wxCheckBox( lPanel, -1, "Create patch?" );
wxStaticText* lPatchOriginalFileText = new wxStaticText( lPanel, -1, "Original .dmod file" );
mPatchOriginalFile = new wxTextCtrl( lPanel, -1 );
mPatchBrowse = new wxButton( lPanel, Package::ID_BROWSE, "Browse" );
wxBoxSizer* lPatchOriginalBox = new wxBoxSizer( wxHORIZONTAL );
lPatchOriginalBox->Add( lPatchOriginalFileText, wxSizerFlags( 25 ).Left().Expand().Border( wxALL, 2 ) );
lPatchOriginalBox->Add( mPatchOriginalFile, wxSizerFlags( 55 ).Left().Expand().Border( wxALL, 2 ) );
lPatchOriginalBox->Add( mPatchBrowse, wxSizerFlags( 20 ).Right().Expand().Border( wxALL, 2 ) );
wxStaticBoxSizer* lPatchBox = new wxStaticBoxSizer( wxVERTICAL, lPanel, "Patch" );
lPatchBox->Add( mPatch, lLeftFlags );
lPatchBox->Add( lPatchOriginalBox, wxSizerFlags( 0 ).Left().Expand() );*/
}
void Package::onOkay( wxCommandEvent& aEvent )
{
if (mIdentifier->GetValue().Len() == 0)
{
wxLogError(_("You must provide an identifier filename."));
return;
}
int flags = wxPD_AUTO_HIDE | wxPD_APP_MODAL | wxPD_CAN_ABORT;
// Using elapsed time instead of remaining time, because the latter
// is not much reliable (when BZ2 flushes its buffer, which can't be
// predicted, the progress is stopped for a long time, and this
// confuses the time/progress estimation)
flags |= wxPD_ELAPSED_TIME;
wxProgressDialog* lPackageProcess =
new wxProgressDialog(_("Packaging"), _("The D-Mod is being packaged."),
100, this, flags);
// Rename the old D-Mod
wxString lDmodFilePath = IOUtils::GetParentDir(mDMod.GetFullPath()) + wxFileName::GetPathSeparator()
+ mIdentifier->GetValue() + _T(".dmod");
wxString lOldDmodFilePath = lDmodFilePath;
int lCount = 1;
while (::wxFileExists(lOldDmodFilePath))
{
lOldDmodFilePath = IOUtils::GetParentDir(mDMod.GetFullPath()) + wxFileName::GetPathSeparator()
+ wxString::Format(_T("%s%d.dmod"), mIdentifier->GetValue().c_str(), lCount);
lCount++;
}
if (lOldDmodFilePath != lDmodFilePath)
{
::wxRenameFile(lDmodFilePath, lOldDmodFilePath);
}
wxString dirToCompress = mDMod.GetFullPath();
Tar lTar(lDmodFilePath, dirToCompress);
double compression_ratio = 0;
if (lTar.Create(mIdentifier->GetValue(), &compression_ratio, lPackageProcess))
{
// Success dialog
wxMessageBox(wxString::Format(_("%s was successfully packaged (compression ratio %2.1f : 1)."),
mIdentifier->GetValue().c_str(), compression_ratio),
_("Success"), wxOK | wxICON_INFORMATION, this);
}
else
{
::wxRemoveFile(lDmodFilePath);
wxMessageBox(_("Packaging aborted - removing partial .dmod file."),
_("Abort"), wxICON_EXCLAMATION, this);
}
EndModal(wxID_OK);
}
dfarc-3.12/src/DFArcFrame.cpp 0000664 0001750 0001751 00000072610 12417447530 012644 0000000 0000000 /**
* DFArc main frame
* Copyright (C) 2005, 2006 Dan Walma
* Copyright (C) 2008, 2010, 2014 Sylvain Beucler
* This file is part of GNU FreeDink
* GNU FreeDink 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.
* GNU FreeDink 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
* .
*/
#ifdef HAVE_CONFIG_H
#include
#endif
#include "DFArcFrame.hpp"
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include "IOUtils.hpp"
#include "InstallVerifyFrame.hpp"
#include "Options.hpp"
#include "Config.hpp"
#include "RecursiveDelete.hpp"
#include "Package.hpp"
#include "DMod.hpp"
#include "icon_xpm.hpp"
#define LOGO_WIDTH 160
#define LOGO_HEIGHT 120
class MonitorDinkExit : public wxProcess
{
public:
MonitorDinkExit(Config *mConfig) : wxProcess(), mConfig(mConfig) {}
virtual void OnTerminate(int pid, int status);
private:
Config *mConfig;
};
void MonitorDinkExit::OnTerminate(int pid, int status)
{
if (status == -1)
::wxMessageBox(wxString::Format(_("Dink Smallwood ('%s') was not found on your computer."
" Please configure the Dink program name in the Options menu."),
mConfig->mDinkExe.c_str(), wxICON_ERROR, this),
_("Error"));
else if (status != 0)
::wxMessageBox(wxString::Format(_("Dink Smallwood failed! Error code %d."),
status, wxICON_EXCLAMATION, this),
_("Error"));
}
class MonitorEditorExit : public wxProcess
{
public:
MonitorEditorExit(Config *mConfig) : wxProcess(), mConfig(mConfig) {}
virtual void OnTerminate(int pid, int status);
private:
Config *mConfig;
};
void MonitorEditorExit::OnTerminate(int pid, int status)
{
if (status == -1)
::wxMessageBox(wxString::Format(_("The editor ('%s') was not found on your computer."
" Please configure the editor program name in the Options menu."),
mConfig->mEditorExe.c_str()),
_("Error"));
else if (status != 0)
::wxMessageBox(_("Error while running the editor"), _("Error"));
}
/**
* Custom paint method to display the animation efficiently.
* Cf. doc/animation.txt for details.
*/
#define TIMER_ID 1 // arbitrary, maybe there's a better way
#define FPS 50
class DFAnimationPanel : public wxPanel
{
private:
double pos;
double dpos;
DFArcFrame* frame;
public:
DFAnimationPanel(DFArcFrame* frame, wxWindow* parent) :
wxPanel(parent, wxID_ANY),
frame(frame),
pos(.0), dpos(.0)
{ }
void setIndex(int idx)
{
dpos = (idx+1) * LOGO_HEIGHT;
}
void OnPaint(wxPaintEvent &)
{
/* Note: this->IsDoubleBuffered() == 1 under Gtk. Under woe it
reports 0, but when I clear the surface I don't any flickering,
so it must be double-buffered somewhere too. */
wxPaintDC dst(this);
// Clear surface - unneeded actually
//dst.SetBrush(*wxWHITE_BRUSH);
//dst.DrawRectangle(0, 0, LOGO_WIDTH, LOGO_HEIGHT);
// Draw logo
wxMemoryDC src(frame->mAllLogos);
dst.Blit(0, 0, LOGO_WIDTH, LOGO_HEIGHT, &src, 0, rint(pos));
}
/**
* Update the animation parameters regularly.
*/
void OnIdle(wxIdleEvent &)
{
if (fabs(pos - dpos) < .5)
// destination reached, taking rounding into account.
return;
// Simple easing
pos += (dpos - pos) / 7;
Refresh(/*eraseBackground=*/false);
wxMilliSleep(1000.0/FPS); // ms
}
DECLARE_EVENT_TABLE()
};
BEGIN_EVENT_TABLE(DFAnimationPanel, wxPanel)
EVT_PAINT(DFAnimationPanel::OnPaint)
EVT_IDLE(DFAnimationPanel::OnIdle)
END_EVENT_TABLE()
// FRAME EVENT TABLE
BEGIN_EVENT_TABLE(DFArcFrame, wxFrame)
EVT_SHOW(DFArcFrame::onShow)
EVT_MENU(ID_FileInstall, DFArcFrame::Install)
EVT_MENU(ID_Download, DFArcFrame::onDownload)
EVT_MENU(wxID_EXIT, DFArcFrame::OnQuit)
EVT_MENU(ID_Refresh, DFArcFrame::onRefresh)
EVT_MENU(ID_Browse, DFArcFrame::onBrowse)
EVT_MENU(ID_Uninstall, DFArcFrame::uninstall)
EVT_MENU(ID_Options, DFArcFrame::showOptions)
EVT_MENU(ID_IntroductionText, DFArcFrame::showIntroductionText)
EVT_MENU(ID_Walkthroughs, DFArcFrame::onWalkthroughs)
EVT_MENU(ID_Forums, DFArcFrame::onForums)
EVT_MENU(wxID_ABOUT, DFArcFrame::OnAbout)
EVT_BUTTON(ID_Play, DFArcFrame::OnPlay)
EVT_BUTTON(ID_Edit, DFArcFrame::onEdit)
EVT_BUTTON(ID_Package, DFArcFrame::onPackage)
EVT_LISTBOX(ID_DmodTitleList, DFArcFrame::OnEvtListBox)
EVT_CHECKBOX(ID_Truecolor, DFArcFrame::OnSetPlayOption)
EVT_CHECKBOX(ID_Windowed, DFArcFrame::OnSetPlayOption)
EVT_CHECKBOX(ID_Sound, DFArcFrame::OnSetPlayOption)
EVT_CHECKBOX(ID_Joystick, DFArcFrame::OnSetPlayOption)
EVT_CHECKBOX(ID_Debug, DFArcFrame::OnSetPlayOption)
EVT_CHECKBOX(ID_V107, DFArcFrame::OnSetPlayOption)
END_EVENT_TABLE()
DFArcFrame::DFArcFrame() :
DFArcFrame_Base(NULL, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_STYLE),
mNoDmods(false),
mSelectedDModIndex(wxNOT_FOUND)
{
mConfig = Config::GetConfig();
PrepareGUI();
refreshDmodList();
mConfig->Update();
return;
}
void DFArcFrame::OnQuit(wxCommandEvent& aCommandEvent)
{
this->Close();
}
void DFArcFrame::OnAbout(wxCommandEvent& aCommandEvent)
{
// Use a wxString for concatenation with the date.
wxString version = wxT(PACKAGE_VERSION);
wxString wxs = wxString::Format(_(
"DFArc version %s\n"
"Copyright (C) 2004 Andrew Reading (merlin)\n"
"Copyright (C) 2005, 2006 Dan Walma (redink1)\n"
"Copyright (C) 2008-2014 Sylvain Beucler (Beuc)\n"
"Build Date: %s\n"
"Powered by bzip2 (bzip.org) and wxWidgets (wxwidgets.org)"),
version.c_str(), __TDATE__);
wxMessageBox(wxs, _("About DFArc v3"), wxOK | wxICON_INFORMATION, this);
}
// Display or hide "Edit" and "Package" buttons
void DFArcFrame::showDeveloperButtons(bool visible)
{
wxSizer *mButtonSizer = mEditButton->GetContainingSizer();
wxSizer *mImageSizer = mAnimationPanel->GetContainingSizer();
mImageSizer->Show(mButtonSizer, visible);
// Re-layout, starting with expanding mDModListBox
mDModListBox->GetContainingSizer()->Layout();
}
static wxBitmap CreateTextLogo(wxString text)
{
wxBitmap lLogo = wxBitmap(LOGO_WIDTH, LOGO_HEIGHT);
wxMemoryDC dc;
dc.SelectObject(lLogo);
dc.SetBackground(*wxBLACK_BRUSH);
dc.SetTextForeground(*wxWHITE);
dc.Clear();
// Center text
// (There seem to be a bug in GetTextExtent in wx2.8.10, the
// calculated width is smaller than the drawned width)
wxSize size = dc.GetTextExtent(text);
dc.DrawText(text,
(LOGO_WIDTH - size.GetWidth()) / 2,
(LOGO_HEIGHT - size.GetHeight()) / 2);
dc.SelectObject(wxNullBitmap);
return lLogo;
}
// GUI for main screen (with no args).
void DFArcFrame::PrepareGUI()
{
// Replace wxGlade's plain wxPanel with our custom class -
// cf. DFArcFrame_Base.cpp
wxSizer *sizer = mAnimationPanel->GetContainingSizer();
sizer->Detach(mAnimationPanel);
delete mAnimationPanel;
mAnimationPanel = new DFAnimationPanel(this, panel_1);
mAnimationPanel->SetMinSize(wxSize(160, 120));
sizer->Insert(1, mAnimationPanel, 0, wxLEFT|wxALIGN_BOTTOM|wxALIGN_CENTER_HORIZONTAL, 10);
// Features not supported by wxGlade:
SetIcon(wxIcon(dink_xpm));
mSplitter->SetSashGravity(0.5); // proportional outer resize
// Avoid 'unsplit' (where one of the pane is hidden)
mSplitter->SetMinimumPaneSize(20);
// Manual contraints
mDModListBox->SetMinSize(wxSize(150, 165));
mDmodDescription->SetMinSize(wxSize(-1, 220));
this->SetMinSize(this->GetBestSize());
mSplitter->SetSashPosition(0); // reset to middle pos (wx3 bug?)
this->SetSize(this->GetMinSize());
// user can override size restrictions:
mDmodDescription->SetMinSize(wxSize(-1, -1));
// Optionally show developper buttons
showDeveloperButtons(mConfig->mShowDeveloperButtons);
// Update the checkboxes
mTrueColor->SetValue(mConfig->mTrueColorValue);
mWindowed->SetValue(mConfig->mWindowedValue);
mSound->SetValue(mConfig->mSoundValue);
mJoystick->SetValue(mConfig->mJoystickValue);
mDebug->SetValue(mConfig->mDebugValue);
mV107->SetValue(mConfig->mV107Value);
// Default logo (currently all black with a question mark)
/* TRANSLATORS: please make this SHORT, possibly rephrasing as "<
Choose!". This is included in the 160x120px logo box in the main
window and it doesn't word-wrap. */
mDefaultLogoBitmap = CreateTextLogo(_("< Pick a D-Mod"));
((DFAnimationPanel*)mAnimationPanel)->setIndex(-1);
}
void DFArcFrame::updateDescription()
{
wxString lDescription;
// Set the current D-Mod directory to the currently selected item's client string
DMod cur_dmod = mAvailableDModsList.at(mSelectedDModIndex);
mConfig->mSelectedDmod = cur_dmod.GetFullPath();
mConfig->Update();
mDmodDescription->SetValue(cur_dmod.GetDescription());
mStatusBar->SetStatusText(mConfig->mSelectedDmod);
}
void DFArcFrame::SelectDModFromListBox()
{
int lb_index = mDModListBox->GetSelection();
if (lb_index != wxNOT_FOUND)
{
Integer *I = (Integer*)mDModListBox->GetClientObject(lb_index);
mSelectedDModIndex = I->i;
mConfig->mSelectedDmod = mAvailableDModsList.at(mSelectedDModIndex).GetFullPath();
mConfig->Update();
updateDescription();
mPlayButton->Enable();
mEditButton->Enable();
mPackageButton->Enable();
// Fill-in translations list
wxString cur_locale_name = mConfig->mForceLocale;
if (mConfig->mForceLocale == wxEmptyString) {
const wxLanguageInfo* li = wxLocale::GetLanguageInfo(wxLocale::GetSystemLanguage());
if (li != NULL)
cur_locale_name = li->CanonicalName;
}
mGameLocaleList->Clear();
wxArrayString mo_files;
wxString mo_dir = mConfig->mSelectedDmod + wxFileName::GetPathSeparator() + wxT("l10n");
if (wxDir::Exists(mo_dir)) {
wxDir::GetAllFiles(mo_dir, &mo_files, wxT("*.mo"));
mo_files.Sort();
for (int i = 0; i < mo_files.Count(); i++)
{
// dmod/l10n/fr/LC_MESSAGES/dmod.mo
wxFileName mo(mo_files.Item(i));
mo.RemoveLastDir();
wxArrayString dirs = mo.GetDirs();
wxString dir = dirs.Item(dirs.Count()-1);
wxString label = dir;
wxString locale_name = dir;
const wxLanguageInfo* li = wxLocale::FindLanguageInfo(locale_name);
if (li != NULL) {
label += wxT(" - ") + wxString(wxGetTranslation(li->Description));
locale_name = li->CanonicalName;
}
mGameLocaleList->Append(label);
mGameLocaleList->SetClientObject(i, new ClientDataString(locale_name));
if (cur_locale_name == locale_name)
mGameLocaleList->Select(i);
}
}
if (mGameLocaleList->GetCount() == 0) {
mGameLocaleList->Append(_("No translations"));
mGameLocaleList->Select(0);
mGameLocaleList->Disable();
} else {
// Not displaying the default language explicitely, because it
// makes the user think that a translation is always available.
// mGameLocaleList->Insert(wxString(_("Default language")) + wxT(" (") + cur_locale_name + wxT(")"), 0);
mGameLocaleList->Insert(_("Don't translate"), 0);
mGameLocaleList->SetClientObject(0, new ClientDataString(wxT("C")));
mGameLocaleList->Enable();
if (mGameLocaleList->GetSelection() == wxNOT_FOUND)
mGameLocaleList->Select(0);
}
#if defined _WIN32 || defined __WIN32__ || defined __CYGWIN__
// work-around wx3 bug -> default height=6 despite BestSize=21
mGameLocaleList->SetSize(wxSize(-1, mGameLocaleList->GetBestSize().y+1));
#endif
}
((DFAnimationPanel*)mAnimationPanel)->setIndex(lb_index);
}
void DFArcFrame::OnEvtListBox(wxCommandEvent &Event)
{
SelectDModFromListBox();
return;
}
// Function for Install menu entry
void DFArcFrame::Install(wxCommandEvent& aCommandEvent)
{
wxString description = _("D-Mod files (*.dmod)");
wxFileDialog FileDlg(0, _("Select a .dmod file"), _T(""), _T(""), description + _T("|*.dmod"),
wxFD_OPEN | wxFD_FILE_MUST_EXIST);
if (FileDlg.ShowModal() == wxID_OK)
{
InstallVerifyFrame lTemp(FileDlg.GetPath());
lTemp.ShowModal();
// Update the D-Mod list
refreshDmodList();
}
}
void DFArcFrame::onPackage(wxCommandEvent &Event)
{
DMod cur_dmod = mAvailableDModsList.at(mSelectedDModIndex);
Package* lPackage = new Package(cur_dmod);
lPackage->ShowModal();
lPackage->Destroy();
}
void DFArcFrame::OnSetPlayOption(wxCommandEvent &Event)
{
// Set variables
mConfig->mTrueColorValue = mTrueColor->IsChecked();
mConfig->mWindowedValue = mWindowed->IsChecked();
mConfig->mSoundValue = mSound->IsChecked();
mConfig->mJoystickValue = mJoystick->IsChecked();
mConfig->mDebugValue = mDebug->IsChecked();
mConfig->mV107Value = mV107->IsChecked();
mConfig->Update();
return;
}
wxString DFArcFrame::BuildCommand(enum program progname)
{
wxString lCommand;
wxString executable;
if (progname == GAME)
executable = mConfig->mDinkExe;
else
executable = mConfig->mEditorExe;
// Attempt to use the binary in the Dink directory (important for
// disambiguation under woe, where the PATH includes the current
// DFArc _binary_ directory (not cwd()) by default).
wxString test_dinkref = mConfig->GetDinkrefDir() + wxFileName::GetPathSeparator() + executable;
if (::wxFileExists(test_dinkref))
lCommand = test_dinkref;
else
lCommand = executable;
if (mConfig->mDebugValue == true)
lCommand += _T(" -debug ");
if (mConfig->mSoundValue == false)
lCommand += _T(" -nosound ");
if (mConfig->mTrueColorValue == true)
lCommand += _T(" -truecolor ");
if (mConfig->mWindowedValue == true)
lCommand += _T(" -window ");
if (mConfig->mWriteIniValue == false)
lCommand += _T(" -noini ");
if (mConfig->mJoystickValue == false)
lCommand += _T(" -nojoy ");
if (mConfig->mV107Value == true)
lCommand += _T(" --v1.07 ");
/* Specify the directory, as short as possible*/
wxString dinkref = mConfig->GetDinkrefDir();
wxFileName dmod_dir(mConfig->mSelectedDmod);
dmod_dir.MakeRelativeTo(dinkref);
if (dmod_dir.GetFullPath().StartsWith(_T("..")))
dmod_dir.MakeAbsolute(dinkref);
if (dmod_dir.GetFullPath().IsSameAs(_T("dink")))
dmod_dir = wxEmptyString;
if (!dmod_dir.GetFullName().IsEmpty())
{
wxString fullpath = dmod_dir.GetFullPath();
if (fullpath.Find(wxT(' ')) != wxNOT_FOUND)
// Only do that if necessary, quoting doesn't work with the
// original engine for some reason
fullpath = _T("\"") + dmod_dir.GetFullPath() + _T("\"");
lCommand += _T(" -game ") + fullpath;
}
/* Always specify the dinkref dir, because we don't know what
FreeDink's default refdir is. (/usr/local? /usr?...) */
/* Note: this is ignored by Seth and Dan's versions */
lCommand += _T(" --refdir \"") + mConfig->GetDinkrefDir() + _T("\"");
/* If at a point we need better escaping, it is suggested to replace
spaces with '\ ' under GNU/Linux and '" "' under woe -
http://trac.wxwidgets.org/ticket/4115#comment:22 . I wish the
wxWidgets dev properly fixed it with a wxExecute(wxArrayString)
version... */
return lCommand;
}
void DFArcFrame::OnPlay(wxCommandEvent &Event)
{
wxString lCommand = BuildCommand(GAME);
// Configure locale
wxString locale_name = mConfig->mForceLocale;
int idx = mGameLocaleList->GetSelection();
if (idx != wxNOT_FOUND && mGameLocaleList->HasClientObjectData())
{
wxClientData* wcd = mGameLocaleList->GetClientObject(idx);
if (wcd != NULL)
locale_name = ((ClientDataString*)wcd)->s;
}
wxEnvVariableHashMap env;
wxGetEnvMap(&env);
if (locale_name != wxEmptyString)
{
// locale_name is in the form 'xx_YY', e.g. 'da_DK'
// (gettext.info.gz)The LANGUAGE variable: LANGUAGE > LC_ALL > LC_* > LANG
env.erase("LANGUAGE");
env.erase("LC_ALL");
// Locales need to be precisely set, including the encoding,
// even if in the case of FreeDink, we don't need it.
// http://lists.gnu.org/archive/html/bug-gnu-utils/2010-10/msg00018.html
#if defined _WIN32 || defined __WIN32__ || defined __CYGWIN__ || defined __EMX__ || defined __DJGPP__
// Under woe, things are pretty sloppy, no worry - except that
// you won't get any warning if you lack fonts or whatever is
// needed for your language.
env["LC_ALL"] = locale_name;
#else
// Look through $(locale -a) and check if there's a matching
// locale, otherwise explain to the user that he needs to
// install the locale. Not sure if there's a similar method
// under woe to get the installed locales.
wxArrayString installed_locales;
long code = ::wxExecute("locale -a", installed_locales, wxEXEC_SYNC);
if (code == 0) // good exit code
{
bool found = false;
if (!found)
{
for (int i = 0; i < installed_locales.Count(); i++)
{
if (installed_locales.Item(i).StartsWith(locale_name))
{
found = true;
locale_name = installed_locales.Item(i);
env["LC_ALL"] = locale_name;
break;
}
}
}
if (!found)
{
// Try with the language name / without the country name
wxString language_name = locale_name.Mid(0,2);
for (int i = 0; i < installed_locales.Count(); i++)
{
if (installed_locales.Item(i).StartsWith(language_name))
{
found = true;
locale_name = installed_locales.Item(i);
env["LC_ALL"] = locale_name;
break;
}
}
}
if (!found)
{
// Poor-man's / fallback i18n:
// - LC_CTYPE and LC_MESSAGES to en_US.UTF-8 (if available)
// - LANGUAGE to the locale
found = (installed_locales.Index("en_US.UTF-8", false) != wxNOT_FOUND);
if (!found)
found = (installed_locales.Index("en_US.utf8", false) != wxNOT_FOUND);
if (found)
{
env["LC_CTYPE"] = "en_US.UTF-8";
env["LC_MESSAGES"] = "en_US.UTF-8";
env["LANGUAGE"] = locale_name;
}
}
if (!found)
::wxMessageBox(wxString::Format(_("The '%s' locale is not installed on your computer"
" (locales tells the computer how to manage a language)."
" You need to install it - check your system documentation."),
locale_name.c_str()), _("Warning"), wxICON_EXCLAMATION, this);
// try anyway; this also prevent fallback-ing to the system language
env["LC_ALL"] = locale_name;
}
#endif
}
// Start the child process.
long code = 0;
#if defined _WIN32 || defined __WIN32__ || defined __CYGWIN__ || defined __EMX__ || defined __DJGPP__
wxLogNull logNo; // remove redundant "Execution of command 'xxx' failed" popup
#endif
wxExecuteEnv exec_env;
exec_env.env = env;
MonitorDinkExit* process = new MonitorDinkExit(mConfig);
if ((code = ::wxExecute(lCommand, wxEXEC_ASYNC, process, &exec_env)) == 0)
{
// On woe, returns immediately if cannot run the process (not using fork&exec)
::wxMessageBox(wxString::Format(_("Dink Smallwood ('%s') was not found on your computer."
" Please configure the Dink program name in the Options menu."),
mConfig->mDinkExe.c_str(), wxICON_ERROR, this),
_("Error"));
delete process;
}
else if (mConfig->mCloseDfarcOnPlay)
{
// since we're async, DFArc will have exited before we know that e.g. Dink couldn't be found
this->Close(true);
}
}
void DFArcFrame::onEdit( wxCommandEvent& aEvent )
{
if (mConfig->mWarnOnEdit == true)
{
if (::wxMessageBox(_("Dinkedit saves all changes automatically."
" Altering maps can ruin the game."
" Are you sure you want to continue?"),
_("Warning"),
wxOK | wxCANCEL | wxICON_INFORMATION, this) == wxCANCEL)
{
return;
}
else
{
// Don't display the warning again
mConfig->mWarnOnEdit = false;
mConfig->Update();
}
}
wxString lCommand = BuildCommand(EDITOR);
// Start the child process.
long code = 0;
#if defined _WIN32 || defined __WIN32__ || defined __CYGWIN__ || defined __EMX__ || defined __DJGPP__
wxLogNull logNo; // remove redundant "Execution of command 'xxx' failed" popup
#endif
MonitorEditorExit* process = new MonitorEditorExit(mConfig);
if ((code = ::wxExecute(lCommand, wxEXEC_ASYNC, process)) == 0)
::wxMessageBox(wxString::Format(_("The editor ('%s') was not found on your computer."
" Please configure the editor program name in the Options menu."),
mConfig->mEditorExe.c_str()),
_("Error"));
}
void DFArcFrame::onRefresh( wxCommandEvent& aEvent )
{
refreshDmodList();
return;
}
void DFArcFrame::onDownload( wxCommandEvent& aEvent )
{
::wxLaunchDefaultBrowser(_T("http://www.dinknetwork.com/"));
}
void DFArcFrame::onWalkthroughs( wxCommandEvent& aEvent )
{
::wxLaunchDefaultBrowser(_T("http://solutions.dinknetwork.com/"));
}
void DFArcFrame::onForums( wxCommandEvent& aEvent )
{
::wxLaunchDefaultBrowser(_T("http://www.dinknetwork.com/forum.cgi"));
}
void DFArcFrame::onBrowse( wxCommandEvent& aEvent )
{
wxString cur_dmod_dir = mConfig->mSelectedDmod;
if (mConfig->mPreferredFileBrowserExe.IsEmpty())
{
// Try default browser(s)
#if defined _WIN32 || defined __WIN32__ || defined __CYGWIN__
// Use '\' to force opening the directory, not dink.exe...
::ShellExecute(0, _T("open"), (cur_dmod_dir + wxT("\\")).c_str(), NULL, NULL, SW_SHOW);
#else
/* Crudely escape spaces, since wxWidgets 2.8 doesn't have a
proper way to separate command line arguments */
cur_dmod_dir.Replace(wxT(" "), wxT("\\ "), true);
if (::wxExecute(_T("xdg-open ") + cur_dmod_dir) < 0) // FreeDesktop
if (::wxExecute(_T("nautilus ") + cur_dmod_dir) < 0) // Gnome
if (::wxExecute(_T("konqueror ") + cur_dmod_dir) < 0) // KDE
if (::wxExecute(_T("thunar ") + cur_dmod_dir) < 0) // Xfce
::wxMessageBox(_("Could not find a file manager"
" (tried 'xdg-open', 'nautilus', 'konqueror' and 'thunar')"),
_("Error"), wxICON_ERROR);
#endif
}
else
{
if (::wxExecute(mConfig->mPreferredFileBrowserExe + _T(" ") + cur_dmod_dir) < 0)
::wxMessageBox(wxString::Format(_("Cannot start '%s', please check your"
" configuration in the Options window."),
mConfig->mPreferredFileBrowserExe.c_str()),
_("Error"), wxICON_ERROR);
}
return;
}
void DFArcFrame::showIntroductionText(wxCommandEvent& aEvent)
{
::wxMessageBox(_("Welcome to DFArc, the Dink Smallwood front end!\n"
"\n"
"You can choose to play the original game (Dink Smallwood) or"
" Dink-Modules (D-Mods) which contain new adventures.\n"
"\n"
"After completing the main game, give some D-Mods a try.\n"
"There are hundreds of them, just click File-Download D-Mods."),
_("Introduction"),
wxOK | wxICON_INFORMATION, this);
return;
}
void DFArcFrame::onShow(wxShowEvent& aEvent)
{
if (mConfig->mShowIntroductionText == true)
{
wxCommandEvent se;
showIntroductionText(se);
mConfig->mShowIntroductionText = false;
mConfig->Update();
}
return;
}
void DFArcFrame::refreshDmodList()
{
mDModListBox->Clear();
populateAvailableDModsList();
if (mAvailableDModsList.empty() == false)
{
mNoDmods = false;
for (unsigned int i = 0; i < mAvailableDModsList.size(); i++)
{
// Using 'wxClientData*' as int for simplicity.
Integer *I = new Integer(i);
mDModListBox->Append(mAvailableDModsList.at(i).GetTitle(), I);
}
}
else
{
mNoDmods = true;
}
refreshDmodLogos();
RestoreListBoxFromConfig();
}
/**
* Create a big image with all the D-Mods logos, used for the
* transition effect that happens when selecting a different D-Mod.
*/
void DFArcFrame::refreshDmodLogos()
{
mAllLogos = wxBitmap(LOGO_WIDTH, (mDModListBox->GetCount()+1) * LOGO_HEIGHT);
wxMemoryDC lAllDC(mAllLogos);
lAllDC.DrawBitmap(mDefaultLogoBitmap, 0,0, false);
for (unsigned int i = 0; i < mDModListBox->GetCount(); i++)
{
Integer *I = (Integer*)mDModListBox->GetClientObject(i);
int cur_dmod_index = I->i;
DMod cur_dmod = mAvailableDModsList.at(cur_dmod_index);
wxBitmap lLogoBitmap;
wxString lDmodPreview(cur_dmod.GetFullPath() + _T("/preview.bmp"));
IOUtils::ciconvert(lDmodPreview);
wxString lDmodTitle(cur_dmod.GetFullPath() + _T("/graphics/title-01.bmp"));
IOUtils::ciconvert(lDmodTitle);
if (::wxFileExists(lDmodPreview) == true)
{
lLogoBitmap = wxBitmap(lDmodPreview, wxBITMAP_TYPE_BMP);
}
else if (::wxFileExists(lDmodTitle) == true)
{
wxImage lImage(lDmodTitle);
lImage.Rescale(LOGO_WIDTH, LOGO_HEIGHT);
lLogoBitmap = wxBitmap(lImage);
}
else
{
lLogoBitmap = CreateTextLogo(cur_dmod.GetBaseName());
}
lLogoBitmap.SetWidth(LOGO_WIDTH);
lLogoBitmap.SetHeight(LOGO_HEIGHT);
lAllDC.DrawBitmap(lLogoBitmap, 0,(i+1)*LOGO_HEIGHT, false);
//mLogoButton->SetBitmap(lLogoBitmap);
//wxMemoryDC src(lLogoBitmap);
//wxBitmap dst_bitmap = mLogoButton->GetBitmap();
//wxMemoryDC dst(dst_bitmap);
//dst.Blit(0,0, LOGO_WIDTH, LOGO_HEIGHT, &src, 0,0);
//dst.DrawBitmap(lLogoBitmap, 0,0, false);
//dst.DrawRectangle(0,0, LOGO_WIDTH,LOGO_HEIGHT);
//mLogoButton->SetBitmap(dst_bitmap);
}
}
/**
* Select DMod from configuration
*/
void DFArcFrame::RestoreListBoxFromConfig()
{
int lb_index_to_select = wxNOT_FOUND;
// Update the selection
if (!mConfig->mSelectedDmod.IsEmpty())
{
for (unsigned int i = 0; i < mDModListBox->GetCount(); i++)
{
Integer *I = (Integer*)mDModListBox->GetClientObject(i);
int cur_dmod_index = I->i;
DMod cur_dmod = mAvailableDModsList.at(cur_dmod_index);
if (cur_dmod.GetFullPath().IsSameAs(mConfig->mSelectedDmod))
{
lb_index_to_select = i;
break;
}
}
mDModListBox->SetSelection(lb_index_to_select);
SelectDModFromListBox();
}
else
{
mPlayButton->Disable();
mEditButton->Disable();
mPackageButton->Disable();
((DFAnimationPanel*)mAnimationPanel)->setIndex(-1);
}
}
void DFArcFrame::showOptions(wxCommandEvent& aEvent)
{
Options* lOptions = new Options(mConfig);
if (lOptions->ShowModal() == 1)
{
// Apply configuration changes
showDeveloperButtons(mConfig->mShowDeveloperButtons);
if (mConfig->mOverrideDinkrefDir)
{
if (::wxDirExists(mConfig->mSpecifiedDinkrefDir))
{
// Get the full path to the directory, in case users type in a non-full path.
if (::wxSetWorkingDirectory(mConfig->mSpecifiedDinkrefDir))
{
mConfig->mSpecifiedDinkrefDir = ::wxGetCwd();
}
else
{
// If there's no directory, let's not override
::wxMessageBox(_("Cannot use the overridden Dink Smallwood directory"
" - ignoring it. (permission problem?)"),
_("Configuration error"));
mConfig->mOverrideDinkrefDir = false;
}
}
else
{
// If there's no directory, let's not override
::wxMessageBox(_("The Dink Smallwood directory you entered does not exist - ignoring it."),
_("Configuration error"));
mConfig->mOverrideDinkrefDir = false;
}
}
refreshDmodList();
}
lOptions->Destroy();
return;
}
void DFArcFrame::uninstall( wxCommandEvent& aEvent )
{
if (mConfig->mSelectedDmod == _T("dink"))
{
wxMessageBox(_("You must select the uninstall option from the start menu to uninstall the main game."),
_("Uninstall - Error"),
wxOK | wxICON_INFORMATION, this);
}
else
{
int lResult = wxMessageBox(_("Do you want to remove all save game files?"),
_("Uninstall - Save Game Files"),
wxYES_NO | wxCANCEL | wxICON_QUESTION, this);
if (lResult != wxCANCEL)
{
bool lRemoveSaveGames(false);
if (lResult == wxYES)
{
lRemoveSaveGames = true;
}
RecursiveDelete lRecursiveDelete(lRemoveSaveGames);
wxDir* lDir = new wxDir(mConfig->mSelectedDmod);
lDir->Traverse(lRecursiveDelete);
delete lDir;
if (lRecursiveDelete.getError() == false)
{
bool lSuccess(true);
if (lRemoveSaveGames == true)
{
if (::wxRmdir(mConfig->mSelectedDmod) == false)
{
wxLogError(_("Unable to remove D-Mod directory. All other files were removed."));
lSuccess = false;
}
}
if (lSuccess == true)
{
wxMessageBox(_("D-Mod successfully uninstalled"),
_("Uninstall - Success"),
wxOK | wxICON_INFORMATION, this);
}
}
mConfig->mSelectedDmod = wxEmptyString;
refreshDmodList();
}
}
return;
}
/**
* This finds all of the DMods.
*/
void DFArcFrame::populateAvailableDModsList()
{
mAvailableDModsList.clear();
wxString* folders = new wxString[2];
folders[0] = mConfig->GetDinkrefDir();
folders[1] = mConfig->mDModDir;
for (int i = 0; i < 2; i++)
{
if (folders[i].IsEmpty() || !::wxDirExists(folders[i]))
continue;
wxDir lDirectory(folders[i]);
if (lDirectory.IsOpened() == false)
continue;
// Grab dir names.
wxString lCurrentFolder;
bool cont = lDirectory.GetFirst(&lCurrentFolder, wxEmptyString, wxDIR_DIRS);
while (cont)
{
wxString full_path = folders[i] + wxFileName::GetPathSeparator() + lCurrentFolder;
if (DMod::IsADModDir(full_path))
mAvailableDModsList.push_back(DMod(full_path));
cont = lDirectory.GetNext(&lCurrentFolder);
}
}
delete[] folders;
return;
}
dfarc-3.12/src/Options_Base.cpp 0000755 0001750 0001751 00000012466 12420022015 013320 0000000 0000000 // -*- C++ -*-
//
// generated by wxGlade b221e052e911 on Thu Oct 16 22:01:17 2014
//
// Example for compiling a single file project under Linux using g++:
// g++ MyApp.cpp $(wx-config --libs) $(wx-config --cxxflags) -o MyApp
//
// Example for compiling a multi file project under Linux using g++:
// g++ main.cpp $(wx-config --libs) $(wx-config --cxxflags) -o MyApp Dialog1.cpp Frame1.cpp
//
#include "Options_Base.h"
// begin wxGlade: ::extracode
// end wxGlade
Options_Base::Options_Base(wxWindow* parent, int id, const wxString& title, const wxPoint& pos, const wxSize& size, long style):
wxDialog(parent, id, title, pos, size, wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER|wxTHICK_FRAME)
{
// begin wxGlade: Options_Base::Options_Base
mCloseCheck = new wxCheckBox(this, wxID_ANY, _("Close DFArc on play"));
mShowDeveloperCheck = new wxCheckBox(this, wxID_ANY, _("Show developer buttons"));
mWriteIniCheck = new wxCheckBox(this, wxID_ANY, _("The engine updates dinksmallwood.ini on run (deprecated)"));
mOverrideDinkrefDirCheck = new wxCheckBox(this, wxID_ANY, _("Override the Dink Smallwood directory"));
mOverrideDinkrefDirBox = new wxTextCtrl(this, wxID_ANY, wxEmptyString);
mOverrideDinkrefDirBrowse = new wxButton(this, ID_OVERRIDE_DINKREFDIR_BROWSE, _("Browse"));
lDModDirLabel = new wxStaticText(this, wxID_ANY, _("Additional D-Mods directory"));
mDModDirBox = new wxTextCtrl(this, wxID_ANY, wxEmptyString);
mDModDirBrowse = new wxButton(this, ID_DMODDIR_BROWSE, _("Browse"));
lDinkExeLabel = new wxStaticText(this, wxID_ANY, _("Game program name"));
const wxString *mDinkExeBox_choices = NULL;
mDinkExeBox = new wxComboBox(this, wxID_ANY, wxT(""), wxDefaultPosition, wxDefaultSize, 0, mDinkExeBox_choices, wxCB_DROPDOWN|wxCB_SORT);
lEditorExeLabel = new wxStaticText(this, wxID_ANY, _("Editor program name"));
const wxString *mEditorExeBox_choices = NULL;
mEditorExeBox = new wxComboBox(this, wxID_ANY, wxT(""), wxDefaultPosition, wxDefaultSize, 0, mEditorExeBox_choices, wxCB_DROPDOWN|wxCB_SORT);
mPreferredFileBrowserLabel = new wxStaticText(this, wxID_ANY, _("Preferred file browser"));
mPreferredFileBrowserBox = new wxTextCtrl(this, wxID_ANY, wxEmptyString);
lForceLocaleLabel = new wxStaticText(this, wxID_ANY, _("DFArc language\n(restart DFArc to apply)"));
const wxString *mLanguageList_choices = NULL;
mLanguageList = new wxChoice(this, ID_LANGUAGE_LIST, wxDefaultPosition, wxDefaultSize, 0, mLanguageList_choices, 0);
mForceLocaleBox = new wxTextCtrl(this, wxID_ANY, wxEmptyString);
lOkay = new wxButton(this, wxID_OK, wxEmptyString);
lCancel = new wxButton(this, wxID_CANCEL, wxEmptyString);
set_properties();
do_layout();
// end wxGlade
}
void Options_Base::set_properties()
{
// begin wxGlade: Options_Base::set_properties
SetTitle(_("DFArc - Options"));
lOkay->SetDefault();
// end wxGlade
}
void Options_Base::do_layout()
{
// begin wxGlade: Options_Base::do_layout
wxBoxSizer* lMainSizer = new wxBoxSizer(wxVERTICAL);
wxBoxSizer* lChoicesSizer = new wxBoxSizer(wxHORIZONTAL);
wxBoxSizer* lForceLocaleSizer = new wxBoxSizer(wxHORIZONTAL);
wxBoxSizer* sizer_1 = new wxBoxSizer(wxVERTICAL);
wxBoxSizer* mPreferredFileBrowserSizer = new wxBoxSizer(wxHORIZONTAL);
wxBoxSizer* lEditorExeSizer = new wxBoxSizer(wxHORIZONTAL);
wxBoxSizer* lDinkExeSizer = new wxBoxSizer(wxHORIZONTAL);
wxBoxSizer* dmoddir = new wxBoxSizer(wxHORIZONTAL);
wxBoxSizer* lOverrideSizer = new wxBoxSizer(wxHORIZONTAL);
lMainSizer->Add(mCloseCheck, 0, wxLEFT|wxRIGHT|wxTOP, 10);
lMainSizer->Add(mShowDeveloperCheck, 0, wxLEFT|wxRIGHT|wxTOP, 10);
lMainSizer->Add(mWriteIniCheck, 0, wxLEFT|wxRIGHT|wxTOP, 10);
lOverrideSizer->Add(mOverrideDinkrefDirCheck, 0, 0, 0);
lOverrideSizer->Add(mOverrideDinkrefDirBox, 1, wxLEFT, 10);
lOverrideSizer->Add(mOverrideDinkrefDirBrowse, 0, wxLEFT, 10);
lMainSizer->Add(lOverrideSizer, 0, wxLEFT|wxRIGHT|wxTOP|wxEXPAND, 10);
dmoddir->Add(lDModDirLabel, 0, 0, 0);
dmoddir->Add(mDModDirBox, 1, wxLEFT, 10);
dmoddir->Add(mDModDirBrowse, 0, wxLEFT, 10);
lMainSizer->Add(dmoddir, 0, wxLEFT|wxRIGHT|wxTOP|wxEXPAND, 10);
lDinkExeSizer->Add(lDinkExeLabel, 0, 0, 10);
lDinkExeSizer->Add(mDinkExeBox, 1, wxLEFT, 10);
lMainSizer->Add(lDinkExeSizer, 0, wxLEFT|wxRIGHT|wxTOP|wxEXPAND, 10);
lEditorExeSizer->Add(lEditorExeLabel, 0, 0, 10);
lEditorExeSizer->Add(mEditorExeBox, 1, wxLEFT, 10);
lMainSizer->Add(lEditorExeSizer, 0, wxLEFT|wxRIGHT|wxTOP|wxEXPAND, 10);
mPreferredFileBrowserSizer->Add(mPreferredFileBrowserLabel, 0, wxLEFT, 0);
mPreferredFileBrowserSizer->Add(mPreferredFileBrowserBox, 1, wxLEFT, 10);
lMainSizer->Add(mPreferredFileBrowserSizer, 0, wxLEFT|wxRIGHT|wxTOP|wxEXPAND, 10);
lForceLocaleSizer->Add(lForceLocaleLabel, 0, 0, 10);
sizer_1->Add(mLanguageList, 0, wxEXPAND, 0);
sizer_1->Add(mForceLocaleBox, 0, wxEXPAND, 0);
lForceLocaleSizer->Add(sizer_1, 1, wxLEFT|wxEXPAND, 10);
lMainSizer->Add(lForceLocaleSizer, 0, wxLEFT|wxRIGHT|wxTOP|wxEXPAND, 10);
lChoicesSizer->Add(lOkay, 0, wxALIGN_BOTTOM, 0);
lChoicesSizer->Add(lCancel, 0, wxLEFT|wxALIGN_BOTTOM, 10);
lMainSizer->Add(lChoicesSizer, 1, wxALL|wxALIGN_BOTTOM, 10);
SetSizer(lMainSizer);
lMainSizer->Fit(this);
Layout();
// end wxGlade
}
dfarc-3.12/src/icon_xpm.cpp 0000664 0001750 0001751 00000005354 12340110733 012552 0000000 0000000 /**
* Converted from dink.ico, from the Dink source code release
*/
/*
*** Dink Smallwood Source License Information ***
This software is provided "as is" without express or implied
warranties. You may freely use, modify and distribute this
source provided that the copyright text below is included in
the resulting source code, for example:
"Portions Copyright (C) Seth A. Robinson, 1997-2003
You may use this source in personal and commercial products, you
are not required to release the source code.
Please note that sharing this source does not in any way relinquish interest or forfeit any rights enjoyed by
Robinson Technologies and Seth A. Robinson concerning the name Dink Smallwood and related media includeding graphics,
sounds, music, scripts and map data. (hereafter referred to as "Dink Smallwood Media").
Repackaging or distributing the Dink Smallwood Media in a modified format requires permission from
Seth A. Robinson. Please consult the license included with the Dink Smallwood full version distribution for
more information.
Fastfile.*, ffcreate.*, dsutil.* and ddutil.* are copyrighted by the Microsoft Corporation and excluded
from the above license.
-Seth A. Robinson (seth@rtsoft.com)
www.rtsoft.com
*/
/*
In case this isn't clear enough, here's a statement of intent
clarifying that the icon is free and not covered by the stanza about
the "Dink Smallwood Media":
http://lists.gnu.org/archive/html/bug-freedink/2008-09/msg00008.html
*/
/* XPM */
const char *dink_xpm[] = {
"32 32 8 1",
" c None",
". c #000000",
"+ c #808080",
"@ c #0000FF",
"# c #808000",
"$ c #C0C0C0",
"% c #800000",
"& c #FFFFFF",
" . ...+",
" .@. .##.",
" .@@@. . .####",
" .@$@. .#. .##%..",
" .@@$@@. .##. .##%. ",
" ..@@$&$@@..########.##.##%. ",
" .@@@$&&&$@@@.......#.###.%. ",
".@@$$&&&&&$$@@@.%%%..$.###. ",
" .@@@$&&&$@@@..%%%%.&&$.###. ",
" #..@@$&$@@..%%%%%.&&$$&.###. ",
" #.%.@@$@@.%%%%%%.&&$&&$...##. ",
" #..%.@$@.%%%%%%.&&$&&$...#.. ",
" ##.%.@@@.%.....&&$&$$.%%.## ",
" #.%%.@.%%%.#.&&$&$$.%%%..## ",
" #.%%.@.%%%..&&$&$..%%%%%.## ",
" #.%%%.%%%..&&$&$.##.%%%%.## ",
" #...%%%...&.$&$.###.%%%%.## ",
" ###..%.#.#.#.$.#####.%%%.## ",
" ###.%%.#.#.#.######.%%.#.# ",
" ##.%%..#.#.#.#####.%%.#..# ",
" ##..%.&....................##",
" ###.%.&$.%%%%%#%#%##%####.....",
" ##....&$&.#.#.#..............##",
"##..%.&$&.#.#.#.#####.%%%.#..# ",
"#..%%.$$.#.#.#.#####.%%%..#.# ",
"#.%%%..........#####.%%%.### ",
"#.%%....%%%%%%%..#..%%%..# ",
"#.%%.##..%%%%%%%%.%%%%..## ",
"#.%..###..%%%%%%%%%%%..## ",
"#...## ##...%%%%%%%...## ",
"##### ###.........### ",
" ########### "};
dfarc-3.12/src/Config.hpp 0000664 0001750 0001751 00000002756 12340110733 012153 0000000 0000000 /**
* Application configuration values
* Copyright (C) 2008 Sylvain Beucler
* This file is part of GNU FreeDink
* GNU FreeDink 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.
* GNU FreeDink 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
* .
*/
#ifndef _CONFIG_HPP
#define _CONFIG_HPP
#include /* set appropriate wxConfig subclass */
class Config
{
public:
static Config* GetConfig();
Config();
~Config();
void Update();
wxString GetDinkrefDir();
bool mTrueColorValue;
bool mWindowedValue;
bool mSoundValue;
bool mJoystickValue;
bool mDebugValue;
bool mV107Value;
bool mShowIntroductionText;
bool mWarnOnEdit;
wxString mSelectedDmod;
bool mCloseDfarcOnPlay;
bool mShowDeveloperButtons;
bool mWriteIniValue;
bool mOverrideDinkrefDir;
wxString mSpecifiedDinkrefDir;
wxString mDModDir;
wxString mDinkExe;
wxString mEditorExe;
wxString mPreferredFileBrowserExe;
wxString mForceLocale;
private:
wxConfig* mwxConfig;
};
#endif
dfarc-3.12/src/DMod.cpp 0000664 0001750 0001751 00000006270 12340110733 011557 0000000 0000000 /**
* DMod metadata
* Copyright (C) 2008 Sylvain Beucler
* This file is part of GNU FreeDink
* GNU FreeDink 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.
* GNU FreeDink 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
* .
*/
#include
#include
#include "DMod.hpp"
#include "IOUtils.hpp"
/**
* DMod auto-detection: either main.c or start.c must exist (otherwise
* I don't see how a D-Mod can be started).
*/
bool DMod::IsADModDir(wxString full_path)
{
wxString mainc_path = full_path + _T("/story/main.c");
wxString startc_path = full_path + _T("/story/start.c");
wxString maind_path = full_path + _T("/story/main.d");
wxString startd_path = full_path + _T("/story/start.d");
IOUtils::ciconvert(mainc_path);
IOUtils::ciconvert(startc_path);
IOUtils::ciconvert(maind_path);
IOUtils::ciconvert(startd_path);
return ::wxFileExists(mainc_path) || ::wxFileExists(startc_path)
|| ::wxFileExists(maind_path) || ::wxFileExists(startd_path);
}
DMod::DMod(wxString full_path)
{
mFullPath = full_path;
wxFileName tmp(full_path); // no trailing slash
mBaseName = tmp.GetName();
mDescription = GetDModDizContent();
mTitle = GetDModDizTitle();
wxString lGfxPreview(mFullPath + _T("/preview.bmp"));
IOUtils::ciconvert(lGfxPreview);
wxString lGfxTitle(mFullPath + _T("/graphics/title-01.bmp"));
IOUtils::ciconvert(lGfxTitle);
if (::wxFileExists(lGfxPreview))
mPreviewPath = lGfxPreview;
else if (::wxFileExists(lGfxTitle))
mPreviewPath = lGfxTitle;
else
mPreviewPath = wxEmptyString;
}
wxString DMod::GetFullPath()
{
return mFullPath;
}
wxString DMod::GetBaseName()
{
return mBaseName;
}
wxString DMod::GetTitle()
{
return mTitle;
}
wxString DMod::GetDescription()
{
return mDescription;
}
wxString DMod::GetPreviewPath()
{
return mPreviewPath;
}
wxString DMod::GetDModDizContent()
{
wxString content;
wxString lDModDizPath = mFullPath + _T("/dmod.diz");
IOUtils::ciconvert(lDModDizPath);
if (!lDModDizPath.IsEmpty() && ::wxFileExists(lDModDizPath))
{
wxFile f(lDModDizPath);
if (f.Length() < 100000)
{
char *buf = (char*)malloc(f.Length() + 1);
f.Read(buf, f.Length());
buf[f.Length()] = '\0';
// dmod.diz are typically uncoded in ISO-8859-1/latin-1
// TODO: find a way for new DMod authors to specify UTF-8
content = wxString(buf, wxConvISO8859_1);
free(buf);
f.Close();
}
}
return content;
}
wxString DMod::GetDModDizTitle()
{
wxString lTitle;
char ch;
int i = 0;
while(((ch = mDescription.GetChar(i)) != '\n')
&& (ch != '\r')
&& (i < mDescription.Len()))
i++;
if (i > 0)
lTitle = mDescription.Mid(0, i);
else
lTitle = mBaseName;
return lTitle;
}
dfarc-3.12/src/DFArcFrame_Base.cpp 0000755 0001750 0001751 00000013523 12420022015 013552 0000000 0000000 // -*- C++ -*-
//
// generated by wxGlade b221e052e911 on Thu Oct 16 22:01:17 2014
//
// Example for compiling a single file project under Linux using g++:
// g++ MyApp.cpp $(wx-config --libs) $(wx-config --cxxflags) -o MyApp
//
// Example for compiling a multi file project under Linux using g++:
// g++ main.cpp $(wx-config --libs) $(wx-config --cxxflags) -o MyApp Dialog1.cpp Frame1.cpp
//
#include "DFArcFrame_Base.h"
// begin wxGlade: ::extracode
// end wxGlade
DFArcFrame_Base::DFArcFrame_Base(wxWindow* parent, int id, const wxString& title, const wxPoint& pos, const wxSize& size, long style):
wxFrame(parent, id, title, pos, size, wxDEFAULT_FRAME_STYLE)
{
// begin wxGlade: DFArcFrame_Base::DFArcFrame_Base
mSplitter = new wxSplitterWindow(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_LIVE_UPDATE|wxCLIP_CHILDREN);
panel_1 = new wxPanel(mSplitter, wxID_ANY);
lMenuBar = new wxMenuBar();
wxMenu* lFileMenu = new wxMenu();
lFileMenu->Append(ID_FileInstall, _("&Open D-Mod to Install"), _("Select a D-Mod to install"), wxITEM_NORMAL);
lFileMenu->Append(ID_Download, _("&Download D-Mods"), _("Go to The Dink Network to download some D-Mods!"), wxITEM_NORMAL);
lFileMenu->AppendSeparator();
lFileMenu->Append(wxID_EXIT, _("E&xit"), _("Exit DFArc"), wxITEM_NORMAL);
lMenuBar->Append(lFileMenu, _("&File"));
wxMenu* lEditMenu = new wxMenu();
lEditMenu->Append(ID_Refresh, _("&Refresh D-Mod List"), _("Refreshes the D-Mod list for any new additions"), wxITEM_NORMAL);
lEditMenu->Append(ID_Browse, _("&Browse Selected D-Mod Directory"), _("Browse to the directory containing the current D-Mod"), wxITEM_NORMAL);
lEditMenu->Append(ID_Uninstall, _("&Uninstall Selected D-Mod"), _("Uninstalls the selected D-Mod"), wxITEM_NORMAL);
lEditMenu->AppendSeparator();
lEditMenu->Append(ID_Options, _("&Options"), _("View or modify DFArc options"), wxITEM_NORMAL);
lMenuBar->Append(lEditMenu, _("&Edit"));
wxMenu* lHelpMenu = new wxMenu();
lHelpMenu->Append(ID_IntroductionText, _("&Introduction"), _("A quick introduction to Dinking and D-Mods"), wxITEM_NORMAL);
lHelpMenu->Append(ID_Walkthroughs, _("&Walkthroughs and Guides"), _("Stuck in a D-Mod? Check out The Dink Smallwood Solutions."), wxITEM_NORMAL);
lHelpMenu->Append(ID_Forums, _("&Forums"), _("Ask a question on the forums, or see if someone had the same problem."), wxITEM_NORMAL);
lHelpMenu->AppendSeparator();
lHelpMenu->Append(wxID_ABOUT, _("&About"), _("About DFArc"), wxITEM_NORMAL);
lMenuBar->Append(lHelpMenu, _("&Help"));
SetMenuBar(lMenuBar);
mStatusBar = CreateStatusBar(1, wxST_SIZEGRIP);
const wxString *mDModListBox_choices = NULL;
mDModListBox = new wxListBox(panel_1, ID_DmodTitleList, wxDefaultPosition, wxDefaultSize, 0, mDModListBox_choices, wxLB_SINGLE|wxLB_NEEDED_SB|wxLB_SORT);
mPlayButton = new wxButton(panel_1, ID_Play, _("Play"));
mTrueColor = new wxCheckBox(panel_1, ID_Truecolor, _("True Color"));
mWindowed = new wxCheckBox(panel_1, ID_Windowed, _("Windowed"));
mSound = new wxCheckBox(panel_1, ID_Sound, _("Sound"));
mJoystick = new wxCheckBox(panel_1, ID_Joystick, _("Joystick"));
mDebug = new wxCheckBox(panel_1, ID_Debug, _("Debug"));
mV107 = new wxCheckBox(panel_1, ID_V107, _("v1.07 mode"));
mEditButton = new wxButton(panel_1, ID_Edit, _("Edit"));
mPackageButton = new wxButton(panel_1, ID_Package, _("Package"));
mAnimationPanel = new wxPanel(panel_1, wxID_ANY);
const wxString *mGameLocaleList_choices = NULL;
mGameLocaleList = new wxChoice(panel_1, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, mGameLocaleList_choices, 0);
mDmodDescription = new wxTextCtrl(mSplitter, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY);
set_properties();
do_layout();
// end wxGlade
}
void DFArcFrame_Base::set_properties()
{
// begin wxGlade: DFArcFrame_Base::set_properties
SetTitle(_("DFArc v3"));
int mStatusBar_widths[] = { -1 };
mStatusBar->SetStatusWidths(1, mStatusBar_widths);
const wxString mStatusBar_fields[] = {
wxEmptyString
};
for(int i = 0; i < mStatusBar->GetFieldsCount(); ++i) {
mStatusBar->SetStatusText(mStatusBar_fields[i], i);
}
mPlayButton->SetDefault();
mV107->SetToolTip(_("v1.07 compatibility mode, for D-Mods released before 2006"));
mAnimationPanel->SetMinSize(wxSize(160, 120));
mGameLocaleList->Enable(0);
// end wxGlade
}
void DFArcFrame_Base::do_layout()
{
// begin wxGlade: DFArcFrame_Base::do_layout
wxBoxSizer* root_sizer = new wxBoxSizer(wxHORIZONTAL);
wxBoxSizer* lTopSizer = new wxBoxSizer(wxHORIZONTAL);
wxBoxSizer* mImageSizer = new wxBoxSizer(wxVERTICAL);
wxBoxSizer* mButtonSizer = new wxBoxSizer(wxHORIZONTAL);
wxBoxSizer* lPlaySizer = new wxBoxSizer(wxVERTICAL);
lTopSizer->Add(mDModListBox, 1, wxLEFT|wxEXPAND, 0);
lPlaySizer->Add(mPlayButton, 0, wxBOTTOM, 10);
lPlaySizer->Add(mTrueColor, 0, wxBOTTOM, 7);
lPlaySizer->Add(mWindowed, 0, wxBOTTOM, 7);
lPlaySizer->Add(mSound, 0, wxBOTTOM, 7);
lPlaySizer->Add(mJoystick, 0, wxBOTTOM, 7);
lPlaySizer->Add(mDebug, 0, wxBOTTOM, 7);
lPlaySizer->Add(mV107, 0, wxBOTTOM, 7);
lTopSizer->Add(lPlaySizer, 0, wxLEFT|wxEXPAND, 10);
mButtonSizer->Add(mEditButton, 0, wxLEFT, 10);
mButtonSizer->Add(mPackageButton, 0, wxLEFT, 10);
mImageSizer->Add(mButtonSizer, 0, wxBOTTOM|wxEXPAND, 10);
mImageSizer->Add(mAnimationPanel, 0, wxLEFT|wxALIGN_BOTTOM|wxALIGN_CENTER_HORIZONTAL, 10);
mImageSizer->Add(mGameLocaleList, 0, wxTOP|wxEXPAND, 10);
lTopSizer->Add(mImageSizer, 0, wxLEFT|wxEXPAND, 10);
panel_1->SetSizer(lTopSizer);
mSplitter->SplitHorizontally(panel_1, mDmodDescription);
root_sizer->Add(mSplitter, 1, wxEXPAND, 0);
SetSizer(root_sizer);
root_sizer->Fit(this);
Layout();
// end wxGlade
}
dfarc-3.12/src/DFArcFrame_Base.h 0000755 0001750 0001751 00000005027 12420022015 013217 0000000 0000000 // -*- C++ -*-
//
// generated by wxGlade b221e052e911 on Thu Oct 16 22:01:17 2014
//
// Example for compiling a single file project under Linux using g++:
// g++ MyApp.cpp $(wx-config --libs) $(wx-config --cxxflags) -o MyApp
//
// Example for compiling a multi file project under Linux using g++:
// g++ main.cpp $(wx-config --libs) $(wx-config --cxxflags) -o MyApp Dialog1.cpp Frame1.cpp
//
#ifndef DFARCFRAME_BASE_H
#define DFARCFRAME_BASE_H
#include
#include
#include "wx/intl.h"
#ifndef APP_CATALOG
#define APP_CATALOG "app" // replace with the appropriate catalog name
#endif
// begin wxGlade: ::dependencies
#include
// end wxGlade
// begin wxGlade: ::extracode
// end wxGlade
class DFArcFrame_Base: public wxFrame {
public:
// begin wxGlade: DFArcFrame_Base::ids
enum {
ID_FileInstall = wxID_HIGHEST + 1009,
ID_Download = wxID_HIGHEST + 1010,
ID_Refresh = wxID_HIGHEST + 1011,
ID_Browse = wxID_HIGHEST + 1012,
ID_Uninstall = wxID_HIGHEST + 1013,
ID_Options = wxID_HIGHEST + 1014,
ID_IntroductionText = wxID_HIGHEST + 1015,
ID_Walkthroughs = wxID_HIGHEST + 1016,
ID_Forums = wxID_HIGHEST + 1017,
ID_DmodTitleList = wxID_HIGHEST + 1027,
ID_Play = wxID_HIGHEST + 1028,
ID_Truecolor = wxID_HIGHEST + 1029,
ID_Windowed = wxID_HIGHEST + 1030,
ID_Sound = wxID_HIGHEST + 1031,
ID_Joystick = wxID_HIGHEST + 1032,
ID_Debug = wxID_HIGHEST + 1033,
ID_V107 = wxID_HIGHEST + 1034,
ID_Edit = wxID_HIGHEST + 1035,
ID_Package = wxID_HIGHEST + 1036
};
// end wxGlade
DFArcFrame_Base(wxWindow* parent, int id, const wxString& title, const wxPoint& pos=wxDefaultPosition, const wxSize& size=wxDefaultSize, long style=wxDEFAULT_FRAME_STYLE);
private:
// begin wxGlade: DFArcFrame_Base::methods
void set_properties();
void do_layout();
// end wxGlade
protected:
// begin wxGlade: DFArcFrame_Base::attributes
wxMenuBar* lMenuBar;
wxStatusBar* mStatusBar;
wxListBox* mDModListBox;
wxButton* mPlayButton;
wxCheckBox* mTrueColor;
wxCheckBox* mWindowed;
wxCheckBox* mSound;
wxCheckBox* mJoystick;
wxCheckBox* mDebug;
wxCheckBox* mV107;
wxButton* mEditButton;
wxButton* mPackageButton;
wxPanel* mAnimationPanel;
wxChoice* mGameLocaleList;
wxPanel* panel_1;
wxTextCtrl* mDmodDescription;
wxSplitterWindow* mSplitter;
// end wxGlade
}; // wxGlade: end class
#endif // DFARCFRAME_BASE_H
dfarc-3.12/src/DFArcApp.cpp 0000664 0001750 0001751 00000007353 12417764707 012344 0000000 0000000 /**
* DFArc startup - wxWidgets application object
* Copyright (C) 2005, 2006 Dan Walma
* Copyright (C) 2008 Sylvain Beucler
* This file is part of GNU FreeDink
* GNU FreeDink 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.
* GNU FreeDink 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
* .
*/
#ifdef HAVE_CONFIG_H
#include
#endif
#include "Config.hpp"
#include "DFArcFrame.hpp"
#include "InstallVerifyFrame.hpp"
#include
class DFArcApp : public wxApp
{
bool OnInit();
int OnExit();
private:
// wxLocale object must live during all the program execution, or
// translation will stop - so let's define it as an app member
wxLocale app_locale;
};
DECLARE_APP(DFArcApp)
bool DFArcApp::OnInit(void)
{
// Init i18n or internationalization
// Under GNU/Linux, wx looks in standard /usr/share/locale/...
// Under woe, wx looks in ./fr/dfarc.mo. Add ./po/fr/dfarc.mo:
wxLocale::AddCatalogLookupPathPrefix(_T("po"));
// Init locale, possibly overriding the system language
Config *mConfig = Config::GetConfig(); // singleton
const wxLanguageInfo* li = wxLocale::FindLanguageInfo(mConfig->mForceLocale);
if (mConfig->mForceLocale == wxT("C"))
; // do not initialize i18n
else if (mConfig->mForceLocale != wxEmptyString && li != NULL)
app_locale.Init(li->Language);
else
app_locale.Init();
app_locale.AddCatalog(wxT("dfarc"));
int cont = true;
if (argc == 2)
{
wxString arg = argv[1];
if (arg.Cmp(_T("--help")) == 0)
{
wxString progname = argv[0];
printf("Usage: %s [OPTIONS]... [file.dmod]\n", (const char*)progname.fn_str());
printf("\n");
printf("-h, --help Display this help screen\n");
printf("-v, --version Display the version\n");
printf("\n");
printf("If file.dmod is given, the DMod installation wizard will start.\n");
printf("\n");
/* printf ("Type 'info freedink' for more information\n"); */
printf("Report bugs to %s.\n", PACKAGE_BUGREPORT);
exit(EXIT_SUCCESS); // don't 'return false', otherwise wxWidgets exit(255)
}
else if (arg.Cmp(_T("--version")) == 0)
{
printf ("%s %s\n", PACKAGE_NAME, VERSION);
printf ("Copyright (C) 2006, 2007, 2008 by contributors\n");
printf ("License GPLv3+: GNU GPL version 3 or later \n");
printf ("This is free software: you are free to change and redistribute it.\n");
printf ("There is NO WARRANTY, to the extent permitted by law.\n");
exit(EXIT_SUCCESS); // don't 'return false', otherwise wxWidgets exit(255)
}
else
{
wxString lDmodFilePath = arg;
InstallVerifyFrame lTemp(lDmodFilePath);
cont = (lTemp.ShowModal() == wxID_OK);
}
}
if (cont)
{
// Normal startup, or successful installation
DFArcFrame* lDFArcMainForm = new DFArcFrame();
lDFArcMainForm->Show();
return true;
}
// Failed installation, not going to main screen, just quitting
return false;
}
int DFArcApp::OnExit()
{
// Singletons don't delete themselves automatically. Moreover, a
// static SingletonDestroyer solution would happen after wxWindows
// clean-up and crash. So we're deleting it here.
delete Config::GetConfig(); // saves wxConfig on disk
return wxApp::OnExit();
}
IMPLEMENT_APP(DFArcApp)
dfarc-3.12/src/IOUtils.hpp 0000664 0001750 0001751 00000002253 12340110733 012266 0000000 0000000 /**
* Files utilities
* Copyright (C) 2004 Andrew Reading
* Copyright (C) 2005, 2006 Dan Walma
* Copyright (C) 2008 Sylvain Beucler
* This file is part of GNU FreeDink
* GNU FreeDink 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.
* GNU FreeDink 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
* .
*/
#ifndef _IOUTILS_HPP
#define _IOUTILS_HPP
#include
#include
#include
class IOUtils
{
public:
static void ciconvert(wxString& strPath);
static wxString GetParentDir(wxString full_path);
static void GetAllDModFiles(wxString strPath, wxArrayString &wxasFileList);
private:
//void FixSlashes(wxString &Path);
};
#endif
dfarc-3.12/src/InstallVerifyFrame.cpp 0000664 0001750 0001751 00000010443 12417450330 014504 0000000 0000000 /**
* D-Mod installation wizard
* Copyright (C) 2004 Andrew Reading
* Copyright (C) 2005, 2006 Dan Walma
* Copyright (C) 2008 Sylvain Beucler
* This file is part of GNU FreeDink
* GNU FreeDink 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.
* GNU FreeDink 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
* .
*/
#include
#include
#include
#include "InstallVerifyFrame.hpp"
#include "Config.hpp"
#include "BZip.hpp"
#include "Tar.hpp"
BEGIN_EVENT_TABLE(InstallVerifyFrame, wxDialog)
EVT_BUTTON(wxID_OK, InstallVerifyFrame::onInstall)
EVT_BUTTON(wxID_CANCEL, InstallVerifyFrame::onCancel)
END_EVENT_TABLE()
InstallVerifyFrame::InstallVerifyFrame(const wxString& lDmodFilePath)
: InstallVerifyFrame_Base(NULL, wxID_ANY, _T(""))
{
mConfig = Config::GetConfig();
prepareDialog();
int flags = wxPD_AUTO_HIDE | wxPD_APP_MODAL | wxPD_REMAINING_TIME;
wxProgressDialog lPrepareProgress(_("Preparing"),
_("The D-Mod archive is being decompressed in a temporary file."), 100, this, flags);
// Extract
BZip lBZip(lDmodFilePath);
mTarFilePath = lBZip.Extract(&lPrepareProgress);
if (mTarFilePath.Len() != 0)
{
// Prepare the tar file for reading
Tar lTar(mTarFilePath);
lTar.ReadHeaders();
// Get and display the dmod description
wxString lDmodDescription = lTar.getmDmodDescription();
if ( lDmodDescription.Len() == 0 )
{
lDmodDescription = wxString::Format(_("No Description Available.\n"
"\n"
"The D-Mod will be installed in subdirectory '%s'."),
lTar.getInstalledDmodDirectory().c_str());
}
else
{
int lBreakChar = lDmodDescription.Find( '\r' );
if ( lBreakChar <= 0 )
{
lBreakChar = lDmodDescription.Find( '\n' );
}
mDmodName = lDmodDescription.SubString( 0, lBreakChar - 1 );
this->SetTitle(_("DFArc - Install D-Mod - ") + mDmodName);
}
mDmodDescription->SetValue(lDmodDescription);
// Re-enable the install button
mInstallButton->Enable(true);
}
}
InstallVerifyFrame::~InstallVerifyFrame()
{
if (mTarFilePath.Len() != 0)
::wxRemoveFile(mTarFilePath);
}
void InstallVerifyFrame::prepareDialog(void)
{
if (mConfig->mDModDir.IsEmpty())
// force install in Dink dir
mDestdirBox->Disable();
else
// default install in D-Mods dir
mDestdirBox->SetSelection(1);
// Disable installation button until the tar is properly decompressed
mInstallButton->Enable(false);
this->SetMinSize(this->GetBestSize());
this->SetSize(this->GetMinSize());
}
void InstallVerifyFrame::onCancel(wxCommandEvent &Event)
{
this->EndModal(wxID_CANCEL);
}
void InstallVerifyFrame::onInstall(wxCommandEvent &Event)
{
int flags = wxPD_AUTO_HIDE | wxPD_APP_MODAL | wxPD_REMAINING_TIME;
wxProgressDialog lInstallProgress(_("DFArc - Installing"), _T(""),
100, this, flags);
// Install in the main dink dir, or in the specified DMod dir if any
wxString destdir = mConfig->GetDinkrefDir();
if (mDestdirBox->GetSelection() == 1)
destdir = mConfig->mDModDir;
Tar lTar(mTarFilePath);
lTar.ReadHeaders();
int lError = lTar.Extract(destdir, &lInstallProgress);
if (lError == 0)
{
if (mDmodName.Len() <= 0)
{
mDmodName = _("The D-Mod you selected");
}
::wxMessageBox(mDmodName + _(" was successfully installed."),
_("Success"), wxOK | wxICON_INFORMATION, this);
// Preselect this new D-Mod
wxString dmod_dir = lTar.getInstalledDmodDirectory();
if (dmod_dir.Last() == _T('/'))
dmod_dir = dmod_dir.RemoveLast();
mConfig->mSelectedDmod = destdir + wxFileName::GetPathSeparator() + dmod_dir;
this->EndModal(wxID_OK);
}
else
{
wxLogError(_("An error occured while extracting the .dmod file."));
}
}
dfarc-3.12/src/Options_Base.wxg 0000664 0001750 0001751 00000027473 12400631674 013365 0000000 0000000
DFArc - OptionswxVERTICALwxLEFT|wxRIGHT|wxTOP10wxLEFT|wxRIGHT|wxTOP10wxLEFT|wxRIGHT|wxTOP10wxLEFT|wxRIGHT|wxTOP|wxEXPAND10wxHORIZONTAL0wxLEFT10wxLEFT10ID_OVERRIDE_DINKREFDIR_BROWSE=?wxLEFT|wxRIGHT|wxTOP|wxEXPAND10wxHORIZONTAL01wxLEFT10wxLEFT10ID_DMODDIR_BROWSE=?wxLEFT|wxRIGHT|wxTOP|wxEXPAND10wxHORIZONTAL101wxLEFT10-1wxLEFT|wxRIGHT|wxTOP|wxEXPAND10wxHORIZONTAL101wxLEFT10-1wxLEFT|wxRIGHT|wxTOP|wxEXPAND10wxHORIZONTALwxLEFT01wxLEFT10wxLEFT|wxRIGHT|wxTOP|wxEXPAND10wxHORIZONTAL101wxLEFT|wxEXPAND10wxVERTICALwxEXPAND00ID_LANGUAGE_LIST=?wxEXPAND0wxALL|wxALIGN_BOTTOM10wxHORIZONTALwxALIGN_BOTTOM0OK1wxLEFT|wxALIGN_BOTTOM10CANCEL
dfarc-3.12/src/Makefile.in 0000664 0001750 0001751 00000060622 12417764236 012320 0000000 0000000 # Makefile.in generated by automake 1.14.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2013 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
VPATH = @srcdir@
am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
bin_PROGRAMS = dfarc$(EXEEXT)
subdir = src
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
$(srcdir)/woeres.rc.in $(top_srcdir)/autotools/depcomp
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
$(top_srcdir)/m4/progtest.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES = woeres.rc
CONFIG_CLEAN_VPATH_FILES =
am__installdirs = "$(DESTDIR)$(bindir)"
PROGRAMS = $(bin_PROGRAMS)
am_dfarc_OBJECTS = BZip.$(OBJEXT) Config.$(OBJEXT) DFArcApp.$(OBJEXT) \
DFArcFrame.$(OBJEXT) DFile.$(OBJEXT) DMod.$(OBJEXT) \
icon_xpm.$(OBJEXT) IOUtils.$(OBJEXT) \
InstallVerifyFrame.$(OBJEXT) Options.$(OBJEXT) \
Package.$(OBJEXT) RecursiveDelete.$(OBJEXT) Tar.$(OBJEXT) \
DFArcFrame_Base.$(OBJEXT) Options_Base.$(OBJEXT) \
Package_Base.$(OBJEXT) InstallVerifyFrame_Base.$(OBJEXT)
@HAVE_WINDRES_TRUE@nodist_dfarc_OBJECTS = woeres.$(OBJEXT)
dfarc_OBJECTS = $(am_dfarc_OBJECTS) $(nodist_dfarc_OBJECTS)
dfarc_LDADD = $(LDADD)
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/autotools/depcomp
am__depfiles_maybe = depfiles
am__mv = mv -f
CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
AM_V_CXX = $(am__v_CXX_@AM_V@)
am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@)
am__v_CXX_0 = @echo " CXX " $@;
am__v_CXX_1 =
CXXLD = $(CXX)
CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
-o $@
AM_V_CXXLD = $(am__v_CXXLD_@AM_V@)
am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@)
am__v_CXXLD_0 = @echo " CXXLD " $@;
am__v_CXXLD_1 =
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
AM_V_CC = $(am__v_CC_@AM_V@)
am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
am__v_CC_0 = @echo " CC " $@;
am__v_CC_1 =
CCLD = $(CC)
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
AM_V_CCLD = $(am__v_CCLD_@AM_V@)
am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
am__v_CCLD_0 = @echo " CCLD " $@;
am__v_CCLD_1 =
SOURCES = $(dfarc_SOURCES) $(nodist_dfarc_SOURCES)
DIST_SOURCES = $(dfarc_SOURCES)
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is
# *not* preserved.
am__uniquify_input = $(AWK) '\
BEGIN { nonempty = 0; } \
{ items[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in items) print i; }; } \
'
# Make sure the list of sources is unique. This is necessary because,
# e.g., the same source file might be shared among _SOURCES variables
# for different programs/libraries.
am__define_uniq_tagged_files = \
list='$(am__tagged_files)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
ALL_LINGUAS = @ALL_LINGUAS@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DATADIRNAME = @DATADIRNAME@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
GMSGFMT = @GMSGFMT@
GMSGFMT_015 = @GMSGFMT_015@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@
INTLTOOL_MERGE = @INTLTOOL_MERGE@
INTLTOOL_PERL = @INTLTOOL_PERL@
INTLTOOL_UPDATE = @INTLTOOL_UPDATE@
INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@
INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@
INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@
INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
MSGFMT = @MSGFMT@
MSGFMT_015 = @MSGFMT_015@
MSGMERGE = @MSGMERGE@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
UPX = @UPX@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
WINDRES = @WINDRES@
WXGLADE = @WXGLADE@
WX_CFLAGS = @WX_CFLAGS@
WX_CFLAGS_ONLY = @WX_CFLAGS_ONLY@
WX_CONFIG_PATH = @WX_CONFIG_PATH@
WX_CPPFLAGS = @WX_CPPFLAGS@
WX_CXXFLAGS = @WX_CXXFLAGS@
WX_CXXFLAGS_ONLY = @WX_CXXFLAGS_ONLY@
WX_LIBS = @WX_LIBS@
WX_LIBS_STATIC = @WX_LIBS_STATIC@
WX_RESCOMP = @WX_RESCOMP@
WX_VERSION = @WX_VERSION@
WX_VERSION_MAJOR = @WX_VERSION_MAJOR@
WX_VERSION_MICRO = @WX_VERSION_MICRO@
WX_VERSION_MINOR = @WX_VERSION_MINOR@
XDG_DESKTOP_MENU = @XDG_DESKTOP_MENU@
XDG_ICON_RESOURCE = @XDG_ICON_RESOURCE@
XDG_MIME = @XDG_MIME@
XGETTEXT = @XGETTEXT@
XGETTEXT_015 = @XGETTEXT_015@
XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
intltool__v_merge_options_ = @intltool__v_merge_options_@
intltool__v_merge_options_0 = @intltool__v_merge_options_0@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
# Help DFArc look for either 'dink' or 'dink.exe':
# Cf. (autoconf.info)Installation Directory Variables:
# Don't use DATADIR, it conflicts with something in MinGW
# work-around for wxglade < 2.6.9
# disable obnoxious wxWidgets3 assertions
AM_CPPFLAGS = -DEXEEXT=\"$(EXEEXT)\" -DDEFAULT_DATA_DIR=\"$(datadir)\" \
-DwxTHICK_FRAME=wxRESIZE_BORDER -DNDEBUG
dfarc_SOURCES = BZip.cpp BZip.hpp ClientData.hpp Config.cpp Config.hpp \
DFArcApp.cpp DFArcFrame.cpp DFArcFrame.hpp DFile.cpp DFile.hpp \
DMod.cpp DMod.hpp icon_xpm.cpp icon_xpm.hpp IOUtils.cpp \
IOUtils.hpp InstallVerifyFrame.cpp InstallVerifyFrame.hpp \
Options.cpp Options.hpp Package.cpp Package.hpp \
RecursiveDelete.cpp RecursiveDelete.hpp Tar.cpp Tar.hpp \
DFArcFrame_Base.cpp DFArcFrame_Base.h Options_Base.cpp \
Options_Base.h Package_Base.cpp Package_Base.h \
InstallVerifyFrame_Base.cpp InstallVerifyFrame_Base.h
# DFArcFrame_Base.cpp/h will be automatically generated before the
# rest of the source code. In addition, they will be included in
# tarballs, so people won't need wxglade to compile DFArc :)
# Using $(srcdir) so that the .po build system will find them
BUILT_SOURCES = $(srcdir)/DFArcFrame_Base.cpp \
$(srcdir)/DFArcFrame_Base.h $(srcdir)/Options_Base.cpp \
$(srcdir)/Options_Base.h $(srcdir)/Package_Base.cpp $(srcdir)/Package_Base.h \
$(srcdir)/InstallVerifyFrame_Base.cpp $(srcdir)/InstallVerifyFrame_Base.h
CLEANFILES = $(BUILT_SOURCES)
EXTRA_DIST = DFArcFrame_Base.wxg Options_Base.wxg Package_Base.wxg \
InstallVerifyFrame_Base.wxg dink.ico
# How do we handle resources embedded in the executable binary?
@HAVE_WINDRES_TRUE@nodist_dfarc_SOURCES = woeres.rc
all: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) all-am
.SUFFIXES:
.SUFFIXES: .cpp .o .obj .rc .wxg
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnits src/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnits src/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
woeres.rc: $(top_builddir)/config.status $(srcdir)/woeres.rc.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
install-binPROGRAMS: $(bin_PROGRAMS)
@$(NORMAL_INSTALL)
@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
$(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
fi; \
for p in $$list; do echo "$$p $$p"; done | \
sed 's/$(EXEEXT)$$//' | \
while read p p1; do if test -f $$p \
; then echo "$$p"; echo "$$p"; else :; fi; \
done | \
sed -e 'p;s,.*/,,;n;h' \
-e 's|.*|.|' \
-e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
sed 'N;N;N;s,\n, ,g' | \
$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
{ d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
if ($$2 == $$4) files[d] = files[d] " " $$1; \
else { print "f", $$3 "/" $$4, $$1; } } \
END { for (d in files) print "f", d, files[d] }' | \
while read type dir files; do \
if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
test -z "$$files" || { \
echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
$(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
} \
; done
uninstall-binPROGRAMS:
@$(NORMAL_UNINSTALL)
@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
files=`for p in $$list; do echo "$$p"; done | \
sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
-e 's/$$/$(EXEEXT)/' \
`; \
test -n "$$list" || exit 0; \
echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
cd "$(DESTDIR)$(bindir)" && rm -f $$files
clean-binPROGRAMS:
-test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
installcheck-binPROGRAMS: $(bin_PROGRAMS)
bad=0; pid=$$$$; list="$(bin_PROGRAMS)"; for p in $$list; do \
case ' $(AM_INSTALLCHECK_STD_OPTIONS_EXEMPT) ' in \
*" $$p "* | *" $(srcdir)/$$p "*) continue;; \
esac; \
f=`echo "$$p" | \
sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
for opt in --help --version; do \
if "$(DESTDIR)$(bindir)/$$f" $$opt >c$${pid}_.out \
2>c$${pid}_.err &2; bad=1; fi; \
done; \
done; rm -f c$${pid}_.???; exit $$bad
dfarc$(EXEEXT): $(dfarc_OBJECTS) $(dfarc_DEPENDENCIES) $(EXTRA_dfarc_DEPENDENCIES)
@rm -f dfarc$(EXEEXT)
$(AM_V_CXXLD)$(CXXLINK) $(dfarc_OBJECTS) $(dfarc_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/BZip.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Config.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DFArcApp.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DFArcFrame.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DFArcFrame_Base.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DFile.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DMod.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/IOUtils.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/InstallVerifyFrame.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/InstallVerifyFrame_Base.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Options.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Options_Base.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Package.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Package_Base.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/RecursiveDelete.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Tar.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/icon_xpm.Po@am__quote@
.cpp.o:
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $<
.cpp.obj:
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
ID: $(am__tagged_files)
$(am__define_uniq_tagged_files); mkid -fID $$unique
tags: tags-am
TAGS: tags
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
set x; \
here=`pwd`; \
$(am__define_uniq_tagged_files); \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: ctags-am
CTAGS: ctags
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
$(am__define_uniq_tagged_files); \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
cscopelist: cscopelist-am
cscopelist-am: $(am__tagged_files)
list='$(am__tagged_files)'; \
case "$(srcdir)" in \
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
*) sdir=$(subdir)/$(srcdir) ;; \
esac; \
for i in $$list; do \
if test -f "$$i"; then \
echo "$(subdir)/$$i"; \
else \
echo "$$sdir/$$i"; \
fi; \
done >> $(top_builddir)/cscope.files
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
check-am: all-am
check: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) check-am
all-am: Makefile $(PROGRAMS)
installdirs:
for dir in "$(DESTDIR)$(bindir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
clean: clean-am
clean-am: clean-binPROGRAMS clean-generic mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am:
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am: install-binPROGRAMS
@$(NORMAL_INSTALL)
$(MAKE) $(AM_MAKEFLAGS) install-exec-hook
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man:
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am: installcheck-binPROGRAMS
maintainer-clean: maintainer-clean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-binPROGRAMS
@$(NORMAL_INSTALL)
$(MAKE) $(AM_MAKEFLAGS) uninstall-hook
.MAKE: all check install install-am install-exec-am install-strip \
uninstall-am
.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
clean-binPROGRAMS clean-generic cscopelist-am ctags ctags-am \
distclean distclean-compile distclean-generic distclean-tags \
distdir dvi dvi-am html html-am info info-am install \
install-am install-binPROGRAMS install-data install-data-am \
install-dvi install-dvi-am install-exec install-exec-am \
install-exec-hook install-html install-html-am install-info \
install-info-am install-man install-pdf install-pdf-am \
install-ps install-ps-am install-strip installcheck \
installcheck-am installcheck-binPROGRAMS installdirs \
maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \
tags tags-am uninstall uninstall-am uninstall-binPROGRAMS \
uninstall-hook
# wxGlade (GUI builder) code generation
@HAVE_WXGLADE_TRUE@.wxg.cpp:
@HAVE_WXGLADE_TRUE@ $(AM_V_GEN)
@HAVE_WXGLADE_TRUE@ $(AM_V_at) $(WXGLADE) -g C++ -o $@ $<
@HAVE_WXGLADE_FALSE@.wxg.cpp:
@HAVE_WXGLADE_FALSE@ @echo
@HAVE_WXGLADE_FALSE@ @echo " Please install 'wxglade' to rebuild the '.wxg' GUI files"
@HAVE_WXGLADE_FALSE@ @echo " (and then run ./config.status --recheck)"
@HAVE_WXGLADE_FALSE@ @echo
@HAVE_WXGLADE_FALSE@ exit 1
# Woe icon and app infos
# Also check http://fragglet.livejournal.com/4448.html
.rc.o:
$(WINDRES) -i $< -o $@
install-exec-hook:
# UPX compression
# Needs to be done before bundling resources
# Not using --best because it takes much more time and the result is
# only a little bit smaller
@HAVE_UPX_TRUE@ -$(UPX) "$(DESTDIR)$(bindir)/dfarc$(EXEEXT)"
# Add 'freedink-dfarc' alias so that command-line FreeDink users see
# the front-end more easily (via tab completion)
$(LN_S) -f "dfarc$(EXEEXT)" "$(DESTDIR)$(bindir)/freedink-dfarc$(EXEEXT)"
uninstall-hook:
rm -f "$(DESTDIR)$(bindir)/freedink-dfarc$(EXEEXT)"
# For reference, wxGlade (GUI builder) alternate 2-steps code
# generation:
#.wxg.xrc:
# $(WXGLADE) -g XRC -o $@ $<
#.xrc.cpp:
# $(WXRC) -c -e -o $@ -n Init$* $<
# sed -i -e 's/$*:://g' $*.h
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
dfarc-3.12/src/Tar.hpp 0000664 0001750 0001751 00000005520 12400673367 011502 0000000 0000000 /**
* Tar file creation and extraction, with progress bar support
* Copyright (C) 2004 Andrew Reading
* Copyright (C) 2005, 2006 Dan Walma
* Copyright (C) 2008 Sylvain Beucler
* This file is part of GNU FreeDink
* GNU FreeDink 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.
* GNU FreeDink 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
* .
*/
#ifndef _TAR_HPP
#define _TAR_HPP
#include
#include
#include
#include "DFile.hpp"
struct fileinfo;
class TarHeader
{
public:
char Name[100]; // 100
char Mode[8]; // 108
char Uid[8]; // 116
char Gid[8]; // 124
char Size[12]; // 136
char Mtime[12]; // 148
char Chksum[8]; // 156
char Linkflag; // 157
char Linkname[100]; // 257
char Magic[8]; // 265
char Uname[32]; // 297
char Gname[32]; // 329
char Devmajor[8]; // 337
char Devminor[8]; // 345
char Padding[167]; // 512
};
class TarRecord
{
public:
char Name[100];
int iFilePosBegin;
int iFileSize;
};
class Tar : public DFile
{
public:
Tar(wxString &szFile, wxString &szCompressDir);
Tar(wxString &szFile);
bool Create(const wxString& aFolderName, double *compression_ratio, wxProgressDialog* aProgressDialog);
int Extract(wxString destdir, wxProgressDialog* aProgressDialog);
// tarmisc.cpp:
int ReadHeaders( void );
wxArrayString mPathList;
wxString getInstalledDmodDirectory();
wxString getmDmodDescription();
private:
bool FillHeader(wxString &strFile, const wxString& lDestinationFile, char* header512, fileinfo* finfo);
void DecToOct(int n, char *sz, int iMaxSize);
const char* OctToDec(int n);
const char* ToString(int n);
int RoundTo512(int n);
bool PadWithZeros(char *s, int iszSize, int iAcheiveSize);
bool VerifyChecksum(TarHeader *Header);
bool CreateReal(const wxString& aFolderName, double *compression_ratio, wxProgressDialog* aProgressDialog);
int ExtractData(std::istream &f_In, wxString destdir, wxProgressDialog* aProgressDialog);
// True if the proper constructor was used. The compression method
// will not screw up if this flag is set to true.
bool bCanCompress;
// The directory to compress.
wxString strCompressDir;
std::vector TarRecords;
wxString mInstalledDmodDirectory;
wxString mmDmodDescription;
};
#endif
dfarc-3.12/src/InstallVerifyFrame_Base.wxg 0000664 0001750 0001751 00000006170 12400704067 015464 0000000 0000000
DFArc - Install D-ModwxVERTICALwxLEFT|wxRIGHT|wxTOP|wxEXPAND5Preparing...390,150wxEXPAND000Main Dink directoryAdditional D-Mods directorywxALL|wxEXPAND5wxHORIZONTAL01wxID_OK1wxLEFT5CANCELwxID_CANCEL
dfarc-3.12/src/IOUtils.cpp 0000664 0001750 0001751 00000006512 12340110733 012263 0000000 0000000 /**
* Files utilities
* Copyright (C) 2008 Sylvain Beucler
* This file is part of GNU FreeDink
* GNU FreeDink 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.
* GNU FreeDink 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
* .
*/
#include "IOUtils.hpp"
#include
#include
/**
* Convert a case-insensitive filename to case-sensitive
*/
void IOUtils::ciconvert(wxString& path)
{
// Nothing to simulate if the filesystem is already case-insensitive
if (!wxFileName::IsCaseSensitive())
return;
wxString path_tmp_copy(path);
path_tmp_copy.Append(wxT("/")); // simulate a directory for GetDirs()
wxFileName filename(path_tmp_copy);
wxArrayString path_elements = filename.GetDirs(); // split path
wxString curpath;
if (path.StartsWith(wxT("/")))
curpath = wxT("/");
else
curpath = wxT("./");
for (int i = 0; i < path_elements.Count(); i++)
{
wxDir cur_dir(curpath);
wxString found = wxEmptyString;
wxString filename;
bool cont = cur_dir.GetFirst(&filename);
while (cont)
{
if (path_elements.Item(i).IsSameAs(filename, false)) // case-insensitive
{
found = filename;
break;
}
cont = cur_dir.GetNext(&filename);
}
if (found.IsEmpty())
// can't find current element, non-existent path
return;
curpath = curpath + wxT("/") + found;
}
path = curpath;
}
wxString IOUtils::GetParentDir(wxString path)
{
wxString result;
path.Append(wxT("/")); // simulate a directory for RemoveLastDir()
wxFileName filename(path);
filename.RemoveLastDir();
return filename.GetPath();
}
/* ------------------- */
/* --- GetAllFiles --- */
/* ------------------- */
class wxDirTraverserDMod : public wxDirTraverser
{
public:
wxDirTraverserDMod(wxString& strPath, wxArrayString& files)
: m_files(files),
m_strPath(strPath)
{}
virtual wxDirTraverseResult OnFile(const wxString& filename)
{
// Filter out savegames, as well as cache and backup files
wxString cmp = wxFileName::FileName(filename).GetFullName().Lower();
if (!cmp.Matches(_T("save*.dat"))
&& !cmp.Matches(_T("thumbs.db"))
&& !cmp.Matches(_T("*~"))
&& !cmp.Matches(_T("debug.txt")))
{
wxFileName wxfn(filename);
wxfn.MakeRelativeTo(m_strPath);
m_files.Add(wxfn.GetFullPath(wxPATH_UNIX));
}
return wxDIR_CONTINUE;
}
virtual wxDirTraverseResult OnDir(const wxString& WXUNUSED(dirname))
{
return wxDIR_CONTINUE;
}
private:
wxArrayString& m_files;
wxString m_strPath;
};
/**
* Get a list filenames in a DMod (relative), excluding common
* temporary files and savegames.
*/
void IOUtils::GetAllDModFiles(wxString strPath, wxArrayString &wxasFileList)
{
// get the names of all files in the array
wxDirTraverserDMod traverser(strPath, wxasFileList);
wxDir dir(strPath);
dir.Traverse(traverser);
}
dfarc-3.12/src/RecursiveDelete.hpp 0000664 0001750 0001751 00000002301 12340110733 014022 0000000 0000000 /**
* File utilities to uninstall a D-Mod
* Copyright (C) 2005, 2006 Dan Walma
* Copyright (C) 2008 Sylvain Beucler
* This file is part of GNU FreeDink
* GNU FreeDink 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.
* GNU FreeDink 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
* .
*/
#ifndef _RECURSIVEDELETE_HPP
#define _RECURSIVEDELETE_HPP
#include
class RecursiveDelete : public wxDirTraverser
{
public:
RecursiveDelete(bool aRemoveSaveGames);
virtual wxDirTraverseResult OnFile(const wxString& aFilename);
virtual wxDirTraverseResult OnDir(const wxString& aDirname);
bool getError( void );
protected:
private:
bool mRemoveSaveGames;
bool mError;
};
#endif
dfarc-3.12/src/InstallVerifyFrame_Base.h 0000755 0001750 0001751 00000002645 12420022016 015077 0000000 0000000 // -*- C++ -*-
//
// generated by wxGlade b221e052e911 on Thu Oct 16 22:01:18 2014
//
// Example for compiling a single file project under Linux using g++:
// g++ MyApp.cpp $(wx-config --libs) $(wx-config --cxxflags) -o MyApp
//
// Example for compiling a multi file project under Linux using g++:
// g++ main.cpp $(wx-config --libs) $(wx-config --cxxflags) -o MyApp Dialog1.cpp Frame1.cpp
//
#ifndef INSTALLVERIFYFRAME_BASE_H
#define INSTALLVERIFYFRAME_BASE_H
#include
#include
#include "wx/intl.h"
#ifndef APP_CATALOG
#define APP_CATALOG "app" // replace with the appropriate catalog name
#endif
// begin wxGlade: ::dependencies
// end wxGlade
// begin wxGlade: ::extracode
// end wxGlade
class InstallVerifyFrame_Base: public wxDialog {
public:
// begin wxGlade: InstallVerifyFrame_Base::ids
// end wxGlade
InstallVerifyFrame_Base(wxWindow* parent, int id, const wxString& title, const wxPoint& pos=wxDefaultPosition, const wxSize& size=wxDefaultSize, long style=wxDEFAULT_DIALOG_STYLE);
private:
// begin wxGlade: InstallVerifyFrame_Base::methods
void set_properties();
void do_layout();
// end wxGlade
protected:
// begin wxGlade: InstallVerifyFrame_Base::attributes
wxTextCtrl* mDmodDescription;
wxRadioBox* mDestdirBox;
wxButton* mInstallButton;
wxButton* mCancelButton;
// end wxGlade
}; // wxGlade: end class
#endif // INSTALLVERIFYFRAME_BASE_H
dfarc-3.12/src/Package.hpp 0000664 0001750 0001751 00000002417 12340110733 012273 0000000 0000000 /**
* D-Mod packaging wizard
* Copyright (C) 2004 Andrew Reading
* Copyright (C) 2005, 2006 Dan Walma
* Copyright (C) 2008 Sylvain Beucler
* This file is part of GNU FreeDink
* GNU FreeDink 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.
* GNU FreeDink 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
* .
*/
#ifndef PACKAGE_HPP
#define PACKAGE_HPP
#include "Package_Base.h"
#include "DMod.hpp"
#include
class DFilesystem;
class Package : public Package_Base
{
public:
Package(DMod aDMod);
protected:
private:
void prepareDialog();
void onOkay(wxCommandEvent& aEvent);
void onCancel(wxCommandEvent& aEvent);
void onQuit(wxCloseEvent& aEvent);
void onBrowse(wxCommandEvent& aEvent);
DMod mDMod;
DECLARE_EVENT_TABLE()
};
#endif
dfarc-3.12/src/woeres.rc.in 0000664 0001750 0001751 00000001146 12340110733 012464 0000000 0000000 #include
#define IDI_ICON1 120
IDI_ICON1 ICON DISCARDABLE "@srcdir@/dink.ico"
1 VERSIONINFO
FILEVERSION 1,0,8,0
PRODUCTVERSION 1,0,8,0
FILETYPE VFT_APP
{
BLOCK "StringFileInfo"
{
BLOCK "040904E4"
{
VALUE "CompanyName", ""
VALUE "FileVersion", ""
VALUE "FileDescription", "@PACKAGE_STRING@"
VALUE "InternalName", "@PACKAGE@"
VALUE "LegalCopyright", "Collective"
VALUE "LegalTrademarks", ""
VALUE "OriginalFilename", ""
VALUE "ProductName", "@PACKAGE_NAME@"
VALUE "ProductVersion", "@PACKAGE_VERSION@"
}
}
}
dfarc-3.12/src/BZip.cpp 0000664 0001750 0001751 00000027310 12417562341 011611 0000000 0000000 /**
* BZip2 file creator and extractor, with progress bar support
* Copyright (C) 2004 Andrew Reading
* Copyright (C) 2005, 2006 Dan Walma
* Copyright (C) 2007, 2008, 2014 Sylvain Beucler
* This file is part of GNU FreeDink
* GNU FreeDink 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.
* GNU FreeDink 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
* .
*/
#ifdef HAVE_CONFIG_H
#include
#endif
#include "BZip.hpp"
#include
#include
#include
#include
#include
#if defined _WIN32 || defined __WIN32__ || defined __CYGWIN__
#define fopen(file, mode) _wfopen(file, _T(mode))
#endif
BZip::BZip(const wxString &szFile) : DFile(szFile)
{
}
// Modified version of bzip2-1.0.6/bzlib.c and bzip2.c where we can
// get how many compressed data (not uncompressed data) was read. This
// is, of course, only the high-level API, we still rely on an
// external libbz2 for the actual decompression.
/* ------------------------------------------------------------------
This file is part of bzip2/libbzip2, a program and library for
lossless, block-sorting data compression.
bzip2/libbzip2 version 1.0.6 of 6 September 2010
Copyright (C) 1996-2010 Julian Seward
Copyright (C) 2008, 2014 Sylvain Beucler
Please read the WARNING, DISCLAIMER and PATENTS sections in the
README file.
--------------------------------------------------------------------------
This program, "bzip2", the associated library "libbzip2", and all
documentation, are copyright (C) 1996-2010 Julian R Seward. All
rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product
documentation would be appreciated but is not required.
3. Altered source versions must be plainly marked as such, and must
not be misrepresented as being the original software.
4. The name of the author may not be used to endorse or promote
products derived from this software without specific prior written
permission.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Julian Seward, jseward@bzip.org
bzip2/libbzip2 version 1.0.6 of 6 September 2010
-------------------------------------------------------------------------- */
typedef char Char;
typedef unsigned char Bool;
typedef unsigned char UChar;
typedef int Int32;
typedef unsigned int UInt32;
typedef short Int16;
typedef unsigned short UInt16;
#define True ((Bool)1)
#define False ((Bool)0)
#define BZ_SETERR(eee) \
{ \
if (bzerror != NULL) *bzerror = eee; \
if (bzf != NULL) bzf->lastErr = eee; \
}
typedef
struct {
FILE* handle;
Char buf[BZ_MAX_UNUSED];
Int32 bufN;
Bool writing;
bz_stream strm;
Int32 lastErr;
Bool initialisedOk;
}
bzFile;
/*---------------------------------------------*/
static Bool myfeof ( FILE* f )
{
Int32 c = fgetc ( f );
if (c == EOF) return True;
ungetc ( c, f );
return False;
}
/*---------------------------------------------------*/
BZFILE* BZip::bzReadOpen
( int* bzerror,
FILE* f,
int verbosity,
int small,
void* unused,
int nUnused )
{
bzFile* bzf = NULL;
int ret;
BZ_SETERR(BZ_OK);
if (f == NULL ||
(small != 0 && small != 1) ||
(verbosity < 0 || verbosity > 4) ||
(unused == NULL && nUnused != 0) ||
(unused != NULL && (nUnused < 0 || nUnused > BZ_MAX_UNUSED)))
{ BZ_SETERR(BZ_PARAM_ERROR); return NULL; };
if (ferror(f))
{ BZ_SETERR(BZ_IO_ERROR); return NULL; };
bzf = (bzFile*)malloc ( sizeof(bzFile) ); // DFArc: explicit cast for C++
if (bzf == NULL)
{ BZ_SETERR(BZ_MEM_ERROR); return NULL; };
BZ_SETERR(BZ_OK);
bzf->initialisedOk = False;
bzf->handle = f;
bzf->bufN = 0;
bzf->writing = False;
bzf->strm.bzalloc = NULL;
bzf->strm.bzfree = NULL;
bzf->strm.opaque = NULL;
while (nUnused > 0) {
bzf->buf[bzf->bufN] = *((UChar*)(unused)); bzf->bufN++;
unused = ((void*)( 1 + ((UChar*)(unused)) ));
nUnused--;
}
ret = BZ2_bzDecompressInit ( &(bzf->strm), verbosity, small );
if (ret != BZ_OK)
{ BZ_SETERR(ret); free(bzf); return NULL; };
bzf->strm.avail_in = bzf->bufN;
bzf->strm.next_in = bzf->buf;
bzf->initialisedOk = True;
return bzf;
}
/*---------------------------------------------------*/
void BZip::bzReadClose ( int *bzerror, BZFILE *b )
{
bzFile* bzf = (bzFile*)b;
BZ_SETERR(BZ_OK);
if (bzf == NULL)
{ BZ_SETERR(BZ_OK); return; };
if (bzf->writing)
{ BZ_SETERR(BZ_SEQUENCE_ERROR); return; };
if (bzf->initialisedOk)
(void)BZ2_bzDecompressEnd ( &(bzf->strm) );
free ( bzf );
}
/*---------------------------------------------------*/
int BZip::bzRead
( int* bzerror,
BZFILE* b,
void* buf,
int len )
{
Int32 n, ret;
bzFile* bzf = (bzFile*)b;
BZ_SETERR(BZ_OK);
if (bzf == NULL || buf == NULL || len < 0)
{ BZ_SETERR(BZ_PARAM_ERROR); return 0; };
if (bzf->writing)
{ BZ_SETERR(BZ_SEQUENCE_ERROR); return 0; };
if (len == 0)
{ BZ_SETERR(BZ_OK); return 0; };
bzf->strm.avail_out = len;
bzf->strm.next_out = (char*)buf; // DFArc: explicit cast for C++
while (True) {
if (ferror(bzf->handle))
{ BZ_SETERR(BZ_IO_ERROR); return 0; };
if (bzf->strm.avail_in == 0 && !myfeof(bzf->handle)) {
n = fread ( bzf->buf, sizeof(UChar),
BZ_MAX_UNUSED, bzf->handle );
if (ferror(bzf->handle))
{ BZ_SETERR(BZ_IO_ERROR); return 0; };
bzf->bufN = n;
bzf->strm.avail_in = bzf->bufN;
bzf->strm.next_in = bzf->buf;
}
ret = BZ2_bzDecompress ( &(bzf->strm) );
if (ret != BZ_OK && ret != BZ_STREAM_END)
{ BZ_SETERR(ret); return 0; };
if (ret == BZ_OK && myfeof(bzf->handle) &&
bzf->strm.avail_in == 0 && bzf->strm.avail_out > 0)
{ BZ_SETERR(BZ_UNEXPECTED_EOF); return 0; };
if (ret == BZ_STREAM_END)
{ BZ_SETERR(BZ_STREAM_END);
return len - bzf->strm.avail_out; };
if (bzf->strm.avail_out == 0)
{ BZ_SETERR(BZ_OK); return len; };
}
return 0; /*not reached*/
}
//
// wxString BZip::Extract(wxGauge *PBar = 0)
//
// Decompresses a BZip file. Takes filename to decompress from mFilePath.
//
// PBar - Parameter passed to a pre-made wxGauge displaying the progress of the decompression.
//
// Returns: Decompressed file location.
//
wxString BZip::Extract( wxProgressDialog* aProgressDialog )
{
// First, grab a random filename.
wxString lTempFileName = wxFileName::CreateTempFileName(_T("DFArc"));
int lError(0);
unsigned long lTotalBytes = 0;
// Begin decompress stuff.
FILE* lDmodFileIn = fopen(mFilePath.fn_str(), "rb");
if ( lDmodFileIn == NULL )
{
wxLogError(_("Error: Could not open input file '%s' for bzip decompression."), mFilePath.c_str());
return _T("");
}
// Get the file size
fseek( lDmodFileIn, 0, SEEK_END );
unsigned long lEnd = ftell( lDmodFileIn );
fseek( lDmodFileIn, 0, SEEK_SET );
lTotalBytes = lEnd - ftell( lDmodFileIn );
lTotalBytes -= 10; // header
BZFILE* lBZipFileIn = bzReadOpen( &lError, lDmodFileIn, 0, 0, 0, 0 );
if( lError != BZ_OK )
{
wxLogError(_("Error: Invalid .dmod file selected!"));
fclose(lDmodFileIn);
return _T("");
}
// Open up the output file
FILE* lTarFileOut = fopen(lTempFileName.fn_str(), "wb");
if (lTarFileOut == NULL)
{
wxLogError(_("Error: Could not write to '%s'."), lTempFileName.c_str());
fclose(lDmodFileIn);
return _T("");
}
/* Efficient buffer size */
// int ebufsiz = BUFSIZ; // BUFSIZ=512 under woe, performance issues reported
int ebufsiz = 8192;
#ifdef HAVE_STRUCT_STAT_ST_BLKSIZE
struct stat sb;
if (fstat(fileno(lTarFileOut), &sb) < 0)
perror("stat");
else
/* Preferred I/O block size */
ebufsiz = sb.st_blksize;
#endif
char lBuffer[ebufsiz];
// Keep getting chunks of the file
while (true)
{
int lCurrentBytesRead = bzRead(&lError, lBZipFileIn, lBuffer, ebufsiz);
fwrite(lBuffer, lCurrentBytesRead, 1, lTarFileOut);
if ( lError != BZ_OK )
{
// Success
if ( lError == BZ_STREAM_END )
{
break;
}
else if ( lError == BZ_PARAM_ERROR )
{
wxLogError( _("Invalid .dmod file specified.") );
}
else if ( lError == BZ_SEQUENCE_ERROR )
{
wxLogError( _("Critical program function error: opened for write.") );
}
else if ( lError == BZ_IO_ERROR )
{
wxLogError( _("Could not read .dmod file.") );
}
else if ( lError == BZ_UNEXPECTED_EOF )
{
wxLogError( _("Incomplete .dmod file. Please download it again.") );
}
else if ( lError == BZ_DATA_ERROR )
{
wxLogError( _("The .dmod file is corrupted. Please download it again.") );
}
else if ( lError == BZ_DATA_ERROR_MAGIC )
{
wxLogError( _("The file is not a valid .dmod file.") );
}
else if ( lError == BZ_MEM_ERROR )
{
wxLogError( _("Out of memory error.") );
}
else
{
wxLogError( _("An unhandled error occured.") );
}
wxRemoveFile(lTempFileName);
lTempFileName = _T("");
break;
}
if (aProgressDialog != NULL)
{
int total_read = ((bzFile*)lBZipFileIn)->strm.total_in_lo32;
int lPercent = 100 * (long long)total_read / lTotalBytes;
aProgressDialog->Update(lPercent);
}
}
bzReadClose(&lError, lBZipFileIn);
fclose(lDmodFileIn);
fclose(lTarFileOut);
return lTempFileName;
}
dfarc-3.12/src/Package_Base.h 0000755 0001750 0001751 00000002610 12420022016 012654 0000000 0000000 // -*- C++ -*-
//
// generated by wxGlade b221e052e911 on Thu Oct 16 22:01:18 2014
//
// Example for compiling a single file project under Linux using g++:
// g++ MyApp.cpp $(wx-config --libs) $(wx-config --cxxflags) -o MyApp
//
// Example for compiling a multi file project under Linux using g++:
// g++ main.cpp $(wx-config --libs) $(wx-config --cxxflags) -o MyApp Dialog1.cpp Frame1.cpp
//
#ifndef PACKAGE_BASE_H
#define PACKAGE_BASE_H
#include
#include
#include "wx/intl.h"
#ifndef APP_CATALOG
#define APP_CATALOG "app" // replace with the appropriate catalog name
#endif
// begin wxGlade: ::dependencies
// end wxGlade
// begin wxGlade: ::extracode
// end wxGlade
class Package_Base: public wxDialog {
public:
// begin wxGlade: Package_Base::ids
// end wxGlade
Package_Base(wxWindow* parent, int id, const wxString& title, const wxPoint& pos=wxDefaultPosition, const wxSize& size=wxDefaultSize, long style=wxDEFAULT_DIALOG_STYLE);
private:
// begin wxGlade: Package_Base::methods
void set_properties();
void do_layout();
// end wxGlade
protected:
// begin wxGlade: Package_Base::attributes
wxStaticBox* lIdentifierBox_staticbox;
wxStaticText* lIntroText;
wxStaticText* lIdentifierText;
wxTextCtrl* mIdentifier;
wxButton* mOkay;
wxButton* mCancel;
// end wxGlade
}; // wxGlade: end class
#endif // PACKAGE_BASE_H
dfarc-3.12/src/DMod.hpp 0000664 0001750 0001751 00000002312 12340110733 011555 0000000 0000000 /**
* DMod metadata
* Copyright (C) 2008 Sylvain Beucler
* This file is part of GNU FreeDink
* GNU FreeDink 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.
* GNU FreeDink 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
* .
*/
#ifndef _DMOD_HPP
#define _DMOD_HPP
#include
class DMod
{
public:
static bool IsADModDir(wxString path);
DMod(wxString path);
wxString GetFullPath();
wxString GetBaseName();
wxString GetTitle();
wxString GetDescription();
wxString GetPreviewPath();
private:
wxString mFullPath;
wxString mBaseName;
wxString mTitle;
wxString mDescription;
wxString mPreviewPath;
wxString GetDModDizContent();
wxString GetDModDizTitle();
};
#endif
dfarc-3.12/src/dink.ico 0000664 0001750 0001751 00000001376 12340110733 011653 0000000 0000000 è ( @ € €€ € ÀÀÀ ÿÿÿ ÿ €€€ """ """"" """" "" " """ " " " 3" C@" 4 C""! " " @40"" " " CC"" "" D40"" ""CC0" UP D43 SP"""CD0 SU"" D4C U45P""C4 USDCUP" D0 S4DD3UP" USDCUP U45P SU SP UP ÿÀÿ ÿ ÿ ? ? € À à ð à À À À À À € € € € € € À ððƒø?ñÀø?ûàüÿðþÿÿð dfarc-3.12/src/Options.cpp 0000664 0001750 0001751 00000016466 12400710544 012402 0000000 0000000 /**
* Options dialog
* Copyright (C) 2005, 2006 Dan Walma
* Copyright (C) 2008, 2010, 2014 Sylvain Beucler
* This file is part of GNU FreeDink
* GNU FreeDink 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.
* GNU FreeDink 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
* .
*/
#include "Options.hpp"
#include "Config.hpp"
#include "ClientData.hpp"
#include
#include
#include
BEGIN_EVENT_TABLE(Options, wxDialog)
EVT_BUTTON(wxID_OK, Options::onOkay)
EVT_BUTTON(ID_OVERRIDE_DINKREFDIR_BROWSE, Options::onBrowseOverrideDinkrefDir)
EVT_BUTTON(ID_DMODDIR_BROWSE, Options::onBrowseDModDir)
EVT_CHOICE(ID_LANGUAGE_LIST, Options::onSelectLanguageList)
END_EVENT_TABLE()
Options::Options(Config* aConfig) :
Options_Base(NULL, wxID_ANY, _T("")),
mConfig(aConfig)
{
prepareDialog();
return;
}
void Options::prepareDialog()
{
// Prepare likely choices for game and editor executables selection
// Get a list of PATHs where executables are looked
/* The following code is adapted from
wxWidgets-2.8.8/src/common/filefn.cpp , not used directly because
you can't access a wxPathList's list of paths (!), only query
them, and the underlying list implementation changed from wxList
to wxArrayString between 2.6 and 2.8 */
wxArrayString paths_list;
#ifndef __WXWINCE__
static const wxChar PATH_TOKS[] =
#if defined(__WINDOWS__) || defined(__OS2__)
wxT(";"); // Don't separate with colon in DOS (used for drive)
#else
wxT(":;");
#endif
wxString val;
if ( wxGetEnv(wxT("PATH"), &val) )
{
// split into an array of string the value of the env var
paths_list = wxStringTokenize(val, PATH_TOKS);
}
#endif // !__WXWINCE__
#if defined(__WINDOWS__) || defined(__OS2__)
if (paths_list.Index(wxT(".")) == wxNOT_FOUND)
paths_list.Add(wxT("."));
#endif
for (int i = 0; i < paths_list.GetCount(); i++)
{
if (!wxDir::Exists(paths_list.Item(i)))
continue;
wxDir dir(paths_list.Item(i));
if (dir.IsOpened())
{
wxString filename;
bool cont = dir.GetFirst(&filename, wxEmptyString, wxDIR_FILES);
while (cont)
{
if (filename.MakeLower().Matches(wxT("*dink*" EXEEXT)))
if (wxFileName::IsFileExecutable(paths_list.Item(i) + wxFileName::GetPathSeparator() + filename))
{
mDinkExeBox->Append(filename);
mEditorExeBox->Append(filename);
}
cont = dir.GetNext(&filename);
}
}
}
/* Bare ISO-639-1 codes won't work with GNU/Linux */
/*
wxString iso_639_1 = wxT("aa ab ad ae af ak am an ar as av ay az ba be bg bh bi bm bn bo br bs ca ce ch co cr cs cu cv cy da de dv dz ee el en eo es et eu fa ff fi fj fo fr fy ga gd gl gn gu gv ha he hi ho hr ht hu hy hz ia id ie ig ii ik io is it iu ja jv ka kg ki kj kk kl km kn ko kr ks ku kv kw ky la lb lg li ln lo lt lu lv mg mh mi mk ml mn mo mr ms mt my na nb nd ne ng nl nn no nr nv ny oc oj om or os pa pi pl ps pt qu rm rn ro ru rw sa sc sd se sg si sk sl sm sn so sq sr ss st su sv sw ta te tg th ti tk tl tn to tr ts tt tw ty ug uk ur uz ve vi vo wa wo xh yi yo za zh zu");
wxArrayString language_list = wxStringTokenize(iso_639_1, _T(" "));
for (int i = 0; i < language_list.GetCount(); i++)
{
mForceLocaleBox->Append(language_list.Item(i));
}
*/
/* Let's suggest a set of supported locales instead - it can be
overridden anyway*/
/* TODO: generate from po/LINGUAS */
int idx = 0;
wxString supported_dfarc_languages = wxT("ca da de es eo fr fi hr hu it mk nl pl pt_BR sr tr vi");
wxArrayString language_list = wxStringTokenize(supported_dfarc_languages, wxT(" "));
mLanguageList->Append(_("System language"));
mLanguageList->SetClientObject(idx, new ClientDataString(wxEmptyString));
if (mConfig->mForceLocale == wxEmptyString)
mLanguageList->Select(idx);
idx++;
mLanguageList->Append(_("Don't translate"));
mLanguageList->SetClientObject(idx, new ClientDataString(wxT("C")));
if (mConfig->mForceLocale == wxT("C"))
mLanguageList->Select(idx);
idx++;
for (int i = 0; i < language_list.GetCount(); i++)
{
wxString label = language_list.Item(i);
const wxLanguageInfo* li = wxLocale::FindLanguageInfo(language_list.Item(i));
if (li != NULL)
label += wxT(" - ") + wxString(wxGetTranslation(li->Description));
mLanguageList->Append(label);
wxString locale_name = li->CanonicalName;
mLanguageList->SetClientObject(idx, new ClientDataString(locale_name));
if (locale_name == mConfig->mForceLocale)
mLanguageList->Select(idx);
idx++;
}
mLanguageList->Append(_("Custom"));
if (mLanguageList->GetSelection() == wxNOT_FOUND)
mLanguageList->Select(idx);
mWriteIniCheck -> SetValue(mConfig->mWriteIniValue);
mShowDeveloperCheck -> SetValue(mConfig->mShowDeveloperButtons);
mCloseCheck -> SetValue(mConfig->mCloseDfarcOnPlay);
mOverrideDinkrefDirCheck -> SetValue(mConfig->mOverrideDinkrefDir);
mOverrideDinkrefDirBox -> SetValue(mConfig->mSpecifiedDinkrefDir);
mDModDirBox -> SetValue(mConfig->mDModDir);
mDinkExeBox -> SetValue(mConfig->mDinkExe);
mEditorExeBox -> SetValue(mConfig->mEditorExe);
mPreferredFileBrowserBox -> SetValue(mConfig->mPreferredFileBrowserExe);
mForceLocaleBox -> SetValue(mConfig->mForceLocale);
this->SetMinSize(this->GetBestSize());
this->SetSize(this->GetMinSize());
}
void Options::onOkay(wxCommandEvent& aEvent)
{
mConfig->mWriteIniValue = mWriteIniCheck->GetValue();
mConfig->mShowDeveloperButtons = mShowDeveloperCheck->GetValue();
mConfig->mCloseDfarcOnPlay = mCloseCheck->GetValue();
mConfig->mOverrideDinkrefDir = mOverrideDinkrefDirCheck->GetValue();
mConfig->mSpecifiedDinkrefDir = mOverrideDinkrefDirBox->GetValue();
mConfig->mDModDir = mDModDirBox->GetValue();
mConfig->mDinkExe = mDinkExeBox->GetValue();
mConfig->mEditorExe = mEditorExeBox->GetValue();
mConfig->mPreferredFileBrowserExe = mPreferredFileBrowserBox->GetValue();
mConfig->mForceLocale = mForceLocaleBox->GetValue();
mConfig->Update();
EndModal(1);
return;
}
void Options::onBrowseOverrideDinkrefDir(wxCommandEvent& aEvent)
{
const wxString& dir = wxDirSelector(_("Choose the Dink Smallwood install directory"),
mOverrideDinkrefDirBox->GetValue());
if (!dir.IsEmpty())
mOverrideDinkrefDirBox->SetValue(dir);
}
void Options::onBrowseDModDir(wxCommandEvent& aEvent)
{
const wxString& dir = wxDirSelector(_("Choose a folder containing D-Mods"),
mDModDirBox->GetValue());
if (!dir.IsEmpty())
mDModDirBox->SetValue(dir);
}
void Options::onSelectLanguageList(wxCommandEvent& aEvent)
{
ClientDataString* cds = (ClientDataString*)aEvent.GetClientObject();
if (cds != NULL)
mForceLocaleBox->SetValue(((ClientDataString*)aEvent.GetClientObject())->s);
}
dfarc-3.12/src/Options_Base.h 0000755 0001750 0001751 00000004042 12420022015 012754 0000000 0000000 // -*- C++ -*-
//
// generated by wxGlade b221e052e911 on Thu Oct 16 22:01:17 2014
//
// Example for compiling a single file project under Linux using g++:
// g++ MyApp.cpp $(wx-config --libs) $(wx-config --cxxflags) -o MyApp
//
// Example for compiling a multi file project under Linux using g++:
// g++ main.cpp $(wx-config --libs) $(wx-config --cxxflags) -o MyApp Dialog1.cpp Frame1.cpp
//
#ifndef OPTIONS_BASE_H
#define OPTIONS_BASE_H
#include
#include
#include "wx/intl.h"
#ifndef APP_CATALOG
#define APP_CATALOG "app" // replace with the appropriate catalog name
#endif
// begin wxGlade: ::dependencies
// end wxGlade
// begin wxGlade: ::extracode
// end wxGlade
class Options_Base: public wxDialog {
public:
// begin wxGlade: Options_Base::ids
enum {
ID_OVERRIDE_DINKREFDIR_BROWSE = wxID_HIGHEST + 1000,
ID_DMODDIR_BROWSE = wxID_HIGHEST + 1001,
ID_LANGUAGE_LIST = wxID_HIGHEST + 1002
};
// end wxGlade
Options_Base(wxWindow* parent, int id, const wxString& title, const wxPoint& pos=wxDefaultPosition, const wxSize& size=wxDefaultSize, long style=wxDEFAULT_DIALOG_STYLE);
private:
// begin wxGlade: Options_Base::methods
void set_properties();
void do_layout();
// end wxGlade
protected:
// begin wxGlade: Options_Base::attributes
wxCheckBox* mCloseCheck;
wxCheckBox* mShowDeveloperCheck;
wxCheckBox* mWriteIniCheck;
wxCheckBox* mOverrideDinkrefDirCheck;
wxTextCtrl* mOverrideDinkrefDirBox;
wxButton* mOverrideDinkrefDirBrowse;
wxStaticText* lDModDirLabel;
wxTextCtrl* mDModDirBox;
wxButton* mDModDirBrowse;
wxStaticText* lDinkExeLabel;
wxComboBox* mDinkExeBox;
wxStaticText* lEditorExeLabel;
wxComboBox* mEditorExeBox;
wxStaticText* mPreferredFileBrowserLabel;
wxTextCtrl* mPreferredFileBrowserBox;
wxStaticText* lForceLocaleLabel;
wxChoice* mLanguageList;
wxTextCtrl* mForceLocaleBox;
wxButton* lOkay;
wxButton* lCancel;
// end wxGlade
}; // wxGlade: end class
#endif // OPTIONS_BASE_H
dfarc-3.12/src/BZip.hpp 0000664 0001750 0001751 00000003052 12417450341 011607 0000000 0000000 /**
* BZip2 file creator and extractor, with progress bar support
* Copyright (C) 2004 Andrew Reading
* Copyright (C) 2005, 2006 Dan Walma
* Copyright (C) 2008 Sylvain Beucler
* This file is part of GNU FreeDink
* GNU FreeDink 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.
* GNU FreeDink 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
* .
*/
#ifndef _BZIP_HPP
#define _BZIP_HPP
/* Put before wxWidgets headers, otherwise conflict with wx/string.h /
windows.h / wxProgressDialog (in that order eventually in BZip.cpp)
and crash under woe (arrrrgghhh!!!) */
#include
class wxProgressDialog;
#include "DFile.hpp"
class BZip : public DFile
{
public:
BZip(const wxString &szFile);
// Decompresses the file. Returns a path to the decompressed file.
wxString Extract( wxProgressDialog* aProgressDialog );
private:
BZFILE* bzReadOpen(int* bzerror, FILE* f, int verbosity, int small, void* unused, int nUnused);
void bzReadClose(int *bzerror, BZFILE *b);
int bzRead(int* bzerror, BZFILE* b, void* buf, int len);
};
#endif
dfarc-3.12/src/icon_xpm.hpp 0000664 0001750 0001751 00000000031 12340110733 012542 0000000 0000000 extern char *dink_xpm[];
dfarc-3.12/src/DFile.cpp 0000664 0001750 0001751 00000002063 12417450373 011727 0000000 0000000 /**
* Base class for Tar and Bzip
* Copyright (C) 2004 Andrew Reading
* Copyright (C) 2005, 2006 Dan Walma
* Copyright (C) 2008 Sylvain Beucler
* This file is part of GNU FreeDink
* GNU FreeDink 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.
* GNU FreeDink 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
* .
*/
#include "DFile.hpp"
#include
DFile::DFile(const wxString &szFile)
{
if(szFile.IsEmpty())
{
mFilePath = wxFileName::CreateTempFileName(_T("DFArc2"));
}
else
{
mFilePath = szFile;
}
}
dfarc-3.12/src/Tar.cpp 0000664 0001750 0001751 00000045426 12417562543 011507 0000000 0000000 /**
* Tar file creation and extraction, with progress bar support
* Copyright (C) 2004 Andrew Reading
* Copyright (C) 2005, 2006 Dan Walma
* Copyright (C) 2008, 2014 Sylvain Beucler
* This file is part of GNU FreeDink
* GNU FreeDink 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.
* GNU FreeDink 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
* .
*/
#ifdef HAVE_CONFIG_H
#include
#endif
#include "Tar.hpp"
#include
#include
#include
#include
#include
#include
#include
#include
#include "IOUtils.hpp"
#if defined _WIN32 || defined __WIN32__ || defined __CYGWIN__
#define fopen(file, mode) _wfopen(file, _T(mode))
#endif
struct fileinfo
{
wxString fullpath;
int mode;
int blksize;
int size;
int mtime;
};
Tar::Tar(wxString &szFile, wxString &szCompressDir) :
DFile(szFile)
{
strCompressDir = szCompressDir;
bCanCompress = true;
}
Tar::Tar(wxString& szFile) : DFile(szFile)
{
bCanCompress = false;
}
//
// TAR CREATE FUNCTIONS
//
bool Tar::Create(const wxString& dmod_folder, double *compression_ratio, wxProgressDialog* aProgressDialog)
{
if (!bCanCompress)
return wxEmptyString;
// Remember current directory
wxString strCwd = ::wxGetCwd();
// Actual archiving
::wxSetWorkingDirectory(strCompressDir);
bool result = CreateReal(dmod_folder, compression_ratio, aProgressDialog);
// Back to where we were
::wxSetWorkingDirectory(strCwd);
return result;
}
bool Tar::CreateReal(const wxString& dmod_folder, double *compression_ratio, wxProgressDialog* aProgressDialog)
{
bool aborted = false;
// Populate file list.
wxArrayString wxasFileList;
aProgressDialog->Update(0, _("Listing files..."));
IOUtils::GetAllDModFiles(strCompressDir, wxasFileList);
// We'll make the paths relative now
int iNumEntries = wxasFileList.GetCount();
// stat() all files, and get the total input size (for progress bar)
fileinfo *fileinfos = new fileinfo[iNumEntries];
int total_file_data = 0;
for (unsigned int i = 0; i < wxasFileList.GetCount(); ++i)
{
fileinfos[i].fullpath = strCompressDir + _T("/") + wxasFileList.Item(i);
#if defined _WIN32 || defined __WIN32__ || defined __CYGWIN__
struct _stat sb;
if (_wstat(fileinfos[i].fullpath.fn_str(), &sb) < 0)
#else
struct stat sb;
if (stat(fileinfos[i].fullpath.fn_str(), &sb) < 0)
#endif
{
perror("stat");
fileinfos[i].mode = 0; // invalid, to skip
continue;
}
fileinfos[i].mode = sb.st_mode;
fileinfos[i].size = sb.st_size;
fileinfos[i].mtime = sb.st_mtime;
/* Preferred I/O block size */
#ifdef HAVE_STRUCT_STAT_ST_BLKSIZE
fileinfos[i].blksize = sb.st_blksize;
#else
// fileinfos[i].blksize = BUFSIZ; // BUFSIZ=512 under woe, performance issues reported
fileinfos[i].blksize = 8192;
#endif
total_file_data += sb.st_size;
}
aProgressDialog->Update(0, _("Initializing..."));
FILE* out = fopen(mFilePath.fn_str(), "wb");
if (!out)
{
wxLogError(_("Error: Could not open tar file '%s' for bzip compression."), mFilePath.c_str());
return false;
}
/* libbz2 init */
BZFILE* bz_out = 0;
int iErr = 0;
int compress_factor = 9;
int debug_verbosity = 0;
// workFactor is in [1,250], defaults to 30 (this is also what
// 'bzip2' uses). 90 is what is used in DFArc1.5 and seems pretty
// much arbitrary. The documentation is in BZ2_bzCompressInit - but
// after reading it I can't say whether using 90 actually helps with
// compression ratio or times. So let's reset to default (0 => 30).
int workFactor = 0;
bz_out = BZ2_bzWriteOpen(&iErr, out,
compress_factor,
debug_verbosity,
workFactor);
if (iErr != BZ_OK)
{
wxLogError(_("Error: Could not initialize compression method!"
" "
"Will not generate a correct .dmod file."
" "
"Quitting."));
fclose(out);
return false;
}
int total_file_data_written = 0;
for (unsigned int i = 0; i < wxasFileList.GetCount(); ++i)
{
// Update the progress bar.
if (aProgressDialog != NULL)
{
// Update the meter.
//int lPercent = 98 * i / iNumEntries;
int lPercent = 98 * (long long)total_file_data_written / total_file_data;
aProgressDialog->Update(lPercent, wxasFileList.Item(i));
}
// Write tar data.
char header[512];
if (!FillHeader(wxasFileList.Item(i), dmod_folder, header, &fileinfos[i]))
continue;
// Now, write our record.
BZ2_bzWrite(&iErr, bz_out, header, 512);
// Open our input file.
FILE *in = fopen(fileinfos[i].fullpath.fn_str(), "rb");
if (in == NULL)
{
wxLogFatalError(_("Error: File '%s' not found! Cannot archive file."),
fileinfos[i].fullpath.c_str());
throw;
}
// Write the file.
int ebufsiz = fileinfos[i].blksize; // efficient buffer size
unsigned char* szBuf = (unsigned char*)malloc(ebufsiz);
int cur_file_nb_written = 0;
while(!feof(in))
{
int nb_read = fread(szBuf, 1, ebufsiz, in);
BZ2_bzWrite(&iErr, bz_out, szBuf, nb_read);
cur_file_nb_written += nb_read;
total_file_data_written += nb_read;
if (aProgressDialog != NULL)
{
int lPercent = 98 * (long long)total_file_data_written / total_file_data;
bool cont = aProgressDialog->Update(lPercent);
if (!cont)
{
aborted = true;
fclose(in);
free(szBuf);
goto clean_up;
}
}
}
fclose(in);
// Round to the nearest 512-byte mark.
// For empty file: no data (i.e. _not_ an empty extra 512 block)
int iAmountToRound = (512 - (cur_file_nb_written % (512))) % 512;
memset(szBuf, 0, iAmountToRound);
BZ2_bzWrite(&iErr, bz_out, szBuf, iAmountToRound);
// BE FREEEEEEE!!!
free(szBuf);
}
// Write the end-of-archive entry.
char eoa[2*512];
memset(eoa, 0, 2*512);
BZ2_bzWrite(&iErr, bz_out, eoa, 2*512);
clean_up:
// Close the output file.
aProgressDialog->Update(98, _("Closing..."));
int force_flush = 0; /* no force flush */
unsigned int nbytes_in = 0;
unsigned int nbytes_out = 0;
BZ2_bzWriteClose(&iErr, bz_out, force_flush, &nbytes_in, &nbytes_out);
*compression_ratio = (double) nbytes_in / nbytes_out;
fclose(out);
delete[] fileinfos;
aProgressDialog->Update(100); // Closes window
return !aborted;
}
/**
* Fill in a tar header in a memory buffer
*
* It is not portable to do the same job in a C struct, because
* there's no guarantee about how the C compiler will align the struct
* fields in memory, which would break the checksum.
*
* Return whether to use this file (true) or skip it (false)
*/
bool Tar::FillHeader(wxString &mFilePath, const wxString& dmod_folder, char *header512, fileinfo *finfo)
{
// Get file information
// Only store regular files
if (!S_ISREG(finfo->mode))
return false;
// Start collecting data.
char* ptr = header512;
// filename
strncpy(ptr, (dmod_folder.Lower() + _T("/") + mFilePath.Lower()).mb_str(wxConvUTF8), 100);
ptr += 100;
// No need to save actual permissions and owner - just tidy them
// mode
strncpy(ptr, "0100644", 8);
ptr += 8;
// uid
strncpy(ptr, "0000000", 8);
ptr += 8;
// gid
strncpy(ptr, "0000000", 8);
ptr += 8;
// file size (octal on 11 bytes + '\0')
sprintf(ptr, "%011o", finfo->size);
ptr += 12;
// time of modification (octal on 11 bytes + '\0')
sprintf(ptr, "%011o", finfo->mtime);
ptr += 12;
// Before the actual checksum, consider that the checksum field is
// filled with spaces
memset(ptr, ' ', 8);
ptr += 8;
// Type of file.
// linkflag
*ptr = '0'; // Normal file
ptr++;
// linkname
strncpy(ptr, "", 100);
ptr += 100;
// version
strncpy(ptr, "ustar ", 8);
ptr += 8;
// uname
strncpy(ptr, "root", 32);
ptr += 32;
// gname
strncpy(ptr, "root", 32);
ptr += 32;
// Skip devminor and devmajor.
strncpy(ptr, "", 8);
ptr += 8;
strncpy(ptr, "", 8);
ptr += 8;
// Fill the padding.
strncpy(ptr, "", 167);
// Find the checksum.
unsigned char* ptru = NULL; // use the (unsigned) ASCII value of characters
int iChksum = 0;
for (ptru = (unsigned char*) header512; ptru < (unsigned char*)(header512 + 512); ptru++)
iChksum += *ptru;
// (octal on 7 bytes + '\0')
ptr = header512 + 148;
sprintf(ptr, "%07o", iChksum);
return true;
}
/**
* Read all tar headers from a flux, so it can work if reading file
* with BZip2 directly (only the 'read' operation is available).
*/
int Tar::ReadHeaders( void )
{
FILE *in;
TarHeader lHeader;
TarRecord lRecord;
unsigned int iBegData = 0;
char buf_header[512];
in = fopen(mFilePath.fn_str(), "rb");
if(in == NULL)
{
wxLogFatalError(_("Error: File '%s' not found! Cannot read data."), mFilePath.c_str());
return 1;
}
wxString lDmodDizPath;
mmDmodDescription = _T("");
mInstalledDmodDirectory = _T("");
int total_read = 0;
while (true)
{
memset(&lHeader, 0, sizeof(TarHeader));
memset(&lRecord, 0, sizeof(TarRecord));
// Read the data. Dont load the whole header to a struct, you
// never know what the memory alignment will be, especially in
// these 32->64bits days
fread((char*)&lHeader.Name, 100, 1, in);
fread((char*)&lHeader.Mode, 8, 1, in);
fread((char*)&lHeader.Uid, 8, 1, in);
fread((char*)&lHeader.Gid, 8, 1, in);
fread((char*)&lHeader.Size, 12, 1, in);
fread((char*)&lHeader.Mtime, 12, 1, in);
fread((char*)&lHeader.Chksum, 8, 1, in);
fread((char*)&lHeader.Linkflag, 1, 1, in);
fread((char*)&lHeader.Linkname, 100, 1, in);
fread((char*)&lHeader.Magic, 8, 1, in);
fread((char*)&lHeader.Uname, 32, 1, in);
fread((char*)&lHeader.Gname, 32, 1, in);
fread((char*)&lHeader.Devmajor, 8, 1, in);
fread((char*)&lHeader.Devminor, 8, 1, in);
fread((char*)&lHeader.Padding, 167, 1, in);
total_read += 512;
if(!VerifyChecksum(&lHeader))
{
// Nope. Exit.
wxLogFatalError(_("Error: This .dmod file has an invalid checksum! Cannot read file."));
return 1;
}
strncpy(lRecord.Name, lHeader.Name, 100);
// Bug fix for phantom files that aren't really files...
// This is due to a bug in DFArc1.5 with empty files
if (strcmp(lHeader.Name, "\xFF") == 0)
continue;
// Size
sscanf((const char*)&lHeader.Size, "%o", &lRecord.iFileSize);
// Start
lRecord.iFilePosBegin = total_read;
// Tar files (except for a design bug in DFArc1.5) have a
// multitude of NULL characters at the end to round up to the
// 10K mark. If the header is blank, we don't have any more
// data.
if(strcmp(lHeader.Name, "") == 0)
{
break;
}
//wxLogError("%s %d", lHeader.Name, lRecord.iFileSize);
wxString lPath(lRecord.Name, wxConvUTF8);
if (mInstalledDmodDirectory.Length() == 0)
{
mInstalledDmodDirectory = lPath.SubString( 0, lPath.Find( '/' ) );
lDmodDizPath = mInstalledDmodDirectory + _T("dmod.diz");
lDmodDizPath.LowerCase();
}
if (lPath.Lower() == lDmodDizPath && lRecord.iFileSize < 100*1024)
{
// Read dmod.diz content, but only if < 100kB
char *buf = (char*)malloc(lRecord.iFileSize + 1);
fread(buf, 1, lRecord.iFileSize, in);
buf[lRecord.iFileSize] = '\0';
// dmod.diz are typically uncoded in ISO-8859-1/latin-1
mmDmodDescription = wxString(buf, wxConvISO8859_1);
free(buf);
}
else
{
int remaining = lRecord.iFileSize;
char buf[BUFSIZ];
while (remaining > 0)
{
if (feof(in))
break; // TODO: error, unexpected end of file
int nb_read = fread(buf, 1, (remaining > BUFSIZ) ? BUFSIZ : remaining, in);
remaining -= nb_read;
}
}
total_read += lRecord.iFileSize;
TarRecords.push_back(lRecord);
// Move to the beginning of the next header
int padding_size = (512 - (total_read % 512)) % 512;
fread(buf_header, 1, padding_size, in);
total_read += padding_size;
}
fclose(in);
return 0;
}
int Tar::Extract(wxString destdir, wxProgressDialog* aProgressDialog)
{
wxString strBuf;
int lError = 0;
// Remember current directory
wxString strCwd = ::wxGetCwd();
// Open the file here so it doesn't error after changing.
wxFile wx_In(mFilePath, wxFile::read);
if(!wx_In.IsOpened())
{
lError = 1;
wxLogFatalError(_("Error: File '%s' not found! Cannot extract data."), mFilePath.c_str());
throw;
}
// Attempt to create destination if not present (e.g. custom
// DModDir that is not created yet)
if (!::wxDirExists(destdir))
wxFileName::Mkdir(destdir, 0777, wxPATH_MKDIR_FULL); // 0777 minus umask
if (!::wxDirExists(destdir))
{
wxLogFatalError(_("Error: Cannot create directory '%s'. Cannot extract data."), destdir.c_str());
throw;
}
// Move to the directory.
::wxSetWorkingDirectory(destdir);
// Put the data in the directories.
__gnu_cxx::stdio_filebuf filebuf(wx_In.fd(), std::ios::in);
std::istream f_In(&filebuf);
if (ExtractData(f_In, destdir, aProgressDialog) != 0)
{
lError = 1;
}
wx_In.Close();
// We're done. Move back.
::wxSetWorkingDirectory(strCwd);
return lError;
}
int Tar::ExtractData(std::istream& aTarStreamIn, wxString destdir, wxProgressDialog* aProgressDialog)
{
int lError = 0;
unsigned long lTotalBytes = 0;
unsigned long lTotalBytesRead = 0;
// Get the file size
aTarStreamIn.seekg(0, std::ios::end);
unsigned long lEnd = static_cast(aTarStreamIn.tellg());
aTarStreamIn.seekg(0, std::ios::beg);
lTotalBytes = lEnd - static_cast(aTarStreamIn.tellg());
// Move into the extract dir.
wxString lPreviousWorkingDirectory(::wxGetCwd());
::wxSetWorkingDirectory(destdir);
// Extract the files.
int ebufsiz = 8192;
char buffer[ebufsiz];
for (unsigned int lTarRecordIndex = 0; lTarRecordIndex < TarRecords.size(); ++lTarRecordIndex)
{
TarRecord lCurrentTarRecord = TarRecords.at(lTarRecordIndex);
wxString lCurrentFilePath = wxString(lCurrentTarRecord.Name, wxConvUTF8);
if (lCurrentFilePath.IsEmpty())
{
/* Attempt convertion from latin-1 if not valid UTF-8 */
lCurrentFilePath = wxString(lCurrentTarRecord.Name, wxConvISO8859_1);
}
wxString lCurrentDirectory(lCurrentFilePath.substr(0, lCurrentFilePath.find_last_of('/')));
// Odd bad file problem...
if (lCurrentFilePath.compare(_T("\xFF")) == 0) // "ÿ"
{
// Only warn them if it doesn't come at the end.
if (lTarRecordIndex != TarRecords.size() - 1)
{
lError = 1;
wxLogError(_("Got bad file %d/%d. Skipping."), lTarRecordIndex, TarRecords.size() );
}
}
else
{
// Create the directory if it doesn't exist
if (::wxDirExists(lCurrentDirectory) == false)
{
// Use 0777 - the umask will remove group and/or
// other write access as necessary. Don't forget
// to prefix with a '0' for octal mode.
wxFileName::Mkdir(lCurrentDirectory, 0777, wxPATH_MKDIR_FULL);
}
// Only write the file if it is a file... some files are stored as directories
char lLastCharacter = lCurrentFilePath[lCurrentFilePath.length() - 1];
if (lLastCharacter != '\\' && lLastCharacter != '/')
{
// Open the file.
wxFile wx_Out(lCurrentFilePath, wxFile::write);
if (!wx_Out.IsOpened())
{
wxLogError(_("Error: Improperly archived file '%s'. Skipping."), lCurrentFilePath);
lError = 1;
continue;
}
__gnu_cxx::stdio_filebuf filebuf(wx_Out.fd(), std::ios::out);
std::ostream lStreamOut(&filebuf);
aTarStreamIn.seekg(lCurrentTarRecord.iFilePosBegin, std::ios::beg);
long remaining = lCurrentTarRecord.iFileSize;
while (remaining > 0)
{
int bufsiz = remaining;
if (bufsiz > ebufsiz) bufsiz = ebufsiz;
aTarStreamIn.read(buffer, bufsiz);
lStreamOut.write(buffer, bufsiz);
remaining -= bufsiz;
}
lTotalBytesRead += lCurrentTarRecord.iFileSize;
// Close up.
lStreamOut.flush();
wx_Out.Close();
}
// Update progress
if( aProgressDialog != NULL )
{
double lPercent( 100.0 * lTotalBytesRead / lTotalBytes ) ;
if ( lPercent >= 100 )
{
lPercent = 99.0;
}
aProgressDialog->Update(static_cast(lPercent), lCurrentFilePath);
::wxYield();
}
}
}
aProgressDialog->Update(100, _("Done."));
::wxSetWorkingDirectory(lPreviousWorkingDirectory);
return lError;
}
wxString Tar::getInstalledDmodDirectory( void )
{
return mInstalledDmodDirectory;
}
wxString Tar::getmDmodDescription( void )
{
return mmDmodDescription;
}
////////////////////
// Tar Operations //
////////////////////
//
// class CTar, bool VerifyChecksum(TarHeader *Header)
//
// PURPOSE: Ensures the internal Header checksum is valid.
// RETURNS: True if valid.
// False otherwise.
bool Tar::VerifyChecksum(TarHeader *Header)
{
char *CheckRecord = 0;
int iChksum = 0;
// Checksum is counted as if it was blank. Let's back it up and clear it.
memset(Header->Chksum, 0, sizeof(Header->Chksum));
// Prepare the incrementor.
CheckRecord = reinterpret_cast(Header);
// Find the checksum.
for(; (CheckRecord - reinterpret_cast(Header)) < 512; ++CheckRecord)
{
iChksum += static_cast(*CheckRecord);
}
// Add 256 (2^8)
iChksum += 256;
char sz[8];
sprintf(sz, "%07o", iChksum);
/*if(atoi(sz) == atoi(strChksum.c_str()))
{
return true;
}*/
//return false;
return true;
}
//
// class CTar, int RountTo512(int n)
//
// PURPOSE: Moves the number to the nearest multiple of 512.
// RETURNS: The new number.
//
int Tar::RoundTo512(int n)
{
if(n % 512 == 0)
{
return n;
}
else
{
return (n - (n % 512)) + 512;
}
}
dfarc-3.12/src/InstallVerifyFrame.hpp 0000664 0001750 0001751 00000002730 12417450324 014514 0000000 0000000 /**
* D-Mod installation wizard
* Copyright (C) 2004 Andrew Reading
* Copyright (C) 2005, 2006 Dan Walma
* Copyright (C) 2008 Sylvain Beucler
* This file is part of GNU FreeDink
* GNU FreeDink 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.
* GNU FreeDink 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
* .
*/
#ifndef INSTALLVERIFYFRAME_HPP
#define INSTALLVERIFYFRAME_HPP
#include "InstallVerifyFrame_Base.h"
#include
class Tar;
class Config;
class InstallVerifyFrame : public InstallVerifyFrame_Base
{
public:
InstallVerifyFrame(const wxString& aFilePath);
~InstallVerifyFrame();
wxString getSelectedDmod( void );
private:
void prepareDialog(void);
void onQuit(wxCloseEvent &Event);
void onCancel(wxCommandEvent &Event);
void onInstall(wxCommandEvent &Event);
Config* mConfig;
// Full name of the D-Mod
wxString mDmodName;
// Temporary uncompressed .tar file
wxString mTarFilePath;
DECLARE_EVENT_TABLE()
};
#endif
dfarc-3.12/src/Makefile.am 0000664 0001750 0001751 00000005504 12416557450 012302 0000000 0000000 # Help DFArc look for either 'dink' or 'dink.exe':
AM_CPPFLAGS = -DEXEEXT=\"$(EXEEXT)\"
# Cf. (autoconf.info)Installation Directory Variables:
# Don't use DATADIR, it conflicts with something in MinGW
AM_CPPFLAGS += -DDEFAULT_DATA_DIR=\"$(datadir)\"
bin_PROGRAMS = dfarc
dfarc_SOURCES = BZip.cpp BZip.hpp ClientData.hpp Config.cpp Config.hpp \
DFArcApp.cpp DFArcFrame.cpp DFArcFrame.hpp DFile.cpp DFile.hpp \
DMod.cpp DMod.hpp icon_xpm.cpp icon_xpm.hpp IOUtils.cpp \
IOUtils.hpp InstallVerifyFrame.cpp InstallVerifyFrame.hpp \
Options.cpp Options.hpp Package.cpp Package.hpp \
RecursiveDelete.cpp RecursiveDelete.hpp Tar.cpp Tar.hpp \
DFArcFrame_Base.cpp DFArcFrame_Base.h Options_Base.cpp \
Options_Base.h Package_Base.cpp Package_Base.h \
InstallVerifyFrame_Base.cpp InstallVerifyFrame_Base.h
# DFArcFrame_Base.cpp/h will be automatically generated before the
# rest of the source code. In addition, they will be included in
# tarballs, so people won't need wxglade to compile DFArc :)
# Using $(srcdir) so that the .po build system will find them
BUILT_SOURCES = $(srcdir)/DFArcFrame_Base.cpp \
$(srcdir)/DFArcFrame_Base.h $(srcdir)/Options_Base.cpp \
$(srcdir)/Options_Base.h $(srcdir)/Package_Base.cpp $(srcdir)/Package_Base.h \
$(srcdir)/InstallVerifyFrame_Base.cpp $(srcdir)/InstallVerifyFrame_Base.h
CLEANFILES = $(BUILT_SOURCES)
EXTRA_DIST = DFArcFrame_Base.wxg Options_Base.wxg Package_Base.wxg \
InstallVerifyFrame_Base.wxg
# work-around for wxglade < 2.6.9
AM_CPPFLAGS += -DwxTHICK_FRAME=wxRESIZE_BORDER
# disable obnoxious wxWidgets3 assertions
AM_CPPFLAGS += -DNDEBUG
# How do we handle resources embedded in the executable binary?
if HAVE_WINDRES
nodist_dfarc_SOURCES = woeres.rc
endif
if HAVE_WXGLADE
# wxGlade (GUI builder) code generation
.wxg.cpp:
$(AM_V_GEN)
$(AM_V_at) $(WXGLADE) -g C++ -o $@ $<
else
.wxg.cpp:
@echo
@echo " Please install 'wxglade' to rebuild the '.wxg' GUI files"
@echo " (and then run ./config.status --recheck)"
@echo
exit 1
endif
# Woe icon and app infos
# Also check http://fragglet.livejournal.com/4448.html
.rc.o:
$(WINDRES) -i $< -o $@
install-exec-hook:
if HAVE_UPX
# UPX compression
# Needs to be done before bundling resources
# Not using --best because it takes much more time and the result is
# only a little bit smaller
-$(UPX) "$(DESTDIR)$(bindir)/dfarc$(EXEEXT)"
endif
# Add 'freedink-dfarc' alias so that command-line FreeDink users see
# the front-end more easily (via tab completion)
$(LN_S) -f "dfarc$(EXEEXT)" "$(DESTDIR)$(bindir)/freedink-dfarc$(EXEEXT)"
uninstall-hook:
rm -f "$(DESTDIR)$(bindir)/freedink-dfarc$(EXEEXT)"
EXTRA_DIST += dink.ico
# For reference, wxGlade (GUI builder) alternate 2-steps code
# generation:
#.wxg.xrc:
# $(WXGLADE) -g XRC -o $@ $<
#.xrc.cpp:
# $(WXRC) -c -e -o $@ -n Init$* $<
## Fix GCC-4.2 + wxrc-2.6 warning
# sed -i -e 's/$*:://g' $*.h
dfarc-3.12/src/RecursiveDelete.cpp 0000664 0001750 0001751 00000004265 12400615063 014033 0000000 0000000 /**
* File utilities to uninstall a D-Mod
* Copyright (C) 2005, 2006 Dan Walma
* Copyright (C) 2008 Sylvain Beucler
* This file is part of GNU FreeDink
* GNU FreeDink 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.
* GNU FreeDink 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
* .
*/
#include "RecursiveDelete.hpp"
#include
#include
RecursiveDelete::RecursiveDelete(bool aRemoveSaveGames) :
mRemoveSaveGames(aRemoveSaveGames),
mError(false)
{
}
wxDirTraverseResult RecursiveDelete::OnFile(const wxString& aFilename)
{
bool lRemoveFile( true );
// See if it is a save game file
if (mRemoveSaveGames == false)
{
wxString lFilename = aFilename.Mid( aFilename.Find( '/', true ) + 1 );
if (lFilename.Mid(0, 4).MakeUpper() == _T("SAVE")
&& lFilename.Mid(lFilename.Len() - 3).MakeUpper() == _T("DAT"))
{
lRemoveFile = false;
}
}
// Remove the file
if (lRemoveFile == true)
{
if (::wxRemoveFile(aFilename) == false)
{
wxLogError(_("Could not remove %s"), aFilename.c_str());
mError = true;
}
}
return wxDIR_CONTINUE;
}
wxDirTraverseResult RecursiveDelete::OnDir( const wxString& aDirname )
{
RecursiveDelete lRecursiveDelete( false );
wxDir* lDir = new wxDir( aDirname );
lDir->Traverse( lRecursiveDelete );
delete lDir;
if ( lRecursiveDelete.getError() == false )
{
if ( ::wxRmdir( aDirname ) == false )
{
wxLogError(_("Could not remove %s"), aDirname.c_str());
mError = true;
}
}
else if ( mError == false )
{
mError = true;
}
return wxDIR_IGNORE;
}
bool RecursiveDelete::getError( void )
{
return mError;
}
dfarc-3.12/src/Package_Base.wxg 0000664 0001750 0001751 00000007227 12400704113 013245 0000000 0000000
DFArc - PackagewxVERTICALwxLEFT|wxRIGHT|wxTOP|wxEXPAND101wxLEFT|wxRIGHT|wxTOP|wxEXPAND10wxHORIZONTALwxALL|wxEXPAND21wxALL|wxALIGN_RIGHT2wxALL|wxEXPAND10wxHORIZONTAL01wxID_OKwxLEFT10CANCELwxID_CANCEL
dfarc-3.12/src/Package_Base.cpp 0000755 0001750 0001751 00000004535 12420022016 013217 0000000 0000000 // -*- C++ -*-
//
// generated by wxGlade b221e052e911 on Thu Oct 16 22:01:18 2014
//
// Example for compiling a single file project under Linux using g++:
// g++ MyApp.cpp $(wx-config --libs) $(wx-config --cxxflags) -o MyApp
//
// Example for compiling a multi file project under Linux using g++:
// g++ main.cpp $(wx-config --libs) $(wx-config --cxxflags) -o MyApp Dialog1.cpp Frame1.cpp
//
#include "Package_Base.h"
// begin wxGlade: ::extracode
// end wxGlade
Package_Base::Package_Base(wxWindow* parent, int id, const wxString& title, const wxPoint& pos, const wxSize& size, long style):
wxDialog(parent, id, title, pos, size, wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER|wxTHICK_FRAME)
{
// begin wxGlade: Package_Base::Package_Base
lIdentifierBox_staticbox = new wxStaticBox(this, wxID_ANY, _("Identifier"));
lIntroText = new wxStaticText(this, wxID_ANY, _("Note: Unless you're making a D-Mod, you shouldn't be around here.\nThis is for creating a .dmod file for a D-Mod you made.\n\nWill package '%s' located at\n%s"));
lIdentifierText = new wxStaticText(this, wxID_ANY, _("D-Mod filename (8 letters/numbers)"));
mIdentifier = new wxTextCtrl(this, wxID_ANY, wxEmptyString);
mOkay = new wxButton(this, wxID_OK, _("Package"));
mCancel = new wxButton(this, wxID_CANCEL, wxEmptyString);
set_properties();
do_layout();
// end wxGlade
}
void Package_Base::set_properties()
{
// begin wxGlade: Package_Base::set_properties
SetTitle(_("DFArc - Package"));
mOkay->SetDefault();
// end wxGlade
}
void Package_Base::do_layout()
{
// begin wxGlade: Package_Base::do_layout
wxBoxSizer* lMainSizer = new wxBoxSizer(wxVERTICAL);
wxBoxSizer* lActionBox = new wxBoxSizer(wxHORIZONTAL);
lIdentifierBox_staticbox->Lower();
wxStaticBoxSizer* lIdentifierBox = new wxStaticBoxSizer(lIdentifierBox_staticbox, wxHORIZONTAL);
lMainSizer->Add(lIntroText, 1, wxLEFT|wxRIGHT|wxTOP|wxEXPAND, 10);
lIdentifierBox->Add(lIdentifierText, 1, wxALL|wxEXPAND, 2);
lIdentifierBox->Add(mIdentifier, 1, wxALL|wxALIGN_RIGHT, 2);
lMainSizer->Add(lIdentifierBox, 1, wxLEFT|wxRIGHT|wxTOP|wxEXPAND, 10);
lActionBox->Add(mOkay, 0, 0, 0);
lActionBox->Add(mCancel, 0, wxLEFT, 10);
lMainSizer->Add(lActionBox, 0, wxALL|wxEXPAND, 10);
SetSizer(lMainSizer);
lMainSizer->Fit(this);
Layout();
// end wxGlade
}
dfarc-3.12/src/DFile.hpp 0000664 0001750 0001751 00000002025 12417450404 011725 0000000 0000000 /**
* Base class for Tar and Bzip
* Copyright (C) 2004 Andrew Reading
* Copyright (C) 2005, 2006 Dan Walma
* Copyright (C) 2008 Sylvain Beucler
* This file is part of GNU FreeDink
* GNU FreeDink 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.
* GNU FreeDink 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
* .
*/
#ifndef _DFILE_HPP
#define _DFILE_HPP
#include
class DFilesystem;
// Wrapper for a file.
class DFile
{
public:
DFile(const wxString &szFile);
protected:
wxString mFilePath;
};
#endif
dfarc-3.12/src/Options.hpp 0000664 0001750 0001751 00000002653 12340110733 012375 0000000 0000000 /**
* Options dialog
* Copyright (C) 2005, 2006 Dan Walma
* Copyright (C) 2008 Sylvain Beucler
* This file is part of GNU FreeDink
* GNU FreeDink 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.
* GNU FreeDink 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
* .
*/
#ifndef OPTIONS_HPP
#define OPTIONS_HPP
#include "Options_Base.h"
#include "Config.hpp"
enum
{
ID_WRITE_INI = 0,
ID_PLAY_MOVIE,
ID_LIST_ALL,
ID_OVERRIDE_CHECK,
ID_OVERRIDE_EDIT,
ID_OVERRIDE_BROWSE,
ID_DINK_EXE,
ID_EDIT_EXE,
ID_OKAY,
ID_OP_CANCEL
};
class Options : public Options_Base
{
public:
Options(Config* aConfig);
private:
void prepareDialog();
void onOkay(wxCommandEvent& aEvent);
void onBrowseOverrideDinkrefDir(wxCommandEvent& aEvent);
void onBrowseDModDir(wxCommandEvent& aEvent);
void onSelectLanguageList(wxCommandEvent& aEvent);
Config *mConfig;
DECLARE_EVENT_TABLE()
};
#endif
dfarc-3.12/src/Config.cpp 0000664 0001750 0001751 00000016647 12400710573 012157 0000000 0000000 /**
* Application configuration values
* Copyright (C) 2008, 2009, 2014 Sylvain Beucler
* This file is part of GNU FreeDink
* GNU FreeDink 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.
* GNU FreeDink 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
* .
*/
#include "Config.hpp"
#include "IOUtils.hpp"
#include
#include
#include
#include
#include
#include
#if defined _WIN32 || defined __WIN32__ || defined __CYGWIN__
#define WIN32_LEAN_AND_MEAN
#include /* registry */
#include
#endif
/**
* Singleton getter
*/
static Config* theConfig = NULL;
Config* Config::GetConfig()
{
if (theConfig == NULL)
theConfig = new Config();
return theConfig;
}
Config::Config():
// Main frame
mTrueColorValue(false),
mWindowedValue(false),
mSoundValue(true),
mJoystickValue(true),
mDebugValue(false),
mV107Value(false),
mShowIntroductionText(true),
mWarnOnEdit(true),
// Options
mShowDeveloperButtons(true),
mCloseDfarcOnPlay(false),
mWriteIniValue(true),
mOverrideDinkrefDir(false),
mSpecifiedDinkrefDir(wxEmptyString),
mDModDir(wxEmptyString),
mForceLocale(wxEmptyString)
{
/* Default value for DModDir */
mDModDir = ::wxGetHomeDir() + wxFileName::GetPathSeparator() + wxT("dmods");
mDinkExe = wxT("dink") wxT(EXEEXT);
mEditorExe = wxT("dinkedit") wxT(EXEEXT);
mSelectedDmod = GetDinkrefDir() + wxFileName::GetPathSeparator() + wxT("dink");
mwxConfig = new wxConfig(_T("dfarc3"));
mwxConfig->Read(_T("True Color"), &mTrueColorValue);
mwxConfig->Read(_T("Windowed"), &mWindowedValue);
mwxConfig->Read(_T("Sound"), &mSoundValue);
mwxConfig->Read(_T("Joystick"), &mJoystickValue);
mwxConfig->Read(_T("Debug"), &mDebugValue);
mwxConfig->Read(_T("Windowed"), &mWindowedValue);
mwxConfig->Read(_T("v1.07"), &mV107Value);
mwxConfig->Read(_T("Last Selected D-Mod"), &mSelectedDmod);
mwxConfig->Read(_T("Show Introduction"), &mShowIntroductionText);
mwxConfig->Read(_T("Warn on Edit"), &mWarnOnEdit);
// Options dialog
mwxConfig->Read(_T("Close DFArc on Play"), &mCloseDfarcOnPlay);
mwxConfig->Read(_T("Show Developer Buttons"), &mShowDeveloperButtons);
mwxConfig->Read(_T("Write Ini"), &mWriteIniValue);
mwxConfig->Read(_T("Override Dink Directory"), &mOverrideDinkrefDir);
mwxConfig->Read(_T("Specified Dink Directory"), &mSpecifiedDinkrefDir);
mwxConfig->Read(_T("Additional D-Mods Directory"), &mDModDir);
mwxConfig->Read(_T("Dink Executable"), &mDinkExe);
mwxConfig->Read(_T("Editor Executable"), &mEditorExe);
mwxConfig->Read(_T("Language"), &mForceLocale);
}
Config::~Config()
{
delete mwxConfig; // save changes on disk
}
void Config::Update()
{
// Update config
mwxConfig->Write(_T("Windowed"), mWindowedValue);
mwxConfig->Write(_T("True Color"), mTrueColorValue);
mwxConfig->Write(_T("Sound"), mSoundValue);
mwxConfig->Write(_T("Joystick"), mJoystickValue);
mwxConfig->Write(_T("Debug"), mDebugValue);
mwxConfig->Write(_T("v1.07"), mV107Value);
mwxConfig->Write(_T("Show Introduction"), mShowIntroductionText);
mwxConfig->Write(_T("Warn on Edit"), mWarnOnEdit);
// Options dialog
mwxConfig->Write(_T("Write Ini"), mWriteIniValue);
mwxConfig->Write(_T("Show Developer Buttons"), mShowDeveloperButtons);
mwxConfig->Write(_T("Close DFArc on Play"), mCloseDfarcOnPlay);
mwxConfig->Write(_T("Override Dink Directory"), mOverrideDinkrefDir);
mwxConfig->Write(_T("Specified Dink Directory"), mSpecifiedDinkrefDir);
mwxConfig->Write(_T("Additional D-Mods Directory"), mDModDir);
mwxConfig->Write(_T("Dink Executable"), mDinkExe);
mwxConfig->Write(_T("Editor Executable"), mEditorExe);
mwxConfig->Write(_T("Language"), mForceLocale);
mwxConfig->Write(_T("Last Selected D-Mod"), mSelectedDmod);
return;
}
/*-------------------*/
/*- GetDinkrefDir() -*/
/*-------------------*/
static wxString FindDefaultDinkrefDir()
{
#if defined _WIN32 || defined __WIN32__ || defined __CYGWIN__
const wxString fallback_woe_dinkdir = _T("C:/Program Files/FreeDink");
/* Just check in the same directory */
WCHAR exe_dir[MAX_PATH];
if (GetModuleFileNameW(NULL, exe_dir, sizeof(exe_dir)) < 0)
return fallback_woe_dinkdir;
wxString str(exe_dir);
return IOUtils::GetParentDir(str);
/* The rest is too complex and error-prone when there's more than
one Dink version installed, let's just skip */
if (false) {
//
// First see if it's in the registry.
//
unsigned long int iszPathSize = 512;
unsigned long int iRegType = REG_SZ;
unsigned long int liError;
unsigned char *szPath = new unsigned char[512];
HKEY hDS;
memset(szPath, 0, 512);
// Open the registry path.
liError = RegOpenKeyEx(HKEY_LOCAL_MACHINE, _T("Software\\RTSOFT\\Dink Smallwood"),
0, KEY_READ, &hDS);
// Grab the path.
while(RegQueryValueEx(hDS, _T("Path"), 0, &iRegType, szPath,
&iszPathSize) == ERROR_MORE_DATA)
{
// If the path is too small, make the buffer bigger.
iszPathSize += 512;
delete[] szPath;
szPath = new unsigned char[iszPathSize];
memset(szPath, 0, iszPathSize);
}
// Close the registry.
RegCloseKey(hDS);
if (liError == ERROR_SUCCESS && szPath[0] != '\0')
{
wxString str = szPath;
delete[] szPath;
return str;
}
//
// We don't have the registry key. See if we can use the deprecated dinksmallwood.ini file.
//
wxString strSysRoot;
wxString strBuf;
//
// Open dinksmallwood.ini
//
strSysRoot = wxGetOSDirectory() + _T("/dinksmallwood.ini");
if (!::wxFileExists(strSysRoot))
{
wxLogVerbose(_("Error: dinksmallwood.ini not found. "
"Please run the main game and try running this program again."));
return fallback_woe_dinkdir;
}
wxTextFile f_In;
if (!f_In.Open(strSysRoot))
{
wxLogVerbose(_("Error opening dinksmallwood.ini"), strSysRoot);
return fallback_woe_dinkdir;
}
// Parse
return f_In.GetLine(1);
}
# else /* !WIN32 */
// Return standard location
wxString testdir;
// pkgdatadir
testdir = wxT(DEFAULT_DATA_DIR) wxT("/dink/dink/graphics");
IOUtils::ciconvert(testdir);
if (wxDir::Exists(testdir))
return wxT(DEFAULT_DATA_DIR) wxT("/dink");
// /usr/local/share/games
testdir = wxT("/usr/local/share/games/dink/dink/graphics");
IOUtils::ciconvert(testdir);
if (wxDir::Exists(testdir))
return wxT("/usr/local/share/games/dink");
// /usr/local/share
testdir = wxT("/usr/local/share/dink/dink/graphics");
IOUtils::ciconvert(testdir);
if (wxDir::Exists(testdir))
return wxT("/usr/local/share/dink");
// /usr/share/games
testdir = wxT("/usr/local/share/dink/dink/graphics");
IOUtils::ciconvert(testdir);
if (wxDir::Exists(testdir))
return wxT("/usr/local/share/dink");
// /usr/share
return wxT("/usr/share/dink");
#endif
}
wxString Config::GetDinkrefDir()
{
if (mOverrideDinkrefDir == true)
return mSpecifiedDinkrefDir;
return FindDefaultDinkrefDir();
}
dfarc-3.12/src/InstallVerifyFrame_Base.cpp 0000755 0001750 0001751 00000004536 12420022016 015433 0000000 0000000 // -*- C++ -*-
//
// generated by wxGlade b221e052e911 on Thu Oct 16 22:01:18 2014
//
// Example for compiling a single file project under Linux using g++:
// g++ MyApp.cpp $(wx-config --libs) $(wx-config --cxxflags) -o MyApp
//
// Example for compiling a multi file project under Linux using g++:
// g++ main.cpp $(wx-config --libs) $(wx-config --cxxflags) -o MyApp Dialog1.cpp Frame1.cpp
//
#include "InstallVerifyFrame_Base.h"
// begin wxGlade: ::extracode
// end wxGlade
InstallVerifyFrame_Base::InstallVerifyFrame_Base(wxWindow* parent, int id, const wxString& title, const wxPoint& pos, const wxSize& size, long style):
wxDialog(parent, id, title, pos, size, wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER|wxTHICK_FRAME)
{
// begin wxGlade: InstallVerifyFrame_Base::InstallVerifyFrame_Base
mDmodDescription = new wxTextCtrl(this, wxID_ANY, _("Preparing..."), wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY);
const wxString mDestdirBox_choices[] = {
_("Main Dink directory"),
_("Additional D-Mods directory")
};
mDestdirBox = new wxRadioBox(this, wxID_ANY, _("Where do you want to install this D-Mod?"), wxDefaultPosition, wxDefaultSize, 2, mDestdirBox_choices, 0, wxRA_SPECIFY_ROWS);
mInstallButton = new wxButton(this, wxID_OK, _("Install"));
mCancelButton = new wxButton(this, wxID_CANCEL, wxEmptyString);
set_properties();
do_layout();
// end wxGlade
}
void InstallVerifyFrame_Base::set_properties()
{
// begin wxGlade: InstallVerifyFrame_Base::set_properties
SetTitle(_("DFArc - Install D-Mod"));
mDmodDescription->SetMinSize(wxSize(390,150));
mDestdirBox->SetSelection(0);
mInstallButton->SetFocus();
mInstallButton->SetDefault();
// end wxGlade
}
void InstallVerifyFrame_Base::do_layout()
{
// begin wxGlade: InstallVerifyFrame_Base::do_layout
wxBoxSizer* lVerticalSizer = new wxBoxSizer(wxVERTICAL);
wxBoxSizer* lHorizontalSizer = new wxBoxSizer(wxHORIZONTAL);
lVerticalSizer->Add(mDmodDescription, 1, wxLEFT|wxRIGHT|wxTOP|wxEXPAND, 5);
lVerticalSizer->Add(mDestdirBox, 0, wxEXPAND, 0);
lHorizontalSizer->Add(mInstallButton, 0, 0, 0);
lHorizontalSizer->Add(mCancelButton, 0, wxLEFT, 5);
lVerticalSizer->Add(lHorizontalSizer, 0, wxALL|wxEXPAND, 5);
SetSizer(lVerticalSizer);
lVerticalSizer->Fit(this);
Layout();
// end wxGlade
}
dfarc-3.12/src/ClientData.hpp 0000664 0001750 0001751 00000001133 12340110733 012742 0000000 0000000 // Integer wrapper class to store the DMod index associated with a
// listbox entry from mDModListBox. Previously I was abusing 'void*'
// as 'int' but g++ produces an error under amd64. If we were using
// glib, we'd use GINT_TO_POINTER(). Sadly, we're not using glib :/
// Using wxClientData as a base class to make the wxListBox
// automatically free client data when needed.
class Integer : public wxClientData
{
public:
int i;
Integer(int i) : i(i) {}
};
// Same for wxString
class ClientDataString : public wxClientData
{
public:
wxString s;
ClientDataString(wxString s) : s(s) {}
};
dfarc-3.12/bootstrap 0000775 0001750 0001751 00000002231 12341466100 011400 0000000 0000000 #!/bin/sh
# Generates ./configure, Makefile.in's and tools
# Copyright (C) 2007, 2008 Sylvain Beucler
# Copying and distribution of this file, with or without modification,
# are permitted in any medium without royalty provided the copyright
# notice and this notice are preserved.
# Stop at first error:
set -e
# Print commands:
set -x
if [ "x$1" = xclean ]; then
test ! -f Makefile || make maintainer-clean || true
# Generated by aclocal.
rm -f aclocal.m4
# Generated by autoheader.
rm -f config.h.in
# Generated by autoconf.
rm -f configure
rm -rf autom4te.cache/
# Generated or brought in by automake.
find -name "Makefile.in" | xargs -r rm
find autotools/ -type l | xargs -r rm
rm -f INSTALL
# Generated or brought in by intltoolize
rm -f po/Makefile.in.in
exit
fi
# Enable no-portability to disable GNU make extensions warnings, such as $(shell)
#if autoreconf --install --symlink --warnings=all --warnings=no-portability $*
if autoreconf --install --symlink --warnings=all $* && intltoolize --force
then echo "You now can run ./configure"
else echo "*** Error: please check the messages above. ***"
fi
dfarc-3.12/README.txt 0000664 0001750 0001751 00000002263 12420023266 011140 0000000 0000000 DFArc - An integrated frontend, .dmod installer and .dmod archiver for
the Dink Smallwood game engine
DFArc is free software, and you are welcome to redistribute it under
certain conditions; see the GNU GPL for details.
( cf. COPYING and http://gnu.org/licenses/gpl.html )
DFArc was written by Andrew Reading and tweaked by Dan Walma and
Sylvain Beucler.
Send e-mail to bug-freedink@gnu.org for comments, bug reports, or just
to say hi!
Building
--------
If you are compiling DFArc from sources, check BUILD for instructions.
About GNU
---------
FreeDink is part of the GNU project, whose aim is to create "GNU", a
completely free (as in freedom) operating system. Its most famous
variant these days is GNU/Linux. A engine to play the Dink Smallwood
game and D-Mods is definitely a must for the GNU OS ;) Check
http://www.gnu.org/ for more information.
Technical information
---------------------
Check the 'doc' directory for technical/developer considerations.
---
Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
notice and this notice are preserved.
dfarc-3.12/ChangeLog 0000664 0001750 0001751 00000141445 12420023200 011206 0000000 0000000 2014-10-16 Sylvain Beucler
* freedink-dfarc.spec: rpm: minor rpmlint'ing
2014-10-16 Sylvain Beucler
* NEWS, configure.ac, doc/release.txt: Start branch 3.12
2014-10-16 Sylvain Beucler
* src/DFArcApp.cpp: Fix 'make distcheck'
2014-10-16 Sylvain Beucler
* freedink-dfarc.spec: rpm: upgrade to wxWidgets3 + clean-up
2014-10-16 Sylvain Beucler
* BUILD: Update build documentation
2014-10-16 Sylvain Beucler
* debian/changelog, share/freedink-dfarc.desktop.in: Add %f in
.desktop file (fixes lintian desktop-mime-but-no-exec-code)
2014-10-16 Sylvain Beucler
* NEWS: Update NEWS
2014-10-15 Sylvain Beucler
* src/BZip.cpp, src/Tar.cpp: Use decent I/O buffers everywhere
2014-10-15 Sylvain Beucler
* src/BZip.cpp: Sync code from bzip2 just in case (no changes)
2014-10-15 Sylvain Beucler
* src/Tar.cpp: Indent
2014-10-15 Sylvain Beucler
* autobuild/dfarc-exe-mxe.sh: autobuild: minor tweaks
2014-10-15 Sylvain Beucler
* src/Package.cpp: Re-enable elapsed time for the packaging dialog
on woe
2014-10-15 Sylvain Beucler
* THANKS: THANKS scratcher for beta-testing
2014-10-15 Sylvain Beucler
* autobuild/dfarc-exe-mxe.sh: autobuild: dfarc-exe-mxe.sh is now
automated and tested
2014-10-15 Sylvain Beucler
* src/DFArcApp.cpp, src/DFArcFrame.cpp, src/InstallVerifyFrame.cpp,
src/InstallVerifyFrame.hpp, src/Tar.cpp: Have wxWidgets properly
quit by allocating dialogs in the heap + simplify InstallVerifyFrame
2014-10-15 Sylvain Beucler
* src/BZip.cpp, src/BZip.hpp, src/DFile.cpp, src/DFile.hpp: Work on
const filenames
2014-10-13 Sylvain Beucler
* Makefile.am, autobuild/dfarc-exe-mxe.sh: build: document
compilation with mxe
2014-10-13 Sylvain Beucler
* NEWS, src/DFArcFrame.cpp: Fix off-by-1-pixel in logo animation,
with rounding
2014-10-13 Sylvain Beucler
* src/DFArcFrame.cpp: Launch Dinkedit asynchronously
2014-10-12 Sylvain Beucler
* NEWS, src/DFArcFrame.cpp: Launch Dink asynchronously
2014-10-08 Sylvain Beucler
* src/DFArcFrame.cpp: Prepared modified environment for Dink rather
than modifying DFArc's
2014-10-08 Sylvain Beucler
* src/DFArcFrame.cpp: Remove redundant warning when wxExecute fails
on woe
2014-10-08 Sylvain Beucler
* src/DFArcFrame.cpp: Remove wxExecute Unix-specific work-around:
return code is consistent now
2014-10-08 Sylvain Beucler
* DEB: doc: debian/ is included in releases now
2014-10-07 Sylvain Beucler
* po/hu.po, po/sr.po: Sync translations
2014-10-07 Sylvain Beucler
* doc/release.txt: rpm: update doc URL
2014-10-05 Sylvain Beucler
* freedink-dfarc.spec: rpm: attempt to tidy post-install scriptlets
2014-10-05 Sylvain Beucler
* freedink-dfarc.spec: rpm: sync with Fedora
2014-09-06 Sylvain Beucler
* po/nl.po: Sync TP
2014-09-05 Sylvain Beucler
* po/pl.po: Sync TP
2014-09-02 Sylvain Beucler
* doc/release.txt: release: update doc
2014-09-02 Sylvain Beucler
* po/da.po, po/de.po, po/eo.po, po/fr.po, po/vi.po: Sync TP
2014-09-01 Sylvain Beucler
* .gitignore, po/.gitignore, src/.gitignore: Update .gitignore
2014-09-01 Sylvain Beucler
* doc/release.txt: doc: update release process
2014-09-01 Sylvain Beucler
* src/DFArcFrame.cpp: Fix typo
2014-09-01 Sylvain Beucler
* debian/watch: debian: simplify watch file
2014-09-01 Sylvain Beucler
* debian/changelog, debian/rules: debian: disable silent rules
2014-09-01 Sylvain Beucler
* debian/changelog, debian/control: debian: fix
extended-description-is-probably-too-short
2014-09-01 Sylvain Beucler
* configure.ac, debian/.gitignore, debian/README.source,
debian/dfarc.xpm, debian/freedink-dfarc.lintian-overrides,
debian/gbp.conf, debian/install, debian/menu,
debian/update-autotools-config.sh, share/Makefile.am: packaging:
drop obsolete stuff
2014-09-01 Sylvain Beucler
* Makefile.am, debian/changelog, debian/control, debian/copyright,
doc/release.txt: Prepare snapshot release for Debian
2014-08-31 Sylvain Beucler
* BUILD, configure.ac, debian/control, src/BZip.cpp,
src/Config.cpp, src/DFArcFrame.cpp, src/DFArcFrame_Base.wxg,
src/InstallVerifyFrame.cpp, src/InstallVerifyFrame_Base.wxg,
src/Makefile.am, src/Options.cpp, src/Options_Base.wxg,
src/Package.cpp, src/Package_Base.wxg, src/RecursiveDelete.cpp,
src/Tar.cpp, src/Tar.hpp: Upgrade to wxWidgets 3.0 Unicode
2014-06-30 Sylvain Beucler
* AUTHORS, NEWS, debian/copyright, po/LINGUAS, po/hu.po: New
Hungarian translation
2014-06-30 Sylvain Beucler
* BUILD: More doc on wxGlade
2014-06-26 Sylvain Beucler
* doc/release.txt: fedora: update URL
2014-06-26 Sylvain Beucler
* bootstrap: intltool: remove work-around for v0.40
2014-05-29 Sylvain Beucler
* debian/changelog, debian/compat, debian/control, debian/rules:
debian: update packaging with DH9
2014-05-29 Sylvain Beucler
* doc/git2cl.txt: git2cl is now packaged and easier to use - drop
documentation
2014-05-27 Sylvain Beucler
* po/LINGUAS: translations: enable new translations
2014-05-27 Sylvain Beucler
* doc/release.txt: Clarify versioning rationale
2014-05-24 Sylvain Beucler
* BUILD: Document build issue with newer wxGlade
2014-05-24 Sylvain Beucler
* AUTHORS, NEWS, doc/release.txt, po/eo.po, po/fr.po, po/pt_BR.po:
Sync translations with TP
2012-12-09 Sylvain Beucler
* doc/release.txt: Use pbuilder when building a Debian package to
upload officially
2012-12-09 Sylvain Beucler
* doc/release.txt: Update Fedora Git URL
2012-12-09 Sylvain Beucler
* po/hr.po: Update Croatian translation
2012-12-09 Sylvain Beucler
* AUTHORS: This is DFArc, not FreeDink, so remove references to
'engine strings'
2012-10-14 Sylvain Beucler
* AUTHORS, NEWS, debian/copyright, po/LINGUAS, po/ca.po, po/tr.po:
New Catalan and Turkish translations
2012-05-19 Sylvain Beucler
* AUTHORS, NEWS, debian/copyright, po/LINGUAS, po/sr.po: Add Serbian
translation
2012-04-27 Sylvain Beucler
* NEWS, configure.ac: Merge v3.10
2012-04-27 Sylvain Beucler
* ChangeLog, configure.ac, doc/release.txt, freedink-dfarc.spec:
Release 3.10
2012-04-27 Sylvain Beucler
* debian/changelog, debian/compat, debian/control,
debian/copyright, debian/rules, debian/source.lintian-overrides,
debian/source/format: Update Debian packaging
2012-04-27 Sylvain Beucler
* AUTHORS, NEWS, po/LINGUAS, po/hr.po, po/vi.po: Update translations
2011-07-25 Sylvain Beucler
* doc/release.txt: Fix Fedora package URL
2010-12-26 Sylvain Beucler
* NEWS, po/fi.po, po/nl.po: Updated Dutch and Finnish translations.
2010-11-14 Sylvain Beucler
* NEWS, configure.ac: Merged 3.8.1
2010-11-14 Sylvain Beucler
* ChangeLog, NEWS, configure.ac, debian/changelog,
freedink-dfarc.spec: Release 3.8.1
2010-11-14 Sylvain Beucler
* NEWS: Update NEWS
2010-11-14 Sylvain Beucler
* doc/release.txt, src/Makefile.am: Sync doc fixes from FreeDink
2010-11-07 Sylvain Beucler
* doc/md5.txt: Document MD5 checksums for non-FreeDink dink.exe
2010-11-07 Sylvain Beucler
* src/Options.cpp: Search for dink* executable case-INsensitively
2010-11-06 Sylvain Beucler
* src/DFArcFrame.cpp: Remove old rectangle drawing test
2010-11-01 Sylvain Beucler
* freedink-dfarc.spec: Remove old reference to v2 in the .spec file
2010-10-31 Sylvain Beucler
* NEWS: Update NEWS
2010-10-31 Sylvain Beucler
* AUTHORS, debian/copyright, po/LINGUAS, po/nl.po: Add updated Dutch
translation - I forgot to include the first one I had gotten in
February :/
2010-10-31 Sylvain Beucler
* po/pl.po: Update Polish translation
2010-10-30 Sylvain Beucler
* po/it.po: Sync Italian translation
2010-10-30 Sylvain Beucler
* autobuild/dfarc-debs.sh, autobuild/dfarc-exe.sh,
autobuild/dfarc-snapshot.sh, debian/changelog, debian/control,
doc/release.txt: Release doc + sync autobuild scripts
2010-10-28 Sylvain Beucler
* NEWS, configure.ac, doc/release.txt: Start v3.9
2010-10-28 Sylvain Beucler
* ChangeLog, NEWS, configure.ac, debian/changelog, debian/control,
doc/release.txt, freedink-dfarc.spec: Release 3.8
2010-10-28 Sylvain Beucler
* doc/release.txt: Update release doc
2010-10-28 Sylvain Beucler
* src/DFArcFrame.cpp: Don't fallback to system language on error
2010-10-28 Sylvain Beucler
* po/da.po: Update Danish translation (again)
2010-10-26 Sylvain Beucler
* po/da.po: Update Danish translation
2010-10-25 Sylvain Beucler
* AUTHORS, po/de.po, po/es.po, po/it.po: Update translations from
the TP
2010-10-24 Sylvain Beucler
* po/fr.po: Update French translation
2010-10-24 Sylvain Beucler
* debian/README.source, debian/changelog, debian/control,
debian/copyright, debian/watch: Debian sync
2010-10-24 Sylvain Beucler
* src/DFArcFrame.cpp: install_locales -> installed_locales
2010-10-24 Sylvain Beucler
* src/DFArcFrame.cpp: Try to find a working locale by different
means under Unix
2010-10-24 Sylvain Beucler
* doc/cross.txt, src/DFArcFrame.cpp: Make sure the 'l10n' dir exists
before searching it (warnings under woe)
2010-10-24 Sylvain Beucler
* src/DFArcFrame.cpp: Only search 'l10n' for .mo files, not the
whole D-Mod (bugfix)
2010-10-24 Sylvain Beucler
* po/fr.po, src/Options.cpp: Update French translation
2010-10-24 Sylvain Beucler
* doc/mingw-cross-env.txt, doc/unicode.txt, src/DFArcFrame.cpp: More
notes on mingw-cross-env
2010-10-24 Sylvain Beucler
* NEWS, src/Config.cpp, src/DFArcFrame.cpp, src/Options_Base.wxg:
Simplify translation selection; fix editor warning
2010-10-23 Sylvain Beucler
* NEWS, configure.ac, src/Makefile.am: distcheck: declare new source
file ClientData.hpp
2010-10-23 Sylvain Beucler
* NEWS, src/ClientData.hpp, src/DFArcApp.cpp, src/DFArcFrame.cpp,
src/DFArcFrame.hpp, src/DFArcFrame_Base.wxg, src/Options.cpp,
src/Options_Base.wxg: D-Mod language selection
2010-10-23 Sylvain Beucler
* src/DFArcFrame.cpp, src/DFArcFrame_Base.wxg: Add
non-functional-yet translation selection button
2010-10-23 Sylvain Beucler
* doc/release.txt, src/DFArcApp.cpp, src/Options.cpp: Fix language
setting
2010-10-23 Sylvain Beucler
* src/Makefile.am: Don't use --best with upx, too slow and not much
more efficient
2010-10-23 Sylvain Beucler
* NEWS, src/Config.cpp, src/DFArcApp.cpp, src/Options.cpp,
src/Options.hpp, src/Options_Base.wxg: Improve DFArc language
selection presentation + make it work under woe + show dev buttons
by default
2010-10-23 Sylvain Beucler
* .gitignore, doc/animation.txt, src/DFArcFrame.cpp: Document
animation method
2010-10-23 Sylvain Beucler
* src/DFArcFrame.cpp: Fix animation speed under woe
2010-10-23 Sylvain Beucler
* doc/cross.txt, doc/mingw-cross-env.txt: Update build instructions
and test mingw-cross-env
2010-10-22 Sylvain Beucler
* src/DFArcFrame.hpp, src/Options.cpp: Update code copyright notices
2010-10-22 Sylvain Beucler
* AUTHORS, debian/copyright: Update copyright notices for
translations
2010-10-22 Sylvain Beucler
* NEWS, po/it.po: Updated Italian translation
2010-10-21 Sylvain Beucler
* src/DFArcFrame.cpp: Document bug in wx text sizing
2010-10-21 Sylvain Beucler
* NEWS, src/DFArcFrame.cpp: Use easing to smooth logo animation
2010-10-21 Sylvain Beucler
* src/DFArcFrame.cpp, src/DFArcFrame.hpp, src/DFArcFrame_Base.wxg:
Basic for new D-Mod logo animation
2010-10-12 Sylvain Beucler
* src/Options.cpp: Add Greek to the choice of available languages
(there's a new Greek translation for the game engine)
2010-10-10 Sylvain Beucler
* po/es.po: Update Spanish translation
2010-07-29 Sylvain Beucler
* BUILD: Bumb wxwidgets version in BUILD instructions
2010-05-23 Sylvain Beucler
* NEWS: Typo
2010-05-23 Sylvain Beucler
* NEWS, configure.ac, debian/copyright, src/DFArcFrame.cpp: Remove
wxWidgets 2.6 compatibility code
2010-04-28 Sylvain Beucler
* .gitignore, NEWS, doc/locales.txt, exp/.gitignore,
exp/exec/.gitignore, exp/lang/test.c, po/fr.po, src/Config.cpp,
src/Config.hpp, src/DFArcApp.cpp, src/Options.cpp,
src/Options_Base.wxg: Language selection
2010-04-27 Sylvain Beucler
* NEWS, exp/exec/.gitignore, exp/exec/compile.sh,
exp/exec/exectest.cpp, exp/exec/exit_failure.c, exp/exec/false.c,
exp/exec/results.txt, exp/exec/segfault.c, exp/exec/sleep.c,
src/DFArcFrame.cpp: Handle Dink segfault
2010-04-27 Sylvain Beucler
* po/da.po: Update da.po
2010-03-22 Sylvain Beucler
* po/it.po, po/mk.po: Sync TP .po files
2010-03-21 Sylvain Beucler
* doc/release.txt: .zip are preferrable over .tar.gz at the DN
2010-03-06 Sylvain Beucler
* po/vi.po: Sync Vietnamese translation (version dump, no string
update)
2010-03-06 Sylvain Beucler
* AUTHORS, debian/copyright, po/pl.po: Update Polish translation
2010-03-02 Sylvain Beucler
* AUTHORS, debian/copyright, po/fi.po: Update Finnish translation
2010-02-21 Sylvain Beucler
* ChangeLog, NEWS, autobuild/dfarc-debs.sh, autobuild/dfarc-exe.sh,
autobuild/dfarc-snapshot.sh, configure.ac, debian/copyright,
doc/release.txt, freedink-dfarc.spec: Release 3.6
2010-02-21 Sylvain Beucler
* debian/BUILD, debian/README.source, debian/changelog,
debian/copyright, debian/gbp.conf, debian/rules: Sync debian/
2010-02-21 Sylvain Beucler
* TRANSLATIONS.txt: Mention the TP in instructions for translators
2010-02-21 Sylvain Beucler
* po/de.po, po/vi.po: Update German and Vietnamese translations
2010-01-10 Sylvain Beucler
* po/da.po: Update Danish translation
2010-01-07 Sylvain Beucler
* po/fr.po: Import fr.po from TP
2010-01-07 Sylvain Beucler
* NEWS, configure.ac: Prepare configure.ac/NEWS file for snapshots
2010-01-06 Sylvain Beucler
* NEWS: Prepare NEWS file for snapshots
2010-01-06 Sylvain Beucler
* AUTHORS, debian/copyright, po/LINGUAS, po/da.po, po/de.po,
po/es.po, po/fi.po, po/fr.po, po/it.po, po/mk.po, po/pl.po,
po/vi.po, src/DFArcFrame.cpp: Add new translations; remove
misleading reference to 'included D-Mod'
2009-09-30 Sylvain Beucler
* doc/release.txt: Add more contact URLs for releases
2009-09-19 Sylvain Beucler
* doc/release.txt: Fix release symlinking
2009-09-18 Sylvain Beucler
* autobuild/dfarc-debs.sh, autobuild/dfarc-exe.sh,
autobuild/dfarc-rpms.sh, autobuild/dfarc-snapshot.sh: Sync autobuild
scripts
2009-09-18 Sylvain Beucler
* src/Config.cpp, src/DFArcFrame.cpp: Update copyright notices
2009-09-18 Sylvain Beucler
* ChangeLog, NEWS, configure.ac, freedink-dfarc.spec: Release 3.4
2009-09-17 Sylvain Beucler
* doc/cross.txt: Update cross-compilation instructions: stripping
2009-09-17 Sylvain Beucler
* doc/release.txt: Document version scheme
2009-09-17 Sylvain Beucler
* share/Makefile.am: Add a man page link for 'freedink-dfarc'
2009-09-17 Sylvain Beucler
* debian/control, share/man/man1/freedink-dfarc.1: Bump Debian
Standards-Version
2009-09-16 Sylvain Beucler
* ChangeLog, NEWS, configure.ac, debian/changelog,
freedink-dfarc.spec: Release 3.2.4
2009-09-16 Sylvain Beucler
* doc/release.txt: Fix copy/paste from freedink-data in the release
instructions
2009-08-30 Sylvain Beucler
* NEWS, doc/cross.txt, src/Config.cpp: look for dink in the .exe dir
rather than the registry or dinksmallwood.ini
2009-07-17 me
* BUILD, README, configure.ac, src/Makefile.am: Add 'freedink-dfarc'
symlink for command-line users to know about dfarc
2009-07-10 Sylvain Beucler
* doc/release.txt: More release instructions precisions
2009-07-10 Sylvain Beucler
* AUTHORS, THANKS, doc/release.txt: Release 3.2.3 (fix
AUTHORS/THANKS)
2009-07-10 Sylvain Beucler
* ChangeLog, NEWS, configure.ac, doc/release.txt,
freedink-dfarc.spec: Release 3.2.3
2009-07-10 Sylvain Beucler
* po/LINGUAS, po/de.po: New German translation from Michael Skiba
2009-07-06 Sylvain Beucler
* doc/release.txt: Improve release instructions
2009-07-02 Sylvain Beucler
* po/fi.po: Import fixes for the Finnish translation
2009-07-02 Sylvain Beucler
* doc/release.txt: Import debian from this repo before working on
packaging a new release
2009-06-23 Sylvain Beucler
* debian/changelog, debian/control, debian/copyright,
debian/freedink-dfarc.lintian-overrides, debian/rules,
debian/source.lintian-overrides, doc/release.txt: Sync debian/
2009-06-21 Sylvain Beucler
* doc/release.txt, freedink-dfarc.spec: Fedora sync
2009-06-21 Sylvain Beucler
* doc/release.txt: Update release instructions
2009-06-21 Sylvain Beucler
* configure.ac: Proper validation of ./configure's variable
2009-06-03 Sylvain Beucler
* ChangeLog, Makefile.am, NEWS, configure.ac, doc/release.txt,
freedink-dfarc.spec: Release 3.2.2
2009-06-03 Sylvain Beucler
* share/Makefile.am: s/datadir/datarootdir/ for .desktop and pixmap
files, so it's installed properly in /usr/share even when compiled
with Debian's --datadir=/usr/share/games
2009-03-15 Sylvain Beucler
* po/fi.po: Update DFArc Finnish translation from the TP
2009-02-09 Sylvain Beucler
* po/fr.po: Adapt fr.po declared package name to domain name (lint)
2009-02-09 Sylvain Beucler
* src/woeres.rc.in: Bundle more precise version information in
.exe's
2009-01-25 Sylvain Beucler
* po/fr.po: A couple changes in fr.po to please the Translation
Project robot
2009-01-20 Sylvain Beucler
* autobuild/dfarc-debs.sh, autobuild/dfarc-exe.sh,
autobuild/dfarc-rpms.sh, autobuild/dfarc-snapshot.sh: Include some
scripts used to build snapshots and binary packages unattended
2008-12-28 Sylvain Beucler
* : commit 50606a440ffa64e736c67f4b82c6d478c6e92201 Author: Sylvain
Beucler Date: Sun Dec 28 22:30:03 2008 +0100
2008-12-28 Sylvain Beucler
* po/fr.po: Fix accelerators in French translation
2008-12-28 Sylvain Beucler
* po/fr.po: French translation fixes
2008-12-28 Sylvain Beucler
* : commit b0ec1af7d9fd64efed0c832e94a54ce90d1ec8c6 Author: Sylvain
Beucler