~ubuntu-branches/debian/sid/mame/sid

« back to all changes in this revision

Viewing changes to mess/src/osd/winui/layoutms.c

  • Committer: Package Import Robot
  • Author(s): Jordi Mallach, Jordi Mallach, Emmanuel Kasper
  • Date: 2011-12-19 22:56:27 UTC
  • mfrom: (0.1.2)
  • Revision ID: package-import@ubuntu.com-20111219225627-ub5oga1oys4ogqzm
Tags: 0.144-1
[ Jordi Mallach ]
* Fix syntax errors in DEP5 copyright file (lintian).
* Use a versioned copyright Format specification field.
* Update Vcs-* URLs.
* Move transitional packages to the new metapackages section, and make
  them priority extra.
* Remove references to GNU/Linux and MESS sources from copyright.
* Add build variables for s390x.
* Use .xz tarballs as it cuts 4MB for the upstream sources.
* Add nplayers.ini as a patch. Update copyright file to add CC-BY-SA-3.0.

[ Emmanuel Kasper ]
* New upstream release. Closes: #651538.
* Add Free Desktop compliant png icons of various sizes taken from
  the hydroxygen iconset
* Mess is now built from a new source package, to avoid possible source
  incompatibilities between mame and the mess overlay.
* Mame-tools are not built from the mame source package anymore, but
  from the mess source package

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/***************************************************************************
2
 
 
3
 
  layoutms.c
4
 
 
5
 
  MESS specific TreeView definitions (and maybe more in the future)
6
 
 
7
 
***************************************************************************/
8
 
 
9
 
#define WIN32_LEAN_AND_MEAN
10
 
#include <windows.h>
11
 
#include <windowsx.h>
12
 
#include <shellapi.h>
13
 
#include <commctrl.h>
14
 
#include <stdio.h>  /* for sprintf */
15
 
#include <stdlib.h> /* For malloc and free */
16
 
#include <string.h>
17
 
 
18
 
#include "emu.h"
19
 
#include "bitmask.h"
20
 
#include "TreeView.h"
21
 
#include "mui_util.h"
22
 
#include "resource.h"
23
 
#include "directories.h"
24
 
#include "mui_opts.h"
25
 
#include "splitters.h"
26
 
#include "help.h"
27
 
#include "mui_audit.h"
28
 
#include "screenshot.h"
29
 
#include "winui.h"
30
 
#include "properties.h"
31
 
#include "optionsms.h"
32
 
 
33
 
#include "msuiutil.h"
34
 
#include "resourcems.h"
35
 
#include "propertiesms.h"
36
 
 
37
 
static BOOL FilterAvailable(int driver_index);
38
 
 
39
 
extern const FOLDERDATA g_folderData[] =
40
 
{
41
 
        {"All Systems",     "allgames",          FOLDER_ALLGAMES,     IDI_FOLDER,                               0,             0,            NULL,                       NULL,              TRUE },
42
 
        {"Available",       "available",         FOLDER_AVAILABLE,    IDI_FOLDER_AVAILABLE,     F_AVAILABLE,   0,            NULL,                       FilterAvailable,              TRUE },
43
 
#ifdef SHOW_UNAVAILABLE_FOLDER
44
 
        {"Unavailable",     "unavailable",       FOLDER_UNAVAILABLE,  IDI_FOLDER_UNAVAILABLE,   0,             F_AVAILABLE,  NULL,                       FilterAvailable,              FALSE },
45
 
#endif
46
 
        {"Console",         "console",           FOLDER_CONSOLE,      IDI_FOLDER,             F_CONSOLE,     F_COMPUTER,   NULL,                       DriverIsConsole,  TRUE },
47
 
        {"Computer",        "computer",          FOLDER_COMPUTER,     IDI_FOLDER,             F_COMPUTER,    F_CONSOLE,    NULL,                       DriverIsComputer,  TRUE },
48
 
        {"Modified/Hacked", "modified",          FOLDER_MODIFIED,     IDI_FOLDER,                               0,             0,            NULL,                       DriverIsModified,  TRUE },
49
 
        {"Manufacturer",    "manufacturer",      FOLDER_MANUFACTURER, IDI_FOLDER_MANUFACTURER,  0,             0,            CreateManufacturerFolders },
50
 
        {"Year",            "year",              FOLDER_YEAR,         IDI_FOLDER_YEAR,          0,             0,            CreateYearFolders },
51
 
        {"Source",          "source",            FOLDER_SOURCE,       IDI_FOLDER_SOURCE,        0,             0,            CreateSourceFolders },
52
 
        {"CPU",             "cpu",               FOLDER_CPU,          IDI_FOLDER,               0,             0,            CreateCPUFolders },
53
 
        {"Sound",           "sound",             FOLDER_SND,          IDI_FOLDER,               0,             0,            CreateSoundFolders },
54
 
        {"Imperfect",       "imperfect",         FOLDER_DEFICIENCY,   IDI_FOLDER,               0,             0,            CreateDeficiencyFolders },
55
 
        {"Dumping Status",  "dumping",           FOLDER_DUMPING,      IDI_FOLDER,               0,             0,            CreateDumpingFolders },
56
 
        {"Working",         "working",           FOLDER_WORKING,      IDI_WORKING,              F_WORKING,     F_NONWORKING, NULL,                       DriverIsBroken,    FALSE },
57
 
        {"Not Working",     "nonworking",        FOLDER_NONWORKING,   IDI_NONWORKING,           F_NONWORKING,  F_WORKING,    NULL,                       DriverIsBroken,    TRUE },
58
 
        {"Originals",       "originals",         FOLDER_ORIGINAL,     IDI_FOLDER,               F_ORIGINALS,   F_CLONES,     NULL,                       DriverIsClone,     FALSE },
59
 
        {"Clones",          "clones",            FOLDER_CLONES,       IDI_FOLDER,               F_CLONES,      F_ORIGINALS,  NULL,                       DriverIsClone,     TRUE },
60
 
        {"Raster",          "raster",            FOLDER_RASTER,       IDI_FOLDER,               F_RASTER,      F_VECTOR,     NULL,                       DriverIsVector,    FALSE },
61
 
        {"Vector",          "vector",            FOLDER_VECTOR,       IDI_FOLDER,               F_VECTOR,      F_RASTER,     NULL,                       DriverIsVector,    TRUE },
62
 
        {"Mouse",           "mouse",             FOLDER_MOUSE,        IDI_FOLDER,               0,             0,            NULL,                       DriverUsesMouse,       TRUE },
63
 
        {"Trackball",       "trackball",         FOLDER_TRACKBALL,    IDI_FOLDER,               0,             0,            NULL,                       DriverUsesTrackball,   TRUE },
64
 
        {"Stereo",          "stereo",            FOLDER_STEREO,       IDI_SOUND,                0,             0,            NULL,                       DriverIsStereo,    TRUE },
65
 
        { NULL }
66
 
};
67
 
 
68
 
/* list of filter/control Id pairs */
69
 
extern const FILTER_ITEM g_filterList[] =
70
 
{
71
 
        { F_COMPUTER,     IDC_FILTER_COMPUTER,    DriverIsComputer, TRUE },
72
 
        { F_CONSOLE,      IDC_FILTER_CONSOLE,     DriverIsConsole, TRUE },
73
 
        { F_MODIFIED,     IDC_FILTER_MODIFIED,    DriverIsModified, TRUE },
74
 
        { F_CLONES,       IDC_FILTER_CLONES,      DriverIsClone, TRUE },
75
 
        { F_NONWORKING,   IDC_FILTER_NONWORKING,  DriverIsBroken, TRUE },
76
 
        { F_UNAVAILABLE,  IDC_FILTER_UNAVAILABLE, FilterAvailable, FALSE },
77
 
        { F_RASTER,       IDC_FILTER_RASTER,      DriverIsVector, FALSE },
78
 
        { F_VECTOR,       IDC_FILTER_VECTOR,      DriverIsVector, TRUE },
79
 
        { F_ORIGINALS,    IDC_FILTER_ORIGINALS,   DriverIsClone, FALSE },
80
 
        { F_WORKING,      IDC_FILTER_WORKING,     DriverIsBroken, FALSE },
81
 
        { F_AVAILABLE,    IDC_FILTER_AVAILABLE,   FilterAvailable, TRUE },
82
 
        { 0 }
83
 
};
84
 
 
85
 
extern const DIRECTORYINFO g_directoryInfo[] =
86
 
{
87
 
        { "ROMs",                  GetRomDirs,         SetRomDirs,         TRUE,  DIRDLG_ROMS },
88
 
        { "Software",              GetSoftwareDirs,    SetSoftwareDirs,    TRUE,  DIRDLG_SOFTWARE },
89
 
        { "Artwork",               GetArtDir,          SetArtDir,          FALSE, 0 },
90
 
        { "Background Images",     GetBgDir,           SetBgDir,           FALSE, 0 },
91
 
        { "Cabinets",              GetCabinetDir,      SetCabinetDir,      FALSE, 0 },
92
 
        { "Cheats",                GetCheatDir,        SetCheatDir,        FALSE, DIRDLG_CHEAT },
93
 
        { "Comment Files",         GetCommentDir,      SetCommentDir,      FALSE, DIRDLG_COMMENT },
94
 
        { "Config",                GetCfgDir,          SetCfgDir,          FALSE, DIRDLG_CFG },
95
 
        { "Control Panels",        GetControlPanelDir, SetControlPanelDir, FALSE, 0 },
96
 
        { "Controller Files",      GetCtrlrDir,        SetCtrlrDir,        FALSE, DIRDLG_CTRLR },
97
 
        { "Crosshairs",            GetCrosshairDir,    SetCrosshairDir,    FALSE, 0 },
98
 
        { "Fonts",                 GetFontDir,         SetFontDir,         FALSE, 0 },
99
 
        { "Flyers",                GetFlyerDir,        SetFlyerDir,        FALSE, 0 },
100
 
        { "Hash",                  GetHashDirs,        SetHashDirs,        FALSE, 0 },
101
 
        { "Hard Drive Difference", GetDiffDir,         SetDiffDir,         FALSE, 0 },
102
 
        { "Icons",                 GetIconsDir,        SetIconsDir,        FALSE, 0 },
103
 
        { "Ini Files",             GetIniDir,          SetIniDir,          FALSE, DIRDLG_INI },
104
 
        { "Input files",           GetInpDir,          SetInpDir,          FALSE, DIRDLG_INP },
105
 
        { "Marquees",              GetMarqueeDir,      SetMarqueeDir,      FALSE, 0 },
106
 
        { "Memory Card",           GetMemcardDir,      SetMemcardDir,      FALSE, 0 },
107
 
        { "NVRAM",                 GetNvramDir,        SetNvramDir,        FALSE, 0 },
108
 
        { "PCBs",                  GetPcbDir,          SetPcbDir,          FALSE, 0 },
109
 
        { "Snapshots",             GetImgDir,          SetImgDir,          FALSE, DIRDLG_IMG },
110
 
        { "State",                 GetStateDir,        SetStateDir,        FALSE, 0 },
111
 
        { "Titles",                GetTitlesDir,       SetTitlesDir,       FALSE, 0 },
112
 
        { NULL }
113
 
};
114
 
 
115
 
extern const SPLITTERINFO g_splitterInfo[] =
116
 
{
117
 
        { 0.2,  IDC_SPLITTER,   IDC_TREE,       IDC_LIST,               AdjustSplitter1Rect },
118
 
        { 0.4,  IDC_SPLITTER2,  IDC_LIST,       IDC_SWLIST,             AdjustSplitter1Rect },
119
 
        { 0.6,  IDC_SPLITTER3,  IDC_SWTAB,      IDC_SSFRAME,    AdjustSplitter2Rect },
120
 
        { -1 }
121
 
};
122
 
 
123
 
extern const MAMEHELPINFO g_helpInfo[] =
124
 
{
125
 
        { ID_HELP_CONTENTS,             TRUE,   "mess.chm::/windows/main.htm" },
126
 
        { ID_HELP_RELEASE,              TRUE,   "mess.chm" },
127
 
        { ID_HELP_WHATS_NEW,    TRUE,   "mess.chm::/messnew.txt" },
128
 
        { -1 }
129
 
};
130
 
 
131
 
extern const PROPERTYSHEETINFO g_propSheets[] =
132
 
{
133
 
        { FALSE,        NULL,                                   IDD_PROP_GAME,                  GamePropertiesDialogProc },
134
 
        { FALSE,        NULL,                                   IDD_PROP_AUDIT,                 GameAuditDialogProc },
135
 
        { TRUE,         NULL,                                   IDD_PROP_DISPLAY,               GameOptionsProc },
136
 
        { FALSE,        NULL,                                   IDD_PROP_HLSL,                  GameOptionsProc },
137
 
        { TRUE,         NULL,                                   IDD_PROP_ADVANCED,              GameOptionsProc },
138
 
        { TRUE,         NULL,                                   IDD_PROP_SCREEN,                GameOptionsProc },
139
 
        { TRUE,         NULL,                                   IDD_PROP_SOUND,                 GameOptionsProc },
140
 
        { TRUE,         NULL,                                   IDD_PROP_INPUT,                 GameOptionsProc },
141
 
        { TRUE,         NULL,                                   IDD_PROP_CONTROLLER,    GameOptionsProc },
142
 
        { TRUE,         NULL,                                   IDD_PROP_DEBUG,                 GameOptionsProc },
143
 
        { TRUE,         NULL,                                   IDD_PROP_MISC,                  GameOptionsProc },
144
 
        { FALSE,        NULL,                                   IDD_PROP_SOFTWARE,              GameMessOptionsProc },
145
 
        { FALSE,        PropSheetFilter_Config, IDD_PROP_CONFIGURATION, GameMessOptionsProc },
146
 
        { TRUE,         PropSheetFilter_Vector, IDD_PROP_VECTOR,                GameOptionsProc },
147
 
        { FALSE }
148
 
};
149
 
 
150
 
extern const ICONDATA g_iconData[] =
151
 
{
152
 
        { IDI_WIN_NOROMS,                       "noroms" },
153
 
        { IDI_WIN_ROMS,                         "roms" },
154
 
        { IDI_WIN_UNKNOWN,                      "unknown" },
155
 
        { IDI_WIN_CLONE,                        "clone" },
156
 
        { IDI_WIN_REDX,                         "warning" },
157
 
        { IDI_WIN_NOROMSNEEDED,         "noromsneeded" },
158
 
        { IDI_WIN_MISSINGOPTROM,        "missingoptrom" },
159
 
        { IDI_WIN_FLOP,                         "floppy" },
160
 
        { IDI_WIN_CASS,                         "cassette" },
161
 
        { IDI_WIN_SERL,                         "serial" },
162
 
        { IDI_WIN_SNAP,                         "snapshot" },
163
 
        { IDI_WIN_PRIN,                         "printer" },
164
 
        { IDI_WIN_HARD,                         "hard" },
165
 
        { 0 }
166
 
};
167
 
 
168
 
extern const TCHAR g_szPlayGameString[] = TEXT("&Run %s");
169
 
extern const char g_szGameCountString[] = "%d systems";
170
 
static const char g_szHistoryFileName[] = "sysinfo.dat";
171
 
static const char g_szMameInfoFileName[] = "messinfo.dat";
172
 
 
173
 
static BOOL FilterAvailable(int driver_index)
174
 
{
175
 
        return !DriverUsesRoms(driver_index) || IsAuditResultYes(GetRomAuditResults(driver_index));
176
 
}