2007-03-27 17:47:10 +00:00
|
|
|
/*
|
|
|
|
* CiderPress
|
|
|
|
* Copyright (C) 2007 by faddenSoft, LLC. All Rights Reserved.
|
|
|
|
* See the file LICENSE for distribution terms.
|
|
|
|
*/
|
|
|
|
/*
|
|
|
|
* Application UI classes.
|
|
|
|
*/
|
Large set of changes to restore CiderPress build.
CiderPress and MDC now compile, and execute far enough to open
their respective "about" boxes, but I doubt they'll do much
more than that.
* Switch from MBCS to UNICODE APIs
Microsoft switched to UTF-16 (by way of UCS-2) a long time ago,
and the support for MBCS seems to be getting phased out. So it's
time to switch to wide strings.
This is a bit awkward for CiderPress because it works with disk
and file archives with 8-bit filenames, and I want NufxLib and
DiskImgLib to continue to work on Linux (which has largely taken
the UTF-8 approach to Unicode). The libraries will continue to
work with 8-bit filenames, with CiderPress/MDC doing the
conversion at the appropriate point.
There were a couple of places where strings from a structure
handed back by one of the libraries were used directly in the UI,
or vice-versa, which is a problem because we have nowhere to
store the result of the conversion. These currently have fixed
place-holder "xyzzy" strings.
All UI strings are now wide.
Various format strings now use "%ls" and "%hs" to explicitly
specify wide and narrow. This doesn't play well with gcc, so
only the Windows-specific parts use those.
* Various updates to vcxproj files
The project-file conversion had some cruft that is now largely
gone. The build now has a common output directory for the EXEs
and libraries, avoiding the old post-build copy steps.
* Added zlib 1.2.8 and nufxlib 2.2.2 source snapshots
The old "prebuilts" directory is now gone. The libraries are now
built as part of building the apps.
I added a minimal set of files for zlib, and a full set for nufxlib.
The Linux-specific nufxlib goodies are included for the benefit of
the Linux utilities, which are currently broken (don't build).
* Replace symbols used for include guards
Symbols with a leading "__" are reserved.
2014-11-10 23:32:55 +00:00
|
|
|
#ifndef APP_MAIN_H
|
|
|
|
#define APP_MAIN_H
|
2007-03-27 17:47:10 +00:00
|
|
|
|
|
|
|
#include "ContentList.h"
|
|
|
|
#include "GenericArchive.h"
|
|
|
|
#include "PrefsDialog.h"
|
|
|
|
#include "ActionProgressDialog.h"
|
|
|
|
#include "ProgressCounterDialog.h"
|
|
|
|
#include "AddFilesDialog.h"
|
|
|
|
#include "ExtractOptionsDialog.h"
|
|
|
|
#include "ConvFileOptionsDialog.h"
|
|
|
|
#include "DiskConvertDialog.h"
|
|
|
|
#include "FileNameConv.h"
|
|
|
|
//#include "ProgressCancelDialog.h"
|
|
|
|
|
|
|
|
/* user-defined window messages */
|
2014-11-04 00:26:53 +00:00
|
|
|
#define WMU_LATE_INIT (WM_USER+0)
|
|
|
|
#define WMU_START (WM_USER+1) // used by ActionProgressDialog
|
2007-03-27 17:47:10 +00:00
|
|
|
|
2015-01-14 06:08:58 +00:00
|
|
|
// The filter index is saved in the registry, so if you reorder this list
|
|
|
|
// you will briefly annoy existing users.
|
2015-01-12 07:02:35 +00:00
|
|
|
enum FilterIndex {
|
2015-01-13 23:54:10 +00:00
|
|
|
kFilterIndexFIRST = 1, // first index, must be non-Generic
|
2014-11-04 00:26:53 +00:00
|
|
|
kFilterIndexNuFX = 1,
|
|
|
|
kFilterIndexBinaryII = 2,
|
|
|
|
kFilterIndexACU = 3,
|
2015-01-12 07:02:35 +00:00
|
|
|
kFilterIndexAppleSingle = 4,
|
|
|
|
kFilterIndexDiskImage = 5,
|
2015-01-14 06:08:58 +00:00
|
|
|
kFilterIndexLASTNG = 5, // last non-Generic index
|
2015-01-13 23:54:10 +00:00
|
|
|
|
|
|
|
kFilterIndexGeneric = 6, // *.* filter used
|
|
|
|
kFilterIndexMAX = 6 // highest valid number
|
2015-01-12 07:02:35 +00:00
|
|
|
};
|
2007-03-27 17:47:10 +00:00
|
|
|
|
2014-11-04 00:26:53 +00:00
|
|
|
struct FileCollectionEntry; // fwd
|
2007-03-27 17:47:10 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* The main UI window.
|
|
|
|
*/
|
|
|
|
class MainWindow : public CFrameWnd
|
|
|
|
{
|
|
|
|
public:
|
2014-11-04 00:26:53 +00:00
|
|
|
MainWindow(void);
|
|
|
|
~MainWindow(void);
|
|
|
|
|
2014-11-21 21:18:20 +00:00
|
|
|
/*
|
|
|
|
* Override the pre-create function to tweak the window style.
|
|
|
|
*/
|
2021-05-10 21:04:50 +00:00
|
|
|
virtual BOOL PreCreateWindow(CREATESTRUCT& cs) override;
|
2014-11-21 21:18:20 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Override GetClientRect so we can factor in the status and tool bars.
|
|
|
|
*
|
|
|
|
* (The method in question isn't declared virtual, so we're not actually
|
|
|
|
* overriding it.)
|
|
|
|
*/
|
2014-11-04 00:26:53 +00:00
|
|
|
void GetClientRect(LPRECT lpRect) const;
|
|
|
|
|
|
|
|
// get a pointer to the preferences
|
|
|
|
const Preferences* GetPreferences(void) const { return &fPreferences; }
|
|
|
|
Preferences* GetPreferencesWr(void) { return &fPreferences; }
|
|
|
|
// apply an update from the Preferences pages
|
|
|
|
void ApplyNow(PrefsSheet*);
|
|
|
|
|
|
|
|
// get the text of the next file in the selection list
|
2021-05-10 01:17:49 +00:00
|
|
|
//int GetPrevFileText(ReformatHolder* pHolder, CString* pTitle);
|
|
|
|
//int GetNextFileText(ReformatHolder* pHolder, CString* pTitle);
|
2014-11-04 00:26:53 +00:00
|
|
|
|
|
|
|
// update the progress meter
|
|
|
|
void SetProgressBegin(void);
|
Large set of changes to restore CiderPress build.
CiderPress and MDC now compile, and execute far enough to open
their respective "about" boxes, but I doubt they'll do much
more than that.
* Switch from MBCS to UNICODE APIs
Microsoft switched to UTF-16 (by way of UCS-2) a long time ago,
and the support for MBCS seems to be getting phased out. So it's
time to switch to wide strings.
This is a bit awkward for CiderPress because it works with disk
and file archives with 8-bit filenames, and I want NufxLib and
DiskImgLib to continue to work on Linux (which has largely taken
the UTF-8 approach to Unicode). The libraries will continue to
work with 8-bit filenames, with CiderPress/MDC doing the
conversion at the appropriate point.
There were a couple of places where strings from a structure
handed back by one of the libraries were used directly in the UI,
or vice-versa, which is a problem because we have nowhere to
store the result of the conversion. These currently have fixed
place-holder "xyzzy" strings.
All UI strings are now wide.
Various format strings now use "%ls" and "%hs" to explicitly
specify wide and narrow. This doesn't play well with gcc, so
only the Windows-specific parts use those.
* Various updates to vcxproj files
The project-file conversion had some cruft that is now largely
gone. The build now has a common output directory for the EXEs
and libraries, avoiding the old post-build copy steps.
* Added zlib 1.2.8 and nufxlib 2.2.2 source snapshots
The old "prebuilts" directory is now gone. The libraries are now
built as part of building the apps.
I added a minimal set of files for zlib, and a full set for nufxlib.
The Linux-specific nufxlib goodies are included for the benefit of
the Linux utilities, which are currently broken (don't build).
* Replace symbols used for include guards
Symbols with a leading "__" are reserved.
2014-11-10 23:32:55 +00:00
|
|
|
int SetProgressUpdate(int percent, const WCHAR* oldName,
|
|
|
|
const WCHAR* newName);
|
2014-11-04 00:26:53 +00:00
|
|
|
void SetProgressEnd(void);
|
|
|
|
|
2014-11-21 21:18:20 +00:00
|
|
|
/*
|
|
|
|
* Set a number in the "progress counter". Useful for loading large archives
|
|
|
|
* where we're not sure how much stuff is left, so showing a percentage is
|
|
|
|
* hard.
|
|
|
|
*
|
|
|
|
* Pass in -1 to erase the counter.
|
|
|
|
*
|
|
|
|
* Returns "true" if we'd like things to continue.
|
|
|
|
*/
|
Large set of changes to restore CiderPress build.
CiderPress and MDC now compile, and execute far enough to open
their respective "about" boxes, but I doubt they'll do much
more than that.
* Switch from MBCS to UNICODE APIs
Microsoft switched to UTF-16 (by way of UCS-2) a long time ago,
and the support for MBCS seems to be getting phased out. So it's
time to switch to wide strings.
This is a bit awkward for CiderPress because it works with disk
and file archives with 8-bit filenames, and I want NufxLib and
DiskImgLib to continue to work on Linux (which has largely taken
the UTF-8 approach to Unicode). The libraries will continue to
work with 8-bit filenames, with CiderPress/MDC doing the
conversion at the appropriate point.
There were a couple of places where strings from a structure
handed back by one of the libraries were used directly in the UI,
or vice-versa, which is a problem because we have nowhere to
store the result of the conversion. These currently have fixed
place-holder "xyzzy" strings.
All UI strings are now wide.
Various format strings now use "%ls" and "%hs" to explicitly
specify wide and narrow. This doesn't play well with gcc, so
only the Windows-specific parts use those.
* Various updates to vcxproj files
The project-file conversion had some cruft that is now largely
gone. The build now has a common output directory for the EXEs
and libraries, avoiding the old post-build copy steps.
* Added zlib 1.2.8 and nufxlib 2.2.2 source snapshots
The old "prebuilts" directory is now gone. The libraries are now
built as part of building the apps.
I added a minimal set of files for zlib, and a full set for nufxlib.
The Linux-specific nufxlib goodies are included for the benefit of
the Linux utilities, which are currently broken (don't build).
* Replace symbols used for include guards
Symbols with a leading "__" are reserved.
2014-11-10 23:32:55 +00:00
|
|
|
bool SetProgressCounter(const WCHAR* fmt, long val);
|
2014-11-04 00:26:53 +00:00
|
|
|
|
2014-11-21 21:18:20 +00:00
|
|
|
/*
|
|
|
|
* Handle a double-click in the content view.
|
|
|
|
*
|
|
|
|
* Individual items get special treatment, multiple items just get handed off
|
|
|
|
* to the file viewer.
|
|
|
|
*/
|
2014-11-04 00:26:53 +00:00
|
|
|
void HandleDoubleClick(void);
|
|
|
|
|
|
|
|
// do some idle processing
|
|
|
|
void DoIdle(void);
|
|
|
|
|
2014-11-21 21:18:20 +00:00
|
|
|
/*
|
|
|
|
* Come up with a title to put at the top of a printout. This is essentially
|
|
|
|
* the same as the window title, but without some flags (e.g. "read-only").
|
|
|
|
*/
|
2014-11-04 00:26:53 +00:00
|
|
|
CString GetPrintTitle(void);
|
|
|
|
|
|
|
|
// raise flag to abort the current print job
|
|
|
|
void SetAbortPrinting(bool val) { fAbortPrinting = val; }
|
|
|
|
bool GetAbortPrinting(void) const { return fAbortPrinting; }
|
2014-11-21 21:18:20 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Printer abort procedure; allows us to abort a print job. The DC
|
|
|
|
* SetAbortProc() function calls here periodically. The return value from
|
|
|
|
* this function determine whether or not printing halts.
|
|
|
|
*
|
|
|
|
* This checks a global "print cancel" variable, which is set by our print
|
|
|
|
* cancel button dialog.
|
|
|
|
*
|
|
|
|
* If this returns TRUE, printing continues; FALSE, and printing aborts.
|
|
|
|
*/
|
2014-11-04 00:26:53 +00:00
|
|
|
static BOOL CALLBACK PrintAbortProc(HDC hDC, int nCode);
|
2014-11-21 21:18:20 +00:00
|
|
|
|
2014-11-04 00:26:53 +00:00
|
|
|
bool fAbortPrinting;
|
|
|
|
// track printer choice
|
|
|
|
HANDLE fhDevMode;
|
|
|
|
HANDLE fhDevNames;
|
|
|
|
|
|
|
|
// set flag to abort current operation
|
|
|
|
//void SetAbortOperation(bool val) { fAbortOperation = val; }
|
|
|
|
//bool fAbortOperation;
|
|
|
|
|
2014-11-21 21:18:20 +00:00
|
|
|
/*
|
|
|
|
* Go to sleep for a little bit, waking up 100x per second to check
|
|
|
|
* the idle loop. Used for debugging.
|
|
|
|
*/
|
2014-11-04 00:26:53 +00:00
|
|
|
void EventPause(int duration);
|
|
|
|
|
|
|
|
ContentList* GetContentList(void) const { return fpContentList; }
|
|
|
|
|
|
|
|
void SetActionProgressDialog(ActionProgressDialog* pActionProgress) {
|
|
|
|
fpActionProgress = pActionProgress;
|
|
|
|
}
|
|
|
|
void SetProgressCounterDialog(ProgressCounterDialog* pProgressCounter) {
|
|
|
|
fpProgressCounter = pProgressCounter;
|
|
|
|
}
|
|
|
|
GenericArchive* GetOpenArchive(void) const { return fpOpenArchive; }
|
|
|
|
|
2014-11-21 21:18:20 +00:00
|
|
|
/*
|
|
|
|
* Extract every part of the file into "ReformatHolder". Does not try to
|
|
|
|
* reformat anything, just extracts the parts.
|
|
|
|
*
|
|
|
|
* Returns IDOK on success, IDCANCEL if the user cancelled, or -1 on error.
|
|
|
|
* On error, the reformatted text buffer gets the error message.
|
|
|
|
*/
|
2014-11-04 00:26:53 +00:00
|
|
|
int GetFileParts(const GenericEntry* pEntry,
|
|
|
|
ReformatHolder** ppHolder) const;
|
|
|
|
|
2014-11-21 21:18:20 +00:00
|
|
|
/*
|
|
|
|
* Allow events to flow through the message queue whenever the
|
|
|
|
* progress meter gets updated. This will allow us to redraw with
|
|
|
|
* reasonable frequency.
|
|
|
|
*
|
|
|
|
* Calling this can result in other code being called, such as Windows
|
|
|
|
* message handlers, which can lead to reentrancy problems. Make sure
|
|
|
|
* you're adequately semaphored before calling here.
|
|
|
|
*
|
|
|
|
* Returns TRUE if all is well, FALSE if we're trying to quit.
|
|
|
|
*/
|
2014-11-04 00:26:53 +00:00
|
|
|
BOOL PeekAndPump();
|
|
|
|
|
2014-11-21 21:18:20 +00:00
|
|
|
/*
|
|
|
|
* After successful completion of a command, make a happy noise (but only
|
|
|
|
* if we're configured to do so).
|
|
|
|
*/
|
2014-11-04 00:26:53 +00:00
|
|
|
void SuccessBeep(void);
|
2014-11-21 21:18:20 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* If something fails, make noise if we're configured for loudness.
|
|
|
|
*/
|
2014-11-04 00:26:53 +00:00
|
|
|
void FailureBeep(void);
|
|
|
|
|
2014-11-21 21:18:20 +00:00
|
|
|
/*
|
|
|
|
* Remove a file. Returns a helpful error string on failure.
|
|
|
|
*
|
|
|
|
* The absence of the file is not considered an error.
|
|
|
|
*/
|
Large set of changes to restore CiderPress build.
CiderPress and MDC now compile, and execute far enough to open
their respective "about" boxes, but I doubt they'll do much
more than that.
* Switch from MBCS to UNICODE APIs
Microsoft switched to UTF-16 (by way of UCS-2) a long time ago,
and the support for MBCS seems to be getting phased out. So it's
time to switch to wide strings.
This is a bit awkward for CiderPress because it works with disk
and file archives with 8-bit filenames, and I want NufxLib and
DiskImgLib to continue to work on Linux (which has largely taken
the UTF-8 approach to Unicode). The libraries will continue to
work with 8-bit filenames, with CiderPress/MDC doing the
conversion at the appropriate point.
There were a couple of places where strings from a structure
handed back by one of the libraries were used directly in the UI,
or vice-versa, which is a problem because we have nowhere to
store the result of the conversion. These currently have fixed
place-holder "xyzzy" strings.
All UI strings are now wide.
Various format strings now use "%ls" and "%hs" to explicitly
specify wide and narrow. This doesn't play well with gcc, so
only the Windows-specific parts use those.
* Various updates to vcxproj files
The project-file conversion had some cruft that is now largely
gone. The build now has a common output directory for the EXEs
and libraries, avoiding the old post-build copy steps.
* Added zlib 1.2.8 and nufxlib 2.2.2 source snapshots
The old "prebuilts" directory is now gone. The libraries are now
built as part of building the apps.
I added a minimal set of files for zlib, and a full set for nufxlib.
The Linux-specific nufxlib goodies are included for the benefit of
the Linux utilities, which are currently broken (don't build).
* Replace symbols used for include guards
Symbols with a leading "__" are reserved.
2014-11-10 23:32:55 +00:00
|
|
|
CString RemoveFile(const WCHAR* fileName);
|
2014-11-04 00:26:53 +00:00
|
|
|
|
2014-11-21 21:18:20 +00:00
|
|
|
/*
|
|
|
|
* Figure out where they want to add files.
|
|
|
|
*
|
|
|
|
* If the volume directory of a disk is chosen, *ppTargetSubdir will
|
|
|
|
* be set to NULL.
|
|
|
|
*/
|
2014-11-04 00:26:53 +00:00
|
|
|
bool ChooseAddTarget(DiskImgLib::A2File** ppTargetSubdir,
|
|
|
|
DiskImgLib::DiskFS** ppDiskFS);
|
|
|
|
|
2014-11-21 21:18:20 +00:00
|
|
|
/*
|
|
|
|
* Put up the ImageFormatDialog and apply changes to "pImg".
|
|
|
|
*
|
|
|
|
* "*pDisplayFormat" gets the result of user changes to the display format.
|
|
|
|
* If "pDisplayFormat" is NULL, the "query image format" feature will be
|
|
|
|
* disabled.
|
|
|
|
*
|
|
|
|
* Returns IDCANCEL if the user cancelled out of the dialog, IDOK otherwise.
|
|
|
|
* On error, "*pErrMsg" will be non-empty.
|
|
|
|
*/
|
Large set of changes to restore CiderPress build.
CiderPress and MDC now compile, and execute far enough to open
their respective "about" boxes, but I doubt they'll do much
more than that.
* Switch from MBCS to UNICODE APIs
Microsoft switched to UTF-16 (by way of UCS-2) a long time ago,
and the support for MBCS seems to be getting phased out. So it's
time to switch to wide strings.
This is a bit awkward for CiderPress because it works with disk
and file archives with 8-bit filenames, and I want NufxLib and
DiskImgLib to continue to work on Linux (which has largely taken
the UTF-8 approach to Unicode). The libraries will continue to
work with 8-bit filenames, with CiderPress/MDC doing the
conversion at the appropriate point.
There were a couple of places where strings from a structure
handed back by one of the libraries were used directly in the UI,
or vice-versa, which is a problem because we have nowhere to
store the result of the conversion. These currently have fixed
place-holder "xyzzy" strings.
All UI strings are now wide.
Various format strings now use "%ls" and "%hs" to explicitly
specify wide and narrow. This doesn't play well with gcc, so
only the Windows-specific parts use those.
* Various updates to vcxproj files
The project-file conversion had some cruft that is now largely
gone. The build now has a common output directory for the EXEs
and libraries, avoiding the old post-build copy steps.
* Added zlib 1.2.8 and nufxlib 2.2.2 source snapshots
The old "prebuilts" directory is now gone. The libraries are now
built as part of building the apps.
I added a minimal set of files for zlib, and a full set for nufxlib.
The Linux-specific nufxlib goodies are included for the benefit of
the Linux utilities, which are currently broken (don't build).
* Replace symbols used for include guards
Symbols with a leading "__" are reserved.
2014-11-10 23:32:55 +00:00
|
|
|
int TryDiskImgOverride(DiskImg* pImg, const WCHAR* fileSource,
|
2014-11-04 00:26:53 +00:00
|
|
|
DiskImg::FSFormat defaultFormat, int* pDisplayFormat,
|
|
|
|
bool allowUnknown, CString* pErrMsg);
|
2014-11-21 21:18:20 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Do a block copy or track copy from one disk image to another.
|
|
|
|
*
|
|
|
|
* If "bulk" is set, warning dialogs are suppressed. If "partial" is set,
|
|
|
|
* copies between volumes of different sizes are allowed.
|
|
|
|
*/
|
2014-11-04 00:26:53 +00:00
|
|
|
DIError CopyDiskImage(DiskImg* pDstImg, DiskImg* pSrcImg, bool bulk,
|
|
|
|
bool partial, ProgressCancelDialog* pPCDialog);
|
|
|
|
|
2014-11-21 21:18:20 +00:00
|
|
|
// Determine whether path matches the pathname of the currently open archive.
|
Large set of changes to restore CiderPress build.
CiderPress and MDC now compile, and execute far enough to open
their respective "about" boxes, but I doubt they'll do much
more than that.
* Switch from MBCS to UNICODE APIs
Microsoft switched to UTF-16 (by way of UCS-2) a long time ago,
and the support for MBCS seems to be getting phased out. So it's
time to switch to wide strings.
This is a bit awkward for CiderPress because it works with disk
and file archives with 8-bit filenames, and I want NufxLib and
DiskImgLib to continue to work on Linux (which has largely taken
the UTF-8 approach to Unicode). The libraries will continue to
work with 8-bit filenames, with CiderPress/MDC doing the
conversion at the appropriate point.
There were a couple of places where strings from a structure
handed back by one of the libraries were used directly in the UI,
or vice-versa, which is a problem because we have nowhere to
store the result of the conversion. These currently have fixed
place-holder "xyzzy" strings.
All UI strings are now wide.
Various format strings now use "%ls" and "%hs" to explicitly
specify wide and narrow. This doesn't play well with gcc, so
only the Windows-specific parts use those.
* Various updates to vcxproj files
The project-file conversion had some cruft that is now largely
gone. The build now has a common output directory for the EXEs
and libraries, avoiding the old post-build copy steps.
* Added zlib 1.2.8 and nufxlib 2.2.2 source snapshots
The old "prebuilts" directory is now gone. The libraries are now
built as part of building the apps.
I added a minimal set of files for zlib, and a full set for nufxlib.
The Linux-specific nufxlib goodies are included for the benefit of
the Linux utilities, which are currently broken (don't build).
* Replace symbols used for include guards
Symbols with a leading "__" are reserved.
2014-11-10 23:32:55 +00:00
|
|
|
bool IsOpenPathName(const WCHAR* path);
|
2014-11-21 21:18:20 +00:00
|
|
|
|
2014-11-04 00:26:53 +00:00
|
|
|
// raise a flag to cause a full reload of the open file
|
|
|
|
void SetReopenFlag(void) { fNeedReopen = true; }
|
|
|
|
|
2014-11-21 21:18:20 +00:00
|
|
|
/*
|
|
|
|
* Configure a ReformatHolder based on the current preferences.
|
|
|
|
*/
|
2014-11-04 00:26:53 +00:00
|
|
|
static void ConfigureReformatFromPreferences(ReformatHolder* pReformat);
|
2014-11-21 21:18:20 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Convert a DiskImg format spec into a ReformatHolder SourceFormat.
|
|
|
|
*/
|
2014-11-04 00:26:53 +00:00
|
|
|
static ReformatHolder::SourceFormat ReformatterSourceFormat(DiskImg::FSFormat format);
|
|
|
|
|
2014-11-21 21:18:20 +00:00
|
|
|
/*
|
|
|
|
* Saves a buffer of data as a file in a disk image or file archive.
|
|
|
|
* Utility function used by cassette import.
|
|
|
|
*
|
|
|
|
* May modify contents of *pDetails.
|
|
|
|
*
|
|
|
|
* On failure, returns with an error message in errMsg.
|
|
|
|
*/
|
2015-01-05 05:04:01 +00:00
|
|
|
static bool SaveToArchive(GenericArchive::LocalFileDetails* pDetails,
|
2014-11-21 02:10:18 +00:00
|
|
|
const uint8_t* dataBuf, long dataLen,
|
|
|
|
const uint8_t* rsrcBuf, long rsrcLen,
|
2015-01-05 05:04:01 +00:00
|
|
|
CString* pErrMsg, CWnd* pDialog);
|
2014-11-04 00:26:53 +00:00
|
|
|
|
Large set of changes to restore CiderPress build.
CiderPress and MDC now compile, and execute far enough to open
their respective "about" boxes, but I doubt they'll do much
more than that.
* Switch from MBCS to UNICODE APIs
Microsoft switched to UTF-16 (by way of UCS-2) a long time ago,
and the support for MBCS seems to be getting phased out. So it's
time to switch to wide strings.
This is a bit awkward for CiderPress because it works with disk
and file archives with 8-bit filenames, and I want NufxLib and
DiskImgLib to continue to work on Linux (which has largely taken
the UTF-8 approach to Unicode). The libraries will continue to
work with 8-bit filenames, with CiderPress/MDC doing the
conversion at the appropriate point.
There were a couple of places where strings from a structure
handed back by one of the libraries were used directly in the UI,
or vice-versa, which is a problem because we have nowhere to
store the result of the conversion. These currently have fixed
place-holder "xyzzy" strings.
All UI strings are now wide.
Various format strings now use "%ls" and "%hs" to explicitly
specify wide and narrow. This doesn't play well with gcc, so
only the Windows-specific parts use those.
* Various updates to vcxproj files
The project-file conversion had some cruft that is now largely
gone. The build now has a common output directory for the EXEs
and libraries, avoiding the old post-build copy steps.
* Added zlib 1.2.8 and nufxlib 2.2.2 source snapshots
The old "prebuilts" directory is now gone. The libraries are now
built as part of building the apps.
I added a minimal set of files for zlib, and a full set for nufxlib.
The Linux-specific nufxlib goodies are included for the benefit of
the Linux utilities, which are currently broken (don't build).
* Replace symbols used for include guards
Symbols with a leading "__" are reserved.
2014-11-10 23:32:55 +00:00
|
|
|
static const WCHAR kOpenNuFX[];
|
|
|
|
static const WCHAR kOpenBinaryII[];
|
|
|
|
static const WCHAR kOpenACU[];
|
2015-01-12 07:02:35 +00:00
|
|
|
static const WCHAR kOpenAppleSingle[];
|
Large set of changes to restore CiderPress build.
CiderPress and MDC now compile, and execute far enough to open
their respective "about" boxes, but I doubt they'll do much
more than that.
* Switch from MBCS to UNICODE APIs
Microsoft switched to UTF-16 (by way of UCS-2) a long time ago,
and the support for MBCS seems to be getting phased out. So it's
time to switch to wide strings.
This is a bit awkward for CiderPress because it works with disk
and file archives with 8-bit filenames, and I want NufxLib and
DiskImgLib to continue to work on Linux (which has largely taken
the UTF-8 approach to Unicode). The libraries will continue to
work with 8-bit filenames, with CiderPress/MDC doing the
conversion at the appropriate point.
There were a couple of places where strings from a structure
handed back by one of the libraries were used directly in the UI,
or vice-versa, which is a problem because we have nowhere to
store the result of the conversion. These currently have fixed
place-holder "xyzzy" strings.
All UI strings are now wide.
Various format strings now use "%ls" and "%hs" to explicitly
specify wide and narrow. This doesn't play well with gcc, so
only the Windows-specific parts use those.
* Various updates to vcxproj files
The project-file conversion had some cruft that is now largely
gone. The build now has a common output directory for the EXEs
and libraries, avoiding the old post-build copy steps.
* Added zlib 1.2.8 and nufxlib 2.2.2 source snapshots
The old "prebuilts" directory is now gone. The libraries are now
built as part of building the apps.
I added a minimal set of files for zlib, and a full set for nufxlib.
The Linux-specific nufxlib goodies are included for the benefit of
the Linux utilities, which are currently broken (don't build).
* Replace symbols used for include guards
Symbols with a leading "__" are reserved.
2014-11-10 23:32:55 +00:00
|
|
|
static const WCHAR kOpenDiskImage[];
|
|
|
|
static const WCHAR kOpenAll[];
|
|
|
|
static const WCHAR kOpenEnd[];
|
2007-03-27 17:47:10 +00:00
|
|
|
|
|
|
|
private:
|
Large set of changes to restore CiderPress build.
CiderPress and MDC now compile, and execute far enough to open
their respective "about" boxes, but I doubt they'll do much
more than that.
* Switch from MBCS to UNICODE APIs
Microsoft switched to UTF-16 (by way of UCS-2) a long time ago,
and the support for MBCS seems to be getting phased out. So it's
time to switch to wide strings.
This is a bit awkward for CiderPress because it works with disk
and file archives with 8-bit filenames, and I want NufxLib and
DiskImgLib to continue to work on Linux (which has largely taken
the UTF-8 approach to Unicode). The libraries will continue to
work with 8-bit filenames, with CiderPress/MDC doing the
conversion at the appropriate point.
There were a couple of places where strings from a structure
handed back by one of the libraries were used directly in the UI,
or vice-versa, which is a problem because we have nowhere to
store the result of the conversion. These currently have fixed
place-holder "xyzzy" strings.
All UI strings are now wide.
Various format strings now use "%ls" and "%hs" to explicitly
specify wide and narrow. This doesn't play well with gcc, so
only the Windows-specific parts use those.
* Various updates to vcxproj files
The project-file conversion had some cruft that is now largely
gone. The build now has a common output directory for the EXEs
and libraries, avoiding the old post-build copy steps.
* Added zlib 1.2.8 and nufxlib 2.2.2 source snapshots
The old "prebuilts" directory is now gone. The libraries are now
built as part of building the apps.
I added a minimal set of files for zlib, and a full set for nufxlib.
The Linux-specific nufxlib goodies are included for the benefit of
the Linux utilities, which are currently broken (don't build).
* Replace symbols used for include guards
Symbols with a leading "__" are reserved.
2014-11-10 23:32:55 +00:00
|
|
|
static const WCHAR kModeNuFX[];
|
|
|
|
static const WCHAR kModeBinaryII[];
|
|
|
|
static const WCHAR kModeACU[];
|
2015-01-12 07:02:35 +00:00
|
|
|
static const WCHAR kModeAppleSingle[];
|
Large set of changes to restore CiderPress build.
CiderPress and MDC now compile, and execute far enough to open
their respective "about" boxes, but I doubt they'll do much
more than that.
* Switch from MBCS to UNICODE APIs
Microsoft switched to UTF-16 (by way of UCS-2) a long time ago,
and the support for MBCS seems to be getting phased out. So it's
time to switch to wide strings.
This is a bit awkward for CiderPress because it works with disk
and file archives with 8-bit filenames, and I want NufxLib and
DiskImgLib to continue to work on Linux (which has largely taken
the UTF-8 approach to Unicode). The libraries will continue to
work with 8-bit filenames, with CiderPress/MDC doing the
conversion at the appropriate point.
There were a couple of places where strings from a structure
handed back by one of the libraries were used directly in the UI,
or vice-versa, which is a problem because we have nowhere to
store the result of the conversion. These currently have fixed
place-holder "xyzzy" strings.
All UI strings are now wide.
Various format strings now use "%ls" and "%hs" to explicitly
specify wide and narrow. This doesn't play well with gcc, so
only the Windows-specific parts use those.
* Various updates to vcxproj files
The project-file conversion had some cruft that is now largely
gone. The build now has a common output directory for the EXEs
and libraries, avoiding the old post-build copy steps.
* Added zlib 1.2.8 and nufxlib 2.2.2 source snapshots
The old "prebuilts" directory is now gone. The libraries are now
built as part of building the apps.
I added a minimal set of files for zlib, and a full set for nufxlib.
The Linux-specific nufxlib goodies are included for the benefit of
the Linux utilities, which are currently broken (don't build).
* Replace symbols used for include guards
Symbols with a leading "__" are reserved.
2014-11-10 23:32:55 +00:00
|
|
|
static const WCHAR kModeDiskImage[];
|
2014-11-04 00:26:53 +00:00
|
|
|
|
|
|
|
// Command handlers
|
|
|
|
afx_msg int OnCreate(LPCREATESTRUCT lpcs);
|
2021-05-10 21:04:50 +00:00
|
|
|
afx_msg void OnClose();
|
2014-11-04 00:26:53 +00:00
|
|
|
afx_msg LONG OnLateInit(UINT, LONG);
|
|
|
|
afx_msg void OnSize(UINT nType, int cx, int cy);
|
|
|
|
afx_msg void OnGetMinMaxInfo(MINMAXINFO* pMMI);
|
|
|
|
afx_msg void OnPaint(void);
|
|
|
|
afx_msg void OnSetFocus(CWnd* pOldWnd);
|
|
|
|
afx_msg BOOL OnHelpInfo(HELPINFO* lpHelpInfo);
|
|
|
|
afx_msg BOOL OnQueryEndSession(void);
|
|
|
|
afx_msg void OnEndSession(BOOL bEnding);
|
|
|
|
afx_msg LRESULT OnFindDialogMessage(WPARAM wParam, LPARAM lParam);
|
|
|
|
afx_msg void OnFileNewArchive(void);
|
|
|
|
afx_msg void OnFileOpen(void);
|
|
|
|
afx_msg void OnFileOpenVolume(void);
|
|
|
|
afx_msg void OnUpdateFileOpenVolume(CCmdUI* pCmdUI);
|
|
|
|
afx_msg void OnFileReopen(void);
|
|
|
|
afx_msg void OnUpdateFileReopen(CCmdUI* pCmdUI);
|
|
|
|
afx_msg void OnFileSave(void);
|
|
|
|
afx_msg void OnUpdateFileSave(CCmdUI* pCmdUI);
|
|
|
|
afx_msg void OnFileClose(void);
|
|
|
|
afx_msg void OnUpdateFileClose(CCmdUI* pCmdUI);
|
|
|
|
afx_msg void OnFileArchiveInfo(void);
|
|
|
|
afx_msg void OnUpdateFileArchiveInfo(CCmdUI* pCmdUI);
|
|
|
|
afx_msg void OnFilePrint(void);
|
|
|
|
afx_msg void OnUpdateFilePrint(CCmdUI* pCmdUI);
|
|
|
|
afx_msg void OnFileExit(void);
|
2014-11-21 21:18:20 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Copy data to the clipboard.
|
|
|
|
*/
|
2014-11-04 00:26:53 +00:00
|
|
|
afx_msg void OnEditCopy(void);
|
|
|
|
afx_msg void OnUpdateEditCopy(CCmdUI* pCmdUI);
|
2014-11-21 21:18:20 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Paste data from the clipboard, using the configured defaults.
|
|
|
|
*/
|
2014-11-04 00:26:53 +00:00
|
|
|
afx_msg void OnEditPaste(void);
|
|
|
|
afx_msg void OnUpdateEditPaste(CCmdUI* pCmdUI);
|
2014-11-21 21:18:20 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Paste data from the clipboard, giving the user the opportunity to select
|
|
|
|
* how the files are handled.
|
|
|
|
*/
|
2014-11-04 00:26:53 +00:00
|
|
|
afx_msg void OnEditPasteSpecial(void);
|
|
|
|
afx_msg void OnUpdateEditPasteSpecial(CCmdUI* pCmdUI);
|
2014-11-21 21:18:20 +00:00
|
|
|
|
2014-11-04 00:26:53 +00:00
|
|
|
afx_msg void OnEditFind(void);
|
|
|
|
afx_msg void OnUpdateEditFind(CCmdUI* pCmdUI);
|
|
|
|
afx_msg void OnEditSelectAll(void);
|
|
|
|
afx_msg void OnUpdateEditSelectAll(CCmdUI* pCmdUI);
|
|
|
|
afx_msg void OnEditInvertSelection(void);
|
|
|
|
afx_msg void OnUpdateEditInvertSelection(CCmdUI* pCmdUI);
|
|
|
|
afx_msg void OnEditPreferences(void);
|
|
|
|
afx_msg void OnEditSort(UINT id);
|
|
|
|
afx_msg void OnUpdateEditSort(CCmdUI* pCmdUI);
|
2014-11-21 21:18:20 +00:00
|
|
|
/*
|
|
|
|
* View a file stored in the archive.
|
|
|
|
*
|
|
|
|
* Control bounces back through Get*FileText() to get the actual
|
|
|
|
* data to view.
|
|
|
|
*/
|
2014-11-04 00:26:53 +00:00
|
|
|
afx_msg void OnActionsView(void);
|
|
|
|
afx_msg void OnUpdateActionsView(CCmdUI* pCmdUI);
|
2014-11-21 21:18:20 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* View a file stored in the archive.
|
|
|
|
*
|
|
|
|
* Control bounces back through Get*FileText() to get the actual
|
|
|
|
* data to view.
|
|
|
|
*/
|
2014-11-04 00:26:53 +00:00
|
|
|
afx_msg void OnActionsOpenAsDisk(void);
|
|
|
|
afx_msg void OnUpdateActionsOpenAsDisk(CCmdUI* pCmdUI);
|
2014-11-21 21:18:20 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Add files to an archive.
|
|
|
|
*/
|
2014-11-04 00:26:53 +00:00
|
|
|
afx_msg void OnActionsAddFiles(void);
|
|
|
|
afx_msg void OnUpdateActionsAddFiles(CCmdUI* pCmdUI);
|
2014-11-21 21:18:20 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Add a disk to an archive. Not all archive formats support disk images.
|
|
|
|
*
|
|
|
|
* We open a single disk archive file as a DiskImg, get the format
|
|
|
|
* figured out, then write it block-by-block into a file chosen by the user.
|
|
|
|
* Standard open/save dialogs work fine here.
|
|
|
|
*/
|
2014-11-04 00:26:53 +00:00
|
|
|
afx_msg void OnActionsAddDisks(void);
|
|
|
|
afx_msg void OnUpdateActionsAddDisks(CCmdUI* pCmdUI);
|
2014-11-21 21:18:20 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Create a subdirectory inside another subdirectory (or volume directory).
|
|
|
|
*
|
|
|
|
* Simply asserting that an existing subdir be selected in the list does
|
|
|
|
* away with all sorts of testing. Creating subdirs on DOS disks and NuFX
|
|
|
|
* archives is impossible because neither has subdirs. Nested volumes are
|
|
|
|
* selected for us by the user.
|
|
|
|
*/
|
2014-11-04 00:26:53 +00:00
|
|
|
afx_msg void OnActionsCreateSubdir(void);
|
|
|
|
afx_msg void OnUpdateActionsCreateSubdir(CCmdUI* pCmdUI);
|
2014-11-21 21:18:20 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Extract files.
|
|
|
|
*/
|
2014-11-04 00:26:53 +00:00
|
|
|
afx_msg void OnActionsExtract(void);
|
|
|
|
afx_msg void OnUpdateActionsExtract(CCmdUI* pCmdUI);
|
2014-11-21 21:18:20 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Test files.
|
|
|
|
*/
|
2014-11-04 00:26:53 +00:00
|
|
|
afx_msg void OnActionsTest(void);
|
|
|
|
afx_msg void OnUpdateActionsTest(CCmdUI* pCmdUI);
|
2014-11-21 21:18:20 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Delete archive entries.
|
|
|
|
*/
|
2014-11-04 00:26:53 +00:00
|
|
|
afx_msg void OnActionsDelete(void);
|
|
|
|
afx_msg void OnUpdateActionsDelete(CCmdUI* pCmdUI);
|
2014-11-21 21:18:20 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Rename archive entries. Depending on the structure of the underlying
|
|
|
|
* archive, we may only allow the user to alter the filename component.
|
|
|
|
* Anything else would constitute moving the file around in the filesystem.
|
|
|
|
*/
|
2014-11-04 00:26:53 +00:00
|
|
|
afx_msg void OnActionsRename(void);
|
|
|
|
afx_msg void OnUpdateActionsRename(CCmdUI* pCmdUI);
|
2014-11-21 21:18:20 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Edit a comment, creating it if necessary.
|
|
|
|
*/
|
2014-11-04 00:26:53 +00:00
|
|
|
afx_msg void OnActionsEditComment(void);
|
|
|
|
afx_msg void OnUpdateActionsEditComment(CCmdUI* pCmdUI);
|
2014-11-21 21:18:20 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Edit file properties.
|
|
|
|
*
|
|
|
|
* This causes a reload of the list, which isn't really necessary. We
|
|
|
|
* do need to re-evaluate the sort order if one of the fields they modified
|
|
|
|
* is the current sort key, but it would be nice if we could at least retain
|
|
|
|
* the selection. Since we're not reloading the GenericArchive, we *can*
|
|
|
|
* remember the selection.
|
|
|
|
*/
|
2014-11-04 00:26:53 +00:00
|
|
|
afx_msg void OnActionsEditProps(void);
|
|
|
|
afx_msg void OnUpdateActionsEditProps(CCmdUI* pCmdUI);
|
2014-11-21 21:18:20 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Change a volume name or volume number.
|
|
|
|
*/
|
2014-11-04 00:26:53 +00:00
|
|
|
afx_msg void OnActionsRenameVolume(void);
|
|
|
|
afx_msg void OnUpdateActionsRenameVolume(CCmdUI* pCmdUI);
|
2014-11-21 21:18:20 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Recompress files.
|
|
|
|
*/
|
2014-11-04 00:26:53 +00:00
|
|
|
afx_msg void OnActionsRecompress(void);
|
|
|
|
afx_msg void OnUpdateActionsRecompress(CCmdUI* pCmdUI);
|
2014-11-21 21:18:20 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Select files to convert.
|
|
|
|
*/
|
2014-11-04 00:26:53 +00:00
|
|
|
afx_msg void OnActionsConvDisk(void);
|
|
|
|
afx_msg void OnUpdateActionsConvDisk(CCmdUI* pCmdUI);
|
2014-11-21 21:18:20 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Select files to convert.
|
|
|
|
*/
|
2014-11-04 00:26:53 +00:00
|
|
|
afx_msg void OnActionsConvFile(void);
|
|
|
|
afx_msg void OnUpdateActionsConvFile(CCmdUI* pCmdUI);
|
2014-11-21 21:18:20 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Convert BAS, INT, or BIN to a cassette-audio WAV file.
|
|
|
|
* (not implemented)
|
|
|
|
*/
|
2014-11-04 00:26:53 +00:00
|
|
|
afx_msg void OnActionsConvToWav(void);
|
|
|
|
afx_msg void OnUpdateActionsConvToWav(CCmdUI* pCmdUI);
|
2014-11-21 21:18:20 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Convert a WAV file with a digitized Apple II cassette tape into an
|
|
|
|
* Apple II file, and add it to the current disk.
|
|
|
|
*/
|
2014-11-04 00:26:53 +00:00
|
|
|
afx_msg void OnActionsConvFromWav(void);
|
|
|
|
afx_msg void OnUpdateActionsConvFromWav(CCmdUI* pCmdUI);
|
2014-11-21 21:18:20 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Import an Applesoft BASIC program from a text file.
|
|
|
|
*
|
|
|
|
* We currently allow the user to select a single file for import. Someday
|
|
|
|
* we may want to allow multi-file import.
|
|
|
|
*/
|
2014-11-04 00:26:53 +00:00
|
|
|
afx_msg void OnActionsImportBAS(void);
|
|
|
|
afx_msg void OnUpdateActionsImportBAS(CCmdUI* pCmdUI);
|
2014-11-21 21:18:20 +00:00
|
|
|
|
|
|
|
// edit a disk
|
2014-11-04 00:26:53 +00:00
|
|
|
afx_msg void OnToolsDiskEdit(void);
|
2014-11-21 21:18:20 +00:00
|
|
|
// convert a disk image from one format to another
|
2014-11-04 00:26:53 +00:00
|
|
|
afx_msg void OnToolsDiskConv(void);
|
2014-11-21 21:18:20 +00:00
|
|
|
// bulk disk conversion
|
2014-11-04 00:26:53 +00:00
|
|
|
afx_msg void OnToolsBulkDiskConv(void);
|
2014-11-21 21:18:20 +00:00
|
|
|
// merge two SST images into a single NIB image
|
2014-11-04 00:26:53 +00:00
|
|
|
afx_msg void OnToolsSSTMerge(void);
|
|
|
|
afx_msg void OnToolsVolumeCopierVolume(void);
|
|
|
|
afx_msg void OnToolsVolumeCopierFile(void);
|
2014-11-21 21:18:20 +00:00
|
|
|
// scan and report on the end-of-line markers found in a file
|
2014-11-04 00:26:53 +00:00
|
|
|
afx_msg void OnToolsEOLScanner(void);
|
2014-11-21 21:18:20 +00:00
|
|
|
// edit the properties (but not the disk image inside) a .2MG disk image
|
2014-11-04 00:26:53 +00:00
|
|
|
afx_msg void OnToolsTwoImgProps(void);
|
2014-11-21 21:18:20 +00:00
|
|
|
// create a new disk image
|
2014-11-04 00:26:53 +00:00
|
|
|
afx_msg void OnToolsDiskImageCreator(void);
|
|
|
|
afx_msg void OnHelpContents(void);
|
|
|
|
afx_msg void OnHelpWebSite(void);
|
|
|
|
afx_msg void OnHelpOrdering(void);
|
|
|
|
afx_msg void OnHelpAbout(void);
|
|
|
|
afx_msg void OnRtClkDefault(void);
|
|
|
|
|
2014-11-21 21:18:20 +00:00
|
|
|
// Handle command-line arguments.
|
2014-11-04 00:26:53 +00:00
|
|
|
void ProcessCommandLine(void);
|
2014-11-21 21:18:20 +00:00
|
|
|
|
2014-11-04 00:26:53 +00:00
|
|
|
void ResizeClientArea(void);
|
2014-11-21 21:18:20 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Draw what looks like an empty client area.
|
|
|
|
*/
|
2014-11-04 00:26:53 +00:00
|
|
|
void DrawEmptyClientArea(CDC* pDC, const CRect& clientRect);
|
2014-11-21 21:18:20 +00:00
|
|
|
|
2021-05-10 21:04:50 +00:00
|
|
|
/*
|
|
|
|
* Save/restore main window placement. The restore function will move
|
|
|
|
* the window if the previous placement is no longer visible (e.g. a
|
|
|
|
* secondary monitor was removed).
|
|
|
|
*/
|
|
|
|
void SaveWinPlacement();
|
|
|
|
void RestoreWinPlacement();
|
|
|
|
|
2014-11-21 21:18:20 +00:00
|
|
|
/*
|
|
|
|
* Extract a record to the temp folder and open it with a new instance of
|
|
|
|
* CiderPress. We might want to extract disk images as 2MG files to take
|
|
|
|
* the mystery out of opening them, but since they're coming out of a
|
|
|
|
* ShrinkIt archive they're pretty un-mysterious anyway.
|
|
|
|
*
|
|
|
|
* We tell the new instance to open it read-only, and flag it for
|
|
|
|
* deletion on exit.
|
|
|
|
*
|
|
|
|
* Returns 0 on success, nonzero error status on failure.
|
|
|
|
*/
|
2014-11-04 00:26:53 +00:00
|
|
|
int TmpExtractAndOpen(GenericEntry* pEntry, int threadKind,
|
Large set of changes to restore CiderPress build.
CiderPress and MDC now compile, and execute far enough to open
their respective "about" boxes, but I doubt they'll do much
more than that.
* Switch from MBCS to UNICODE APIs
Microsoft switched to UTF-16 (by way of UCS-2) a long time ago,
and the support for MBCS seems to be getting phased out. So it's
time to switch to wide strings.
This is a bit awkward for CiderPress because it works with disk
and file archives with 8-bit filenames, and I want NufxLib and
DiskImgLib to continue to work on Linux (which has largely taken
the UTF-8 approach to Unicode). The libraries will continue to
work with 8-bit filenames, with CiderPress/MDC doing the
conversion at the appropriate point.
There were a couple of places where strings from a structure
handed back by one of the libraries were used directly in the UI,
or vice-versa, which is a problem because we have nowhere to
store the result of the conversion. These currently have fixed
place-holder "xyzzy" strings.
All UI strings are now wide.
Various format strings now use "%ls" and "%hs" to explicitly
specify wide and narrow. This doesn't play well with gcc, so
only the Windows-specific parts use those.
* Various updates to vcxproj files
The project-file conversion had some cruft that is now largely
gone. The build now has a common output directory for the EXEs
and libraries, avoiding the old post-build copy steps.
* Added zlib 1.2.8 and nufxlib 2.2.2 source snapshots
The old "prebuilts" directory is now gone. The libraries are now
built as part of building the apps.
I added a minimal set of files for zlib, and a full set for nufxlib.
The Linux-specific nufxlib goodies are included for the benefit of
the Linux utilities, which are currently broken (don't build).
* Replace symbols used for include guards
Symbols with a leading "__" are reserved.
2014-11-10 23:32:55 +00:00
|
|
|
const WCHAR* modeStr);
|
2014-11-21 21:18:20 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Extract a record to the temp folder and open it with an external viewer.
|
|
|
|
* The file must be created with the correct extension so ShellExecute
|
|
|
|
* does the right thing.
|
|
|
|
*
|
|
|
|
* The files will be added to the "delete on exit" list, so that they will
|
|
|
|
* be cleaned up when CiderPress exits (assuming the external viewer no longer
|
|
|
|
* has them open).
|
|
|
|
*
|
|
|
|
* The GetTempFileName function creates a uniquely-named temp file. We
|
|
|
|
* create a file that has that name plus an extension. To ensure that we
|
|
|
|
* don't try to use the same temp filename twice, we have to hold off on
|
|
|
|
* deleting the unused .tmp files until we're ready to delete the
|
|
|
|
* corresponding .gif (or whatever) files. Thus, each invocation of this
|
|
|
|
* function creates two files and two entries in the delete-on-exit set.
|
|
|
|
*
|
|
|
|
* Returns 0 on success, nonzero error status on failure.
|
|
|
|
*/
|
2014-11-04 00:26:53 +00:00
|
|
|
int TmpExtractForExternal(GenericEntry* pEntry);
|
2014-11-21 21:18:20 +00:00
|
|
|
|
Large set of changes to restore CiderPress build.
CiderPress and MDC now compile, and execute far enough to open
their respective "about" boxes, but I doubt they'll do much
more than that.
* Switch from MBCS to UNICODE APIs
Microsoft switched to UTF-16 (by way of UCS-2) a long time ago,
and the support for MBCS seems to be getting phased out. So it's
time to switch to wide strings.
This is a bit awkward for CiderPress because it works with disk
and file archives with 8-bit filenames, and I want NufxLib and
DiskImgLib to continue to work on Linux (which has largely taken
the UTF-8 approach to Unicode). The libraries will continue to
work with 8-bit filenames, with CiderPress/MDC doing the
conversion at the appropriate point.
There were a couple of places where strings from a structure
handed back by one of the libraries were used directly in the UI,
or vice-versa, which is a problem because we have nowhere to
store the result of the conversion. These currently have fixed
place-holder "xyzzy" strings.
All UI strings are now wide.
Various format strings now use "%ls" and "%hs" to explicitly
specify wide and narrow. This doesn't play well with gcc, so
only the Windows-specific parts use those.
* Various updates to vcxproj files
The project-file conversion had some cruft that is now largely
gone. The build now has a common output directory for the EXEs
and libraries, avoiding the old post-build copy steps.
* Added zlib 1.2.8 and nufxlib 2.2.2 source snapshots
The old "prebuilts" directory is now gone. The libraries are now
built as part of building the apps.
I added a minimal set of files for zlib, and a full set for nufxlib.
The Linux-specific nufxlib goodies are included for the benefit of
the Linux utilities, which are currently broken (don't build).
* Replace symbols used for include guards
Symbols with a leading "__" are reserved.
2014-11-10 23:32:55 +00:00
|
|
|
void DoOpenArchive(const WCHAR* pathName, const WCHAR* ext,
|
2015-01-13 23:54:10 +00:00
|
|
|
FilterIndex filterIndex, bool readOnly);
|
|
|
|
|
|
|
|
GenericArchive* CreateArchiveInstance(FilterIndex filterIndex) const;
|
2014-11-21 21:18:20 +00:00
|
|
|
|
|
|
|
/*
|
2015-01-13 23:54:10 +00:00
|
|
|
* Load an archive, using the appropriate GenericArchive subclass.
|
2014-11-21 21:18:20 +00:00
|
|
|
*
|
|
|
|
* "filename" is the full path to the file, "extension" is the
|
|
|
|
* filetype component of the name (without the leading '.'), "filterIndex"
|
|
|
|
* is the offset into the set of filename filters used in the standard
|
2015-01-13 23:54:10 +00:00
|
|
|
* file dialog, and "readOnly" reflects the state of the stdfile dialog
|
|
|
|
* checkbox.
|
2014-11-21 21:18:20 +00:00
|
|
|
*
|
|
|
|
* Returns 0 on success, nonzero on failure.
|
|
|
|
*/
|
Large set of changes to restore CiderPress build.
CiderPress and MDC now compile, and execute far enough to open
their respective "about" boxes, but I doubt they'll do much
more than that.
* Switch from MBCS to UNICODE APIs
Microsoft switched to UTF-16 (by way of UCS-2) a long time ago,
and the support for MBCS seems to be getting phased out. So it's
time to switch to wide strings.
This is a bit awkward for CiderPress because it works with disk
and file archives with 8-bit filenames, and I want NufxLib and
DiskImgLib to continue to work on Linux (which has largely taken
the UTF-8 approach to Unicode). The libraries will continue to
work with 8-bit filenames, with CiderPress/MDC doing the
conversion at the appropriate point.
There were a couple of places where strings from a structure
handed back by one of the libraries were used directly in the UI,
or vice-versa, which is a problem because we have nowhere to
store the result of the conversion. These currently have fixed
place-holder "xyzzy" strings.
All UI strings are now wide.
Various format strings now use "%ls" and "%hs" to explicitly
specify wide and narrow. This doesn't play well with gcc, so
only the Windows-specific parts use those.
* Various updates to vcxproj files
The project-file conversion had some cruft that is now largely
gone. The build now has a common output directory for the EXEs
and libraries, avoiding the old post-build copy steps.
* Added zlib 1.2.8 and nufxlib 2.2.2 source snapshots
The old "prebuilts" directory is now gone. The libraries are now
built as part of building the apps.
I added a minimal set of files for zlib, and a full set for nufxlib.
The Linux-specific nufxlib goodies are included for the benefit of
the Linux utilities, which are currently broken (don't build).
* Replace symbols used for include guards
Symbols with a leading "__" are reserved.
2014-11-10 23:32:55 +00:00
|
|
|
int LoadArchive(const WCHAR* filename, const WCHAR* extension,
|
2015-01-13 23:54:10 +00:00
|
|
|
FilterIndex filterIndex, bool readOnly);
|
2014-11-21 21:18:20 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Open a raw disk volume. Useful for ProDOS-formatted 1.44MB floppy disks
|
|
|
|
* and CFFA flash cards.
|
|
|
|
*
|
|
|
|
* Assume it's a disk image -- it'd be a weird place for a ShrinkIt archive.
|
|
|
|
* CFFA cards can actually hold multiple volumes, but that's all taken care
|
|
|
|
* of inside the diskimg DLL.
|
|
|
|
*
|
|
|
|
* Returns 0 on success, nonzero on failure.
|
|
|
|
*/
|
2014-11-04 00:26:53 +00:00
|
|
|
int DoOpenVolume(CString drive, bool readOnly);
|
2014-11-21 21:18:20 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Switch the content list to a new archive, closing the previous if one
|
|
|
|
* was already open.
|
|
|
|
*/
|
2014-11-04 00:26:53 +00:00
|
|
|
void SwitchContentList(GenericArchive* pOpenArchive);
|
2014-11-21 21:18:20 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Close the existing archive file, but don't try to shut down the child
|
|
|
|
* windows. This should only be used from the destructor.
|
|
|
|
*/
|
2014-11-04 00:26:53 +00:00
|
|
|
void CloseArchiveWOControls(void);
|
2014-11-21 21:18:20 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Close the existing archive file, and throw out the control we're
|
|
|
|
* using to display it.
|
|
|
|
*/
|
2014-11-04 00:26:53 +00:00
|
|
|
void CloseArchive(void);
|
2014-11-21 21:18:20 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Set the title bar on the main window.
|
|
|
|
*
|
|
|
|
* "pathname" is often different from pOpenArchive->GetPathName(), especially
|
|
|
|
* when we were launched from another instance of CiderPress and handed a
|
|
|
|
* temp file whose name we're trying to conceal.
|
|
|
|
*/
|
Large set of changes to restore CiderPress build.
CiderPress and MDC now compile, and execute far enough to open
their respective "about" boxes, but I doubt they'll do much
more than that.
* Switch from MBCS to UNICODE APIs
Microsoft switched to UTF-16 (by way of UCS-2) a long time ago,
and the support for MBCS seems to be getting phased out. So it's
time to switch to wide strings.
This is a bit awkward for CiderPress because it works with disk
and file archives with 8-bit filenames, and I want NufxLib and
DiskImgLib to continue to work on Linux (which has largely taken
the UTF-8 approach to Unicode). The libraries will continue to
work with 8-bit filenames, with CiderPress/MDC doing the
conversion at the appropriate point.
There were a couple of places where strings from a structure
handed back by one of the libraries were used directly in the UI,
or vice-versa, which is a problem because we have nowhere to
store the result of the conversion. These currently have fixed
place-holder "xyzzy" strings.
All UI strings are now wide.
Various format strings now use "%ls" and "%hs" to explicitly
specify wide and narrow. This doesn't play well with gcc, so
only the Windows-specific parts use those.
* Various updates to vcxproj files
The project-file conversion had some cruft that is now largely
gone. The build now has a common output directory for the EXEs
and libraries, avoiding the old post-build copy steps.
* Added zlib 1.2.8 and nufxlib 2.2.2 source snapshots
The old "prebuilts" directory is now gone. The libraries are now
built as part of building the apps.
I added a minimal set of files for zlib, and a full set for nufxlib.
The Linux-specific nufxlib goodies are included for the benefit of
the Linux utilities, which are currently broken (don't build).
* Replace symbols used for include guards
Symbols with a leading "__" are reserved.
2014-11-10 23:32:55 +00:00
|
|
|
void SetCPTitle(const WCHAR* pathname, GenericArchive* pArchive);
|
2014-11-21 21:18:20 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Set the title bar to something boring when nothing is open.
|
|
|
|
*/
|
2014-11-04 00:26:53 +00:00
|
|
|
void SetCPTitle(void);
|
2014-11-21 21:18:20 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Get the one selected item from the current display. Primarily useful
|
|
|
|
* for the double-click handler, but also used for "action" menu items
|
|
|
|
* that insist on operating on a single menu item (edit prefs, create subdir).
|
|
|
|
*
|
|
|
|
* Returns NULL if the item couldn't be found or if more than one item was
|
|
|
|
* selected.
|
|
|
|
*/
|
2014-11-04 00:26:53 +00:00
|
|
|
GenericEntry* GetSelectedItem(ContentList* pContentList);
|
2014-11-21 21:18:20 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Handle a request to view stuff.
|
|
|
|
*
|
|
|
|
* If "query" pref is set, we ask the user to confirm some choices. If
|
|
|
|
* not, we just go with the defaults.
|
|
|
|
*
|
|
|
|
* We include "damaged" files so that we can show the user a nice message
|
|
|
|
* about how the file is damaged.
|
|
|
|
*/
|
2014-11-04 00:26:53 +00:00
|
|
|
void HandleView(void);
|
|
|
|
|
2021-05-10 01:17:49 +00:00
|
|
|
//void DeleteFileOnExit(const WCHAR* name);
|
2014-11-04 00:26:53 +00:00
|
|
|
|
2014-11-21 21:18:20 +00:00
|
|
|
/*
|
|
|
|
* Close and re-open the current archive.
|
|
|
|
*/
|
2014-11-04 00:26:53 +00:00
|
|
|
void ReopenArchive(void);
|
|
|
|
|
2014-11-21 21:18:20 +00:00
|
|
|
/*
|
|
|
|
* ===== Actions.cpp =====
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Load the requested part.
|
|
|
|
*/
|
2014-11-04 00:26:53 +00:00
|
|
|
void GetFilePart(const GenericEntry* pEntry, int whichThread,
|
|
|
|
ReformatHolder* pHolder) const;
|
|
|
|
|
2014-11-21 21:18:20 +00:00
|
|
|
/*
|
|
|
|
* Handle a bulk extraction.
|
|
|
|
*/
|
2014-11-04 00:26:53 +00:00
|
|
|
void DoBulkExtract(SelectionSet* pSelSet,
|
|
|
|
const ExtractOptionsDialog* pExtOpts);
|
2014-11-21 21:18:20 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Extract a single entry.
|
|
|
|
*
|
|
|
|
* If pHolder is non-NULL, it holds the data from the file, and can be
|
|
|
|
* used for formatted or non-formatted output. If it's NULL, we need to
|
|
|
|
* extract the data ourselves.
|
|
|
|
*
|
|
|
|
* Returns true on success, false on failure.
|
|
|
|
*/
|
2014-11-04 00:26:53 +00:00
|
|
|
bool ExtractEntry(GenericEntry* pEntry, int thread,
|
|
|
|
ReformatHolder* pHolder, const ExtractOptionsDialog* pExtOpts,
|
|
|
|
bool* pOverwriteExisting, bool* pOvwrForAll);
|
2014-11-21 21:18:20 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Open an output file.
|
|
|
|
*
|
|
|
|
* "outputPath" holds the name of the file to create. "origPath" is the
|
|
|
|
* name as it was stored in the archive. "pOverwriteExisting" tells us
|
|
|
|
* if we should just go ahead and overwrite the existing file, while
|
|
|
|
* "pOvwrForAll" tells us if a "To All" button was hit previously.
|
|
|
|
*
|
|
|
|
* If the file exists, *pOverwriteExisting is false, and *pOvwrForAll
|
|
|
|
* is false, then we will put up the "do you want to overwrite?" dialog.
|
|
|
|
* One possible outcome of the dialog is renaming the output path.
|
|
|
|
*
|
|
|
|
* On success, *pFp will be non-NULL, and IDOK will be returned. On
|
|
|
|
* failure, IDCANCEL will be returned. The values in *pOverwriteExisting
|
|
|
|
* and *pOvwrForAll may be updated, and *pOutputPath will change if
|
|
|
|
* the user chose to rename the file.
|
|
|
|
*/
|
2014-11-04 00:26:53 +00:00
|
|
|
int OpenOutputFile(CString* pOutputPath, const PathProposal& pathProp,
|
|
|
|
time_t arcFileModWhen, bool* pOverwriteExisting, bool* pOvwrForAll,
|
|
|
|
FILE** pFp);
|
2014-11-21 21:18:20 +00:00
|
|
|
|
2014-11-04 00:26:53 +00:00
|
|
|
bool DoBulkRecompress(ActionProgressDialog* pActionProgress,
|
|
|
|
SelectionSet* pSelSet, const RecompressOptionsDialog* pRecompOpts);
|
2014-11-21 21:18:20 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Compute the total size of all files in the GenericArchive.
|
|
|
|
*/
|
2014-11-04 00:26:53 +00:00
|
|
|
void CalcTotalSize(LONGLONG* pUncomp, LONGLONG* pComp) const;
|
|
|
|
|
2014-11-21 21:18:20 +00:00
|
|
|
/*
|
|
|
|
* Print a ContentList.
|
|
|
|
*/
|
|
|
|
void PrintListing(const ContentList* pContentList);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* ===== Clipboard.cpp =====
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Create a list of selected files.
|
|
|
|
*
|
|
|
|
* The returned string uses tab-delineated fields with CSV-style quoting
|
|
|
|
* around the filename (so that double quotes in the filename don't confuse
|
|
|
|
* applications like MS Excel).
|
|
|
|
*/
|
2014-11-04 00:26:53 +00:00
|
|
|
CString CreateFileList(SelectionSet* pSelSet);
|
2014-11-21 21:18:20 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Double-up all double quotes.
|
|
|
|
*/
|
Large set of changes to restore CiderPress build.
CiderPress and MDC now compile, and execute far enough to open
their respective "about" boxes, but I doubt they'll do much
more than that.
* Switch from MBCS to UNICODE APIs
Microsoft switched to UTF-16 (by way of UCS-2) a long time ago,
and the support for MBCS seems to be getting phased out. So it's
time to switch to wide strings.
This is a bit awkward for CiderPress because it works with disk
and file archives with 8-bit filenames, and I want NufxLib and
DiskImgLib to continue to work on Linux (which has largely taken
the UTF-8 approach to Unicode). The libraries will continue to
work with 8-bit filenames, with CiderPress/MDC doing the
conversion at the appropriate point.
There were a couple of places where strings from a structure
handed back by one of the libraries were used directly in the UI,
or vice-versa, which is a problem because we have nowhere to
store the result of the conversion. These currently have fixed
place-holder "xyzzy" strings.
All UI strings are now wide.
Various format strings now use "%ls" and "%hs" to explicitly
specify wide and narrow. This doesn't play well with gcc, so
only the Windows-specific parts use those.
* Various updates to vcxproj files
The project-file conversion had some cruft that is now largely
gone. The build now has a common output directory for the EXEs
and libraries, avoiding the old post-build copy steps.
* Added zlib 1.2.8 and nufxlib 2.2.2 source snapshots
The old "prebuilts" directory is now gone. The libraries are now
built as part of building the apps.
I added a minimal set of files for zlib, and a full set for nufxlib.
The Linux-specific nufxlib goodies are included for the benefit of
the Linux utilities, which are currently broken (don't build).
* Replace symbols used for include guards
Symbols with a leading "__" are reserved.
2014-11-10 23:32:55 +00:00
|
|
|
static CString DblDblQuote(const WCHAR* str);
|
2014-11-21 21:18:20 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Compute the size of everything currently on the clipboard.
|
|
|
|
*/
|
2014-11-04 00:26:53 +00:00
|
|
|
long GetClipboardContentLen(void);
|
2014-11-21 21:18:20 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Create the file collection.
|
|
|
|
*/
|
2014-11-04 00:26:53 +00:00
|
|
|
HGLOBAL CreateFileCollection(SelectionSet* pSelSet);
|
2014-11-21 21:18:20 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Copy the contents of the file referred to by "pEntry" into the buffer
|
|
|
|
* "*pBuf", which has "*pBufLen" bytes in it.
|
|
|
|
*
|
|
|
|
* The call fails if "*pBufLen" isn't large enough.
|
|
|
|
*
|
|
|
|
* Returns an empty string on success, or an error message on failure.
|
|
|
|
* On success, "*pBuf" will be advanced past the data added, and "*pBufLen"
|
|
|
|
* will be reduced by the amount of data copied into "buf".
|
|
|
|
*/
|
2014-11-04 00:26:53 +00:00
|
|
|
CString CopyToCollection(GenericEntry* pEntry, void** pBuf, long* pBufLen);
|
2014-11-21 21:18:20 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Do some prep work and then call ProcessClipboard to copy files in.
|
|
|
|
*/
|
2014-11-04 00:26:53 +00:00
|
|
|
void DoPaste(bool pasteJunkPaths);
|
2014-11-21 21:18:20 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Process the data in the clipboard.
|
|
|
|
*
|
|
|
|
* Returns an empty string on success, or an error message on failure.
|
|
|
|
*/
|
2014-11-04 00:26:53 +00:00
|
|
|
CString ProcessClipboard(const void* vbuf, long bufLen,
|
|
|
|
bool pasteJunkPaths);
|
|
|
|
|
2014-11-21 21:18:20 +00:00
|
|
|
/*
|
|
|
|
* Process a single clipboard entry.
|
|
|
|
*
|
|
|
|
* On entry, "buf" points to the start of the first chunk of data (either
|
|
|
|
* data fork or resource fork). If the file has empty forks or is a
|
|
|
|
* subdirectory, then "buf" is actually pointing at the start of the
|
|
|
|
* next entry.
|
|
|
|
*/
|
|
|
|
CString ProcessClipboardEntry(const FileCollectionEntry* pCollEnt,
|
|
|
|
const WCHAR* pathName, const uint8_t* buf, long remLen);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* ===== Tools.cpp =====
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Determines the settings we need to pass into DiskImgLib to create the
|
|
|
|
* desired disk image format.
|
|
|
|
*
|
|
|
|
* Returns 0 on success, -1 on failure.
|
|
|
|
*/
|
2014-11-04 00:26:53 +00:00
|
|
|
int DetermineImageSettings(int convertIdx, bool addGzip,
|
|
|
|
DiskImg::OuterFormat* pOuterFormat, DiskImg::FileFormat* pFileFormat,
|
|
|
|
DiskImg::PhysicalFormat* pPhysicalFormat,
|
|
|
|
DiskImg::SectorOrder* pSectorOrder);
|
2014-11-21 21:18:20 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Converts one image during a bulk conversion.
|
|
|
|
*
|
|
|
|
* On failure, the reason for failure is stuffed into "*pErrMsg".
|
|
|
|
*/
|
Large set of changes to restore CiderPress build.
CiderPress and MDC now compile, and execute far enough to open
their respective "about" boxes, but I doubt they'll do much
more than that.
* Switch from MBCS to UNICODE APIs
Microsoft switched to UTF-16 (by way of UCS-2) a long time ago,
and the support for MBCS seems to be getting phased out. So it's
time to switch to wide strings.
This is a bit awkward for CiderPress because it works with disk
and file archives with 8-bit filenames, and I want NufxLib and
DiskImgLib to continue to work on Linux (which has largely taken
the UTF-8 approach to Unicode). The libraries will continue to
work with 8-bit filenames, with CiderPress/MDC doing the
conversion at the appropriate point.
There were a couple of places where strings from a structure
handed back by one of the libraries were used directly in the UI,
or vice-versa, which is a problem because we have nowhere to
store the result of the conversion. These currently have fixed
place-holder "xyzzy" strings.
All UI strings are now wide.
Various format strings now use "%ls" and "%hs" to explicitly
specify wide and narrow. This doesn't play well with gcc, so
only the Windows-specific parts use those.
* Various updates to vcxproj files
The project-file conversion had some cruft that is now largely
gone. The build now has a common output directory for the EXEs
and libraries, avoiding the old post-build copy steps.
* Added zlib 1.2.8 and nufxlib 2.2.2 source snapshots
The old "prebuilts" directory is now gone. The libraries are now
built as part of building the apps.
I added a minimal set of files for zlib, and a full set for nufxlib.
The Linux-specific nufxlib goodies are included for the benefit of
the Linux utilities, which are currently broken (don't build).
* Replace symbols used for include guards
Symbols with a leading "__" are reserved.
2014-11-10 23:32:55 +00:00
|
|
|
void BulkConvertImage(const WCHAR* pathName, const WCHAR* targetDir,
|
2014-11-04 00:26:53 +00:00
|
|
|
const DiskConvertDialog& convDlg, CString* pErrMsg);
|
2014-11-21 21:18:20 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Opens one of the SST images. Configures "pDiskImg" appropriately.
|
|
|
|
*
|
|
|
|
* Returns 0 on success, nonzero on failure.
|
|
|
|
*/
|
2014-11-04 00:26:53 +00:00
|
|
|
int SSTOpenImage(int seqNum, DiskImg* pDiskImg);
|
2014-11-21 21:18:20 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Copies 17.5 tracks of data from the SST image to a .NIB image.
|
|
|
|
*
|
|
|
|
* Data is stored in all 16 sectors of track 0, followed by the first
|
|
|
|
* 12 sectors of track 1, then on to track 2. Total of $1a00 bytes.
|
|
|
|
*
|
|
|
|
* Returns 0 on success, -1 on failure.
|
|
|
|
*/
|
2014-11-21 02:10:18 +00:00
|
|
|
int SSTLoadData(int seqNum, DiskImg* pDiskImg, uint8_t* trackBuf,
|
2014-11-04 00:26:53 +00:00
|
|
|
long* pBadCount);
|
2014-11-21 21:18:20 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Compute the destination file offset for a particular source track. The
|
|
|
|
* track number ranges from 0 to 69 inclusive. Sectors from two adjacent
|
|
|
|
* "cooked" tracks are combined into a single "raw nibbilized" track.
|
|
|
|
*
|
|
|
|
* The data is ordered like this:
|
|
|
|
* track 1 sector 15 --> track 1 sector 4 (12 sectors)
|
|
|
|
* track 0 sector 13 --> track 0 sector 0 (14 sectors)
|
|
|
|
*
|
|
|
|
* Total of 26 sectors, or $1a00 bytes.
|
|
|
|
*/
|
2014-11-04 00:26:53 +00:00
|
|
|
long SSTGetBufOffset(int track);
|
2014-11-21 21:18:20 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Count the number of "bad" bytes in the sector.
|
|
|
|
*
|
|
|
|
* Strictly speaking, a "bad" byte is anything that doesn't appear in the
|
|
|
|
* 6&2 decoding table, 5&3 decoding table, special list (D5, AA), and
|
|
|
|
* can't be used as a 4+4 encoding value.
|
|
|
|
*
|
|
|
|
* We just use $80 - $92, which qualify for all of the above.
|
|
|
|
*/
|
2014-11-21 02:10:18 +00:00
|
|
|
long SSTCountBadBytes(const uint8_t* sctBuf, int count);
|
2014-11-21 21:18:20 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Run through the data, adding 0x80 everywhere and re-aligning the
|
|
|
|
* tracks so that the big clump of sync bytes is at the end.
|
|
|
|
*/
|
2014-11-21 02:10:18 +00:00
|
|
|
void SSTProcessTrackData(uint8_t* trackBuf);
|
2014-11-21 21:18:20 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Select a volume and then invoke the volcopy dialog.
|
|
|
|
*/
|
2014-11-04 00:26:53 +00:00
|
|
|
void VolumeCopier(bool openFile);
|
|
|
|
|
2014-11-21 21:18:20 +00:00
|
|
|
/*
|
|
|
|
* Edit the properties of a 2MG file.
|
|
|
|
*
|
|
|
|
* Returns "true" if the file was modified, "false" if not.
|
|
|
|
*/
|
|
|
|
bool EditTwoImgProps(const WCHAR* fileName);
|
2014-11-04 00:26:53 +00:00
|
|
|
|
|
|
|
|
|
|
|
// set when one of the tools modifies the file we have open
|
|
|
|
bool fNeedReopen;
|
|
|
|
|
|
|
|
CToolBar fToolBar;
|
|
|
|
CStatusBar fStatusBar;
|
|
|
|
|
|
|
|
// currently-open archive, if any
|
|
|
|
GenericArchive* fpOpenArchive;
|
|
|
|
// name of open archive, for display only -- if this is a temporary
|
|
|
|
// file launched from another instance of CP, this won't be the name
|
|
|
|
// of an actual file on disk.
|
|
|
|
CString fOpenArchivePathName; // for display only
|
|
|
|
|
|
|
|
// archive viewer, open when file is open
|
|
|
|
// NOTE: make a super-class for a tree-structured display or other
|
|
|
|
// kinds of display, so we can avoid the if/then/else. Rename
|
|
|
|
// ContentList to DetailList or FlatList or something.
|
|
|
|
ContentList* fpContentList;
|
|
|
|
|
|
|
|
// currently selected set of goodies; used when viewing, extracting, etc.
|
|
|
|
//SelectionSet* fpSelSet;
|
|
|
|
|
|
|
|
// action progress meter, if any
|
|
|
|
ActionProgressDialog* fpActionProgress;
|
|
|
|
|
|
|
|
// progress counter meter, if any
|
|
|
|
ProgressCounterDialog* fpProgressCounter;
|
|
|
|
|
|
|
|
// modeless standard "find" dialog
|
|
|
|
CFindReplaceDialog* fpFindDialog;
|
|
|
|
CString fFindLastStr;
|
|
|
|
bool fFindDown;
|
|
|
|
bool fFindMatchCase;
|
|
|
|
bool fFindMatchWholeWord;
|
|
|
|
|
|
|
|
// our preferences
|
|
|
|
Preferences fPreferences;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Manage a list of files that must be deleted before we exit.
|
|
|
|
*/
|
|
|
|
class DeleteList {
|
|
|
|
private:
|
|
|
|
class DeleteListNode {
|
|
|
|
public:
|
|
|
|
DeleteListNode(const CString& name) : fName(name),
|
2014-11-18 05:13:13 +00:00
|
|
|
fPrev(NULL), fNext(NULL) {}
|
2014-11-04 00:26:53 +00:00
|
|
|
~DeleteListNode(void) {}
|
|
|
|
|
|
|
|
DeleteListNode* fPrev;
|
|
|
|
DeleteListNode* fNext;
|
|
|
|
CString fName;
|
|
|
|
};
|
|
|
|
|
|
|
|
public:
|
2014-11-18 05:13:13 +00:00
|
|
|
DeleteList(void) { fHead = NULL; }
|
2014-11-04 00:26:53 +00:00
|
|
|
~DeleteList(void) {
|
2014-11-19 22:54:24 +00:00
|
|
|
LOGD("Processing DeleteList (head=0x%p)", fHead);
|
2014-11-04 00:26:53 +00:00
|
|
|
DeleteListNode* pNode = fHead;
|
|
|
|
DeleteListNode* pNext;
|
|
|
|
|
2014-11-18 05:13:13 +00:00
|
|
|
while (pNode != NULL) {
|
2014-11-04 00:26:53 +00:00
|
|
|
pNext = pNode->fNext;
|
Large set of changes to restore CiderPress build.
CiderPress and MDC now compile, and execute far enough to open
their respective "about" boxes, but I doubt they'll do much
more than that.
* Switch from MBCS to UNICODE APIs
Microsoft switched to UTF-16 (by way of UCS-2) a long time ago,
and the support for MBCS seems to be getting phased out. So it's
time to switch to wide strings.
This is a bit awkward for CiderPress because it works with disk
and file archives with 8-bit filenames, and I want NufxLib and
DiskImgLib to continue to work on Linux (which has largely taken
the UTF-8 approach to Unicode). The libraries will continue to
work with 8-bit filenames, with CiderPress/MDC doing the
conversion at the appropriate point.
There were a couple of places where strings from a structure
handed back by one of the libraries were used directly in the UI,
or vice-versa, which is a problem because we have nowhere to
store the result of the conversion. These currently have fixed
place-holder "xyzzy" strings.
All UI strings are now wide.
Various format strings now use "%ls" and "%hs" to explicitly
specify wide and narrow. This doesn't play well with gcc, so
only the Windows-specific parts use those.
* Various updates to vcxproj files
The project-file conversion had some cruft that is now largely
gone. The build now has a common output directory for the EXEs
and libraries, avoiding the old post-build copy steps.
* Added zlib 1.2.8 and nufxlib 2.2.2 source snapshots
The old "prebuilts" directory is now gone. The libraries are now
built as part of building the apps.
I added a minimal set of files for zlib, and a full set for nufxlib.
The Linux-specific nufxlib goodies are included for the benefit of
the Linux utilities, which are currently broken (don't build).
* Replace symbols used for include guards
Symbols with a leading "__" are reserved.
2014-11-10 23:32:55 +00:00
|
|
|
if (_wunlink(pNode->fName) != 0) {
|
2014-11-19 22:54:24 +00:00
|
|
|
LOGW(" WARNING: delete of '%ls' failed, err=%d",
|
|
|
|
(LPCWSTR) pNode->fName, errno);
|
2014-11-04 00:26:53 +00:00
|
|
|
} else {
|
2014-11-19 22:54:24 +00:00
|
|
|
LOGI(" Deleted '%ls'", (LPCWSTR) pNode->fName);
|
2014-11-04 00:26:53 +00:00
|
|
|
}
|
|
|
|
delete pNode;
|
|
|
|
pNode = pNext;
|
|
|
|
}
|
2014-11-19 22:54:24 +00:00
|
|
|
LOGD("Processing DeleteList completed");
|
2014-11-04 00:26:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void Add(const CString& name) {
|
|
|
|
DeleteListNode* pNode = new DeleteListNode(name);
|
2014-11-18 05:13:13 +00:00
|
|
|
if (fHead != NULL) {
|
2014-11-04 00:26:53 +00:00
|
|
|
fHead->fPrev = pNode;
|
|
|
|
pNode->fNext = fHead;
|
|
|
|
}
|
|
|
|
fHead = pNode;
|
2014-11-18 21:05:15 +00:00
|
|
|
LOGI("Delete-on-exit '%ls'", (LPCWSTR) name);
|
2014-11-04 00:26:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
DeleteListNode* fHead;
|
|
|
|
};
|
|
|
|
DeleteList fDeleteList;
|
|
|
|
|
|
|
|
DECLARE_MESSAGE_MAP()
|
2007-03-27 17:47:10 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#define GET_MAIN_WINDOW() ((MainWindow*)::AfxGetMainWnd())
|
|
|
|
|
|
|
|
#define SET_PROGRESS_BEGIN() ((MainWindow*)::AfxGetMainWnd())->SetProgressBegin()
|
|
|
|
#define SET_PROGRESS_UPDATE(perc) \
|
2014-11-18 05:13:13 +00:00
|
|
|
((MainWindow*)::AfxGetMainWnd())->SetProgressUpdate(perc, NULL, NULL)
|
2007-03-27 17:47:10 +00:00
|
|
|
#define SET_PROGRESS_UPDATE2(perc, oldName, newName) \
|
2014-11-04 00:26:53 +00:00
|
|
|
((MainWindow*)::AfxGetMainWnd())->SetProgressUpdate(perc, oldName, newName)
|
2007-03-27 17:47:10 +00:00
|
|
|
#define SET_PROGRESS_END() ((MainWindow*)::AfxGetMainWnd())->SetProgressEnd()
|
|
|
|
|
|
|
|
#define SET_PROGRESS_COUNTER(val) \
|
2014-11-18 05:13:13 +00:00
|
|
|
((MainWindow*)::AfxGetMainWnd())->SetProgressCounter(NULL, val)
|
2007-03-27 17:47:10 +00:00
|
|
|
#define SET_PROGRESS_COUNTER_2(fmt, val) \
|
2014-11-04 00:26:53 +00:00
|
|
|
((MainWindow*)::AfxGetMainWnd())->SetProgressCounter(fmt, val)
|
2007-03-27 17:47:10 +00:00
|
|
|
|
|
|
|
#define GET_PREFERENCES() ((MainWindow*)::AfxGetMainWnd())->GetPreferences()
|
|
|
|
#define GET_PREFERENCES_WR() ((MainWindow*)::AfxGetMainWnd())->GetPreferencesWr()
|
|
|
|
|
Large set of changes to restore CiderPress build.
CiderPress and MDC now compile, and execute far enough to open
their respective "about" boxes, but I doubt they'll do much
more than that.
* Switch from MBCS to UNICODE APIs
Microsoft switched to UTF-16 (by way of UCS-2) a long time ago,
and the support for MBCS seems to be getting phased out. So it's
time to switch to wide strings.
This is a bit awkward for CiderPress because it works with disk
and file archives with 8-bit filenames, and I want NufxLib and
DiskImgLib to continue to work on Linux (which has largely taken
the UTF-8 approach to Unicode). The libraries will continue to
work with 8-bit filenames, with CiderPress/MDC doing the
conversion at the appropriate point.
There were a couple of places where strings from a structure
handed back by one of the libraries were used directly in the UI,
or vice-versa, which is a problem because we have nowhere to
store the result of the conversion. These currently have fixed
place-holder "xyzzy" strings.
All UI strings are now wide.
Various format strings now use "%ls" and "%hs" to explicitly
specify wide and narrow. This doesn't play well with gcc, so
only the Windows-specific parts use those.
* Various updates to vcxproj files
The project-file conversion had some cruft that is now largely
gone. The build now has a common output directory for the EXEs
and libraries, avoiding the old post-build copy steps.
* Added zlib 1.2.8 and nufxlib 2.2.2 source snapshots
The old "prebuilts" directory is now gone. The libraries are now
built as part of building the apps.
I added a minimal set of files for zlib, and a full set for nufxlib.
The Linux-specific nufxlib goodies are included for the benefit of
the Linux utilities, which are currently broken (don't build).
* Replace symbols used for include guards
Symbols with a leading "__" are reserved.
2014-11-10 23:32:55 +00:00
|
|
|
#endif /*APP_MAIN_H*/
|