Previous 15994 Revisions Next

r2471 Friday 25th April, 2008 at 13:38:28 UTC by Nathan Woods
[Windows GUI] Cleanups; removed pointless code
[src/mess/osd/winui]messui.c

src/mess/osd/winui/messui.c
r2470r2471
44//
55//============================================================
66
7// standard windows headers
78#define WIN32_LEAN_AND_MEAN
89#include <assert.h>
910#include <string.h>
r2470r2471
1516#include <winuser.h>
1617#include <tchar.h>
1718
19// MAME/MAMEOS/MAMEUI/MESS headers
1820#include "screenshot.h"
1921#include "bitmask.h"
2022#include "winui.h"
r2470r2471
3436#include "messui.h"
3537#include "winutf8.h"
3638
39
40//============================================================
41//  PARAMETERS
42//============================================================
43
3744#define LOG_SOFTWARE   0
3845
39static void SoftwarePicker_OnHeaderContextMenu(POINT pt, int nColumn);
4046
41static LPCSTR SoftwareTabView_GetTabShortName(int tab);
42static LPCSTR SoftwareTabView_GetTabLongName(int tab);
43static void SoftwareTabView_OnSelectionChanged(void);
44static void SoftwareTabView_OnMoveSize(void);
45static void SetupSoftwareTabView(void);
47//============================================================
48//  TYPEDEFS
49//============================================================
4650
51typedef struct _mess_image_type mess_image_type;
52struct _mess_image_type
53{
54   const device_config *dev;
55    const char *ext;
56};
57
58
59typedef struct _device_entry device_entry;
60struct _device_entry
61{
62   iodevice_t dev_type;
63   const char *icon_name;
64   const char *dlgname;
65};
66
67
68
69
70//============================================================
71//  GLOBAL VARIABLES
72//============================================================
73
74char g_szSelectedItem[MAX_PATH];
75
76
77
78//============================================================
79//  LOCAL VARIABLES
80//============================================================
81
82static int s_nGame;
83static BOOL s_bIgnoreSoftwarePickerNotifies;
84
85static int *mess_icon_index;
86
87// TODO - We need to make icons for Cylinders, Punch Cards, and Punch Tape!
88static const device_entry s_devices[] =
89{
90   { IO_CARTSLOT,   "roms",      "Cartridge images" },
91   { IO_FLOPPY,   "floppy",   "Floppy disk images" },
92   { IO_HARDDISK,   "hard",      "Hard disk images" },
93   { IO_CYLINDER,   NULL,      "Cylinders" },
94   { IO_CASSETTE,   NULL,      "Cassette images" },
95   { IO_PUNCHCARD,   NULL,      "Punchcard images" },
96   { IO_PUNCHTAPE,   NULL,      "Punchtape images" },
97   { IO_PRINTER,   NULL,      "Printer Output" },
98   { IO_SERIAL,   NULL,      "Serial Output" },
99   { IO_PARALLEL,   NULL,      "Parallel Output" },
100   { IO_SNAPSHOT,   "snapshot",   "Snapshots" },
101   { IO_QUICKLOAD,   "snapshot",   "Quickloads" },
102   { IO_MEMCARD,   NULL,      "Memory cards" },
103   { IO_CDROM,      NULL,      "CD-ROM images" }
104};
105
106
107
47108static const LPCTSTR mess_column_names[] =
48109{
49110   TEXT("Software"),
r2470r2471
56117   TEXT("MD5")
57118};
58119
59static int *mess_icon_index;
60120
121
122//============================================================
123//  PROTOTYPES
124//============================================================
125
126static void SoftwarePicker_OnHeaderContextMenu(POINT pt, int nColumn);
127
128static LPCSTR SoftwareTabView_GetTabShortName(int tab);
129static LPCSTR SoftwareTabView_GetTabLongName(int tab);
130static void SoftwareTabView_OnSelectionChanged(void);
131static void SoftwareTabView_OnMoveSize(void);
132static void SetupSoftwareTabView(void);
133
61134static void MessOpenOtherSoftware(const device_config *dev);
62135static void MessCreateDevice(const device_config *dev);
63136static void MessRefreshPicker(int drvindex);
r2470r2471
75148static void MessTestsBegin(void);
76149#endif /* MAME_DEBUG */
77150
78char g_szSelectedItem[MAX_PATH];
79151
80static int s_nGame;
81static BOOL s_bIgnoreSoftwarePickerNotifies;
82152
83struct deviceentry
84{
85   iodevice_t dev_type;
86   const char *icon_name;
87   const char *dlgname;
88};
153//============================================================
154//  PICKER/TABVIEW CALLBACKS
155//============================================================
89156
90157static const struct PickerCallbacks s_softwareListCallbacks =
91158{
r2470r2471
135202
136203
137204
138// ------------------------------------------------------------------------
139// Image types
205//============================================================
206//  Image types
140207//
141// IO_ZIP is used for ZIP files
142// IO_ALIAS is used for unknown types
143// IO_COUNT is used for bad files
144// ------------------------------------------------------------------------
208//   IO_ZIP is used for ZIP files
209//   IO_UNKNOWN is used for unknown types
210//   IO_BAD is used for bad files
211//============================================================
145212
146213#define IO_ZIP      (IO_COUNT + 0)
147214#define IO_BAD      (IO_COUNT + 1)
148215#define IO_UNKNOWN   (IO_COUNT + 2)
149216
150// TODO - We need to make icons for Cylinders, Punch Cards, and Punch Tape!
151static const struct deviceentry s_devices[] =
152{
153   { IO_CARTSLOT,   "roms",      "Cartridge images" },
154   { IO_FLOPPY,   "floppy",   "Floppy disk images" },
155   { IO_HARDDISK,   "hard",      "Hard disk images" },
156   { IO_CYLINDER,   NULL,      "Cylinders" },
157   { IO_CASSETTE,   NULL,      "Cassette images" },
158   { IO_PUNCHCARD,   NULL,      "Punchcard images" },
159   { IO_PUNCHTAPE,   NULL,      "Punchtape images" },
160   { IO_PRINTER,   NULL,      "Printer Output" },
161   { IO_SERIAL,   NULL,      "Serial Output" },
162   { IO_PARALLEL,   NULL,      "Parallel Output" },
163   { IO_SNAPSHOT,   "snapshot",   "Snapshots" },
164   { IO_QUICKLOAD,   "snapshot",   "Quickloads" },
165   { IO_MEMCARD,   NULL,      "Memory cards" },
166   { IO_CDROM,      NULL,      "CD-ROM images" }
167};
217//============================================================
218//  IMPLEMENTATION
219//============================================================
168220
169
170
171static const struct deviceentry *lookupdevice(iodevice_t d)
221static const device_entry *lookupdevice(iodevice_t d)
172222{
173223   int i;
174224   for (i = 0; i < ARRAY_LENGTH(s_devices); i++)
r2470r2471
181231
182232
183233
184// ------------------------------------------------------------------------
185// UI
186// ------------------------------------------------------------------------
187
188234BOOL CreateMessIcons(void)
189235{
190236    int i;
r2470r2471
572618// Open others dialog
573619// ------------------------------------------------------------------------
574620
575typedef struct
576{
577   const device_config *dev;
578    const char *ext;
579} mess_image_type;
580
581621static BOOL CommonFileImageDialog(LPTSTR the_last_directory, common_file_dialog_proc cfd, LPTSTR filename, const machine_config *config, mess_image_type *imagetypes)
582622{
583623    BOOL success;
r2470r2471
927967   LPCSTR pszName;
928968   LPSTR s;
929969   int drvindex;
930   const device_config *device;
931970   HWND hwndList;
932971
933972   hwndList = GetDlgItem(GetMainWindow(), IDC_LIST);
r2470r2471
942981      pszName = s ? s + 1 : pszFullName;
943982
944983      // Do the dirty work
945      device = SoftwarePicker_LookupDevice(hwndSoftwarePicker, nItem);
946      if (device == NULL)
947         return;
948984      MessSpecifyImage(drvindex, NULL, pszFullName);
949985
950986      // Set up s_szSelecteItem, for the benefit of UpdateScreenShot()

Previous 15994 Revisions Next


© 1998-2018 The MESS Team