Describe tabs being linked together.
[wine] / programs / winecfg / properties.c
1 /*
2  * WineCfg properties management
3  *
4  * Copyright 2002 Jaco Greeff
5  * Copyright 2003 Dimitrie O. Paun
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
20  *
21  */
22
23 #include <windows.h>
24
25 #include "properties.h"
26
27 static const VERSION_DESC sWinVersions[] = {
28     {"win2003", "Windows 2003"},
29     {"winxp", "Windows XP"},
30     {"win2k", "Windows 2000"},
31     {"winme", "Windows ME"},
32     {"win98", "Windows 98"},
33     {"win95", "Windows 95"},
34     {"nt40", "Windows NT 4.0"},
35     {"nt351", "Windows NT 3.5"},
36     {"win31", "Windows 3.1"},
37     {"win30", "Windows 3.0"},
38     {"win20", "Windows 2.0"},
39     {"", ""}
40 };
41
42 static const DLL_DESC sDLLType[] = {
43     {"oleaut32", DLL_BUILTIN},
44     {"ole32", DLL_BUILTIN},
45     {"commdlg", DLL_BUILTIN},
46     {"comdlg32", DLL_BUILTIN},
47     {"shell", DLL_BUILTIN},
48     {"shell32", DLL_BUILTIN},
49     {"shfolder", DLL_BUILTIN},
50     {"shlwapi", DLL_BUILTIN},
51     {"shdocvw", DLL_BUILTIN},
52     {"advapi32", DLL_BUILTIN},
53     {"msvcrt", DLL_NATIVE},
54     {"mciavi.drv", DLL_NATIVE},
55     {"mcianim.drv", DLL_NATIVE},
56     {"*", DLL_NATIVE},
57     {"", -1}
58 };
59
60 static const AUDIO_DRIVER sAudioDrivers[] = {
61   {"ALSA", "alsa"},
62   {"aRts", "arts"},
63   {"OSS", "oss"},
64   {"JACK", "jack"},
65   {"NAS", "nas"},
66   {"Audio IO(Solaris)", "audioio"},
67   {"Disable sound", ""},
68   {"", ""}
69 };
70  
71
72
73 /*****************************************************************************
74  */
75 const VERSION_DESC* getWinVersions(void)
76 {
77     return sWinVersions;
78 }
79
80
81 /*****************************************************************************
82  */
83 const DLL_DESC* getDLLDefaults(void)
84 {
85     return sDLLType;
86 }
87
88 /*****************************************************************************
89  */
90 const AUDIO_DRIVER* getAudioDrivers(void)
91 {
92     return sAudioDrivers;
93 }
94
95
96 /* Functions to convert from version to description and back */
97 char* getVersionFromDescription(VERSION_DESC* pVer, char *desc)
98 {
99   for (; *pVer->szVersion; pVer++)
100   {
101     if(!strcasecmp(pVer->szDescription, desc))
102       return pVer->szVersion;
103   }
104
105   return NULL;
106 }
107
108 char* getDescriptionFromVersion(VERSION_DESC* pVer, char *ver)
109 {
110   for (; *pVer->szDescription; pVer++)
111   {
112     if(!strcasecmp(pVer->szVersion, ver))
113       return pVer->szDescription;
114   }
115
116   return NULL;
117 }