Cxbx-Reloaded/Include/Win32/Cxbx/WndMain.h

189 lines
7.9 KiB
C
Raw Normal View History

2003-01-26 06:18:56 +00:00
// ******************************************************************
// *
// * .,-::::: .,:: .::::::::. .,:: .:
// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;;
// * [[[ '[[,,[[' [[[__[[\. '[[,,[['
// * $$$ Y$$$P $$""""Y$$ Y$$$P
// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo,
// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm,
// *
// * Cxbx->Win32->Cxbx->WndMain.h
// *
// * This file is part of the Cxbx project.
// *
// * Cxbx and Cxbe are free software; you can redistribute them
// * and/or modify them under the terms of the GNU General Public
// * License as published by the Free Software Foundation; either
// * version 2 of the license, or (at your option) any later version.
// *
// * This program is distributed in the hope that it will be useful,
// * but WITHOUT ANY WARRANTY; without even the implied warranty of
// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// * GNU General Public License for more details.
// *
// * You should have recieved a copy of the GNU General Public License
// * along with this program; see the file COPYING.
// * If not, write to the Free Software Foundation, Inc.,
// * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA.
// *
// * (c) 2002-2003 Aaron Robinson <caustik@caustik.com>
// *
// * All rights reserved
// *
// ******************************************************************
#ifndef WNDMAIN_H
#define WNDMAIN_H
#include "Wnd.h"
2003-04-02 02:23:30 +00:00
#include "Exe.h"
#include "Xbe.h"
2003-01-26 06:18:56 +00:00
2003-03-31 23:22:21 +00:00
// ******************************************************************
// * constants
// ******************************************************************
#define RECENT_XBE_SIZE 10
#define RECENT_EXE_SIZE 10
2003-09-02 20:09:24 +00:00
// ******************************************************************
// * AutoConvert methods
// ******************************************************************
enum EnumAutoConvert
{
AUTO_CONVERT_MANUAL = 0,
AUTO_CONVERT_XBE_PATH = 1,
AUTO_CONVERT_WINDOWS_TEMP = 2
};
2003-01-26 06:18:56 +00:00
// ******************************************************************
// * class : WndMain
// ******************************************************************
class WndMain : public Wnd
{
public:
WndMain(HINSTANCE x_hInstance);
~WndMain();
2003-03-09 09:17:07 +00:00
// ******************************************************************
// * window message procedure
// ******************************************************************
2003-01-26 06:18:56 +00:00
LRESULT CALLBACK WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
2003-03-09 09:17:07 +00:00
// ******************************************************************
// * Xbe operations
// ******************************************************************
void OpenXbe(const char *x_filename);
void CloseXbe();
2003-03-09 09:17:07 +00:00
void SaveXbe(const char *x_filename);
void SaveXbeAs();
2003-04-01 02:12:42 +00:00
// ******************************************************************
// * Exe operations
// ******************************************************************
void ImportExe(const char *x_filename);
bool ConvertToExe(const char *x_filename, bool x_bVerifyIfExists);
2003-01-27 05:46:12 +00:00
2003-03-09 09:17:07 +00:00
// ******************************************************************
// * start emulation (converting to .exe if not done already)
// ******************************************************************
2003-09-02 20:09:24 +00:00
void StartEmulation(EnumAutoConvert x_bAutoConvert);
2003-01-27 05:46:12 +00:00
2003-03-09 09:17:07 +00:00
// ******************************************************************
// * accessor
// ******************************************************************
bool isCreated() { return m_bCreated; }
2003-01-26 06:18:56 +00:00
2003-03-09 09:17:07 +00:00
// ******************************************************************
// * suggest appropriate filename based on input
// ******************************************************************
static void SuggestFilename(const char *x_orig_filename, char *x_filename, char x_extension[4]);
2003-01-26 06:18:56 +00:00
private:
2003-03-09 09:17:07 +00:00
// ******************************************************************
// * after an xbe is loaded, some things must be updated
// ******************************************************************
void XbeLoaded();
// ******************************************************************
// * refresh the logo in the main window
// ******************************************************************
void LoadLogo();
2003-03-23 04:03:15 +00:00
// ******************************************************************
// * refresh all menus (checks, enabled, disabled, etc)
// ******************************************************************
void RefreshMenus();
2003-03-09 09:17:07 +00:00
// ******************************************************************
// * allocate / deallocate debug consoles
// ******************************************************************
void UpdateDebugConsoles();
2003-03-31 23:22:21 +00:00
// ******************************************************************
// * update menu containing list of recent files
// ******************************************************************
void UpdateRecentFiles();
2003-03-09 09:17:07 +00:00
// ******************************************************************
// * drawing information
// ******************************************************************
HDC m_BackDC;
HDC m_LogoDC;
HBITMAP m_OrigBmp;
HBITMAP m_OrigLogo;
HBITMAP m_BackBmp;
HBITMAP m_LogoBmp;
// ******************************************************************
// * Xbe/Exe objects
// ******************************************************************
Xbe *m_Xbe;
Exe *m_Exe;
// ******************************************************************
// * changes remembered for internal purposes
// ******************************************************************
bool m_bXbeChanged;
bool m_bExeChanged;
// ******************************************************************
// * cached filenames
// ******************************************************************
2003-01-29 23:59:07 +00:00
char *m_XbeFilename;
char *m_ExeFilename;
2003-01-26 06:18:56 +00:00
2003-03-23 04:03:15 +00:00
// ******************************************************************
// * should emulation always auto-create the .exe?
// ******************************************************************
2003-09-02 20:09:24 +00:00
EnumAutoConvert m_AutoConvertToExe;
2003-03-23 04:03:15 +00:00
2003-03-31 23:22:21 +00:00
// ******************************************************************
// * Recent Xbe files
// ******************************************************************
int m_dwRecentXbe;
char *m_szRecentXbe[RECENT_XBE_SIZE];
// ******************************************************************
// * Recent Exe files
// ******************************************************************
int m_dwRecentExe;
char *m_szRecentExe[RECENT_EXE_SIZE];
2003-03-09 09:17:07 +00:00
// ******************************************************************
// * is this window fully initialized?
// ******************************************************************
bool m_bCreated;
2003-03-09 09:17:07 +00:00
// ******************************************************************
// * current debug mode type
// ******************************************************************
DebugMode m_CxbxDebug;
DebugMode m_KrnlDebug;
2003-01-29 23:59:07 +00:00
2003-03-09 09:17:07 +00:00
// ******************************************************************
// * debug output filenames
// ******************************************************************
2003-01-29 23:59:07 +00:00
char *m_CxbxDebugFilename;
char *m_KrnlDebugFilename;
2003-01-26 06:18:56 +00:00
};
#endif