2003-03-31 19:41:55 +00:00
|
|
|
/*
|
|
|
|
* WineCfg configuration management
|
|
|
|
*
|
|
|
|
* Copyright 2002 Jaco Greeff
|
|
|
|
* Copyright 2003 Dimitrie O. Paun
|
2004-09-28 03:16:43 +00:00
|
|
|
* Copyright 2004 Mike Hearn
|
2003-03-31 19:41:55 +00:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library 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
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef WINE_CFG_H
|
|
|
|
#define WINE_CFG_H
|
|
|
|
|
2003-09-05 23:08:26 +00:00
|
|
|
#include <stdarg.h>
|
|
|
|
|
|
|
|
#include "windef.h"
|
|
|
|
#include "winbase.h"
|
|
|
|
#include "wingdi.h"
|
|
|
|
#include "winuser.h"
|
|
|
|
#include "winnls.h"
|
2003-03-31 19:41:55 +00:00
|
|
|
#include "properties.h"
|
|
|
|
|
2003-08-30 00:40:46 +00:00
|
|
|
#define IS_OPTION_TRUE(ch) \
|
|
|
|
((ch) == 'y' || (ch) == 'Y' || (ch) == 't' || (ch) == 'T' || (ch) == '1')
|
|
|
|
#define IS_OPTION_FALSE(ch) \
|
|
|
|
((ch) == 'n' || (ch) == 'N' || (ch) == 'f' || (ch) == 'F' || (ch) == '0')
|
|
|
|
|
2004-11-23 13:50:23 +00:00
|
|
|
extern char *current_app; /* NULL means editing global settings */
|
2003-09-08 18:58:07 +00:00
|
|
|
|
2004-09-28 03:55:16 +00:00
|
|
|
/* Use get and set to alter registry settings. The changes made through set
|
|
|
|
won't be committed to the registry until process_all_settings is called,
|
|
|
|
however get will still return accurate information.
|
2003-09-30 00:27:55 +00:00
|
|
|
|
2004-09-28 03:55:16 +00:00
|
|
|
You are expected to release the result of get. The parameters to set will
|
|
|
|
be copied, so release them too when necessary.
|
|
|
|
*/
|
2004-11-23 13:50:23 +00:00
|
|
|
|
2004-09-28 03:55:16 +00:00
|
|
|
void set(char *path, char *name, char *value);
|
|
|
|
char *get(char *path, char *name, char *def);
|
|
|
|
BOOL exists(char *path, char *name);
|
|
|
|
void apply(void);
|
|
|
|
char **enumerate_values(char *path);
|
2004-09-28 03:16:43 +00:00
|
|
|
|
|
|
|
/* returns a string of the form "AppDefaults\\appname.exe\\section", or just "section" if
|
2004-11-23 13:50:23 +00:00
|
|
|
the user is editing the global settings.
|
|
|
|
|
|
|
|
no explicit free is needed of the string returned by this function
|
2004-09-28 03:16:43 +00:00
|
|
|
*/
|
|
|
|
char *keypath(char *section);
|
2003-09-08 18:58:07 +00:00
|
|
|
|
|
|
|
int initialize(void);
|
2004-09-28 03:55:16 +00:00
|
|
|
extern HKEY config_key;
|
2003-03-31 19:41:55 +00:00
|
|
|
|
2004-11-23 13:50:23 +00:00
|
|
|
/* hack for the property sheet control */
|
2004-09-28 03:55:16 +00:00
|
|
|
void set_window_title(HWND dialog);
|
2003-08-30 00:49:00 +00:00
|
|
|
|
2004-11-23 13:50:23 +00:00
|
|
|
/* Window procedures */
|
2004-07-30 01:35:13 +00:00
|
|
|
INT_PTR CALLBACK GraphDlgProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
|
2003-08-30 00:49:00 +00:00
|
|
|
INT_PTR CALLBACK DriveDlgProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
|
|
|
|
INT_PTR CALLBACK DriveEditDlgProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
|
2003-09-30 00:27:55 +00:00
|
|
|
INT_PTR CALLBACK AppDlgProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
|
2004-01-07 00:43:40 +00:00
|
|
|
INT_PTR CALLBACK LibrariesDlgProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
|
2004-01-20 02:07:35 +00:00
|
|
|
INT_PTR CALLBACK AudioDlgProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
|
|
|
|
|
2004-11-23 13:50:23 +00:00
|
|
|
/* Drive management */
|
|
|
|
void load_drives();
|
|
|
|
int autodetect_drives();
|
|
|
|
|
|
|
|
struct drive
|
|
|
|
{
|
|
|
|
char letter;
|
|
|
|
char *unixpath;
|
|
|
|
char *label;
|
|
|
|
char *serial;
|
|
|
|
DWORD type; /* one of the DRIVE_ constants from winbase.h */
|
|
|
|
|
|
|
|
BOOL in_use;
|
|
|
|
};
|
|
|
|
|
|
|
|
#define DRIVE_MASK_BIT(B) 1 << (toupper(B) - 'A')
|
|
|
|
|
|
|
|
long drive_available_mask(char letter);
|
|
|
|
BOOL add_drive(char letter, char *targetpath, char *label, char *serial, unsigned int type);
|
|
|
|
void delete_drive(struct drive *pDrive);
|
|
|
|
void apply_drive_changes();
|
|
|
|
extern struct drive drives[26]; /* one for each drive letter */
|
|
|
|
|
|
|
|
BOOL gui_mode;
|
|
|
|
|
|
|
|
/* Some basic utilities to make win32 suck less */
|
2003-09-30 00:27:55 +00:00
|
|
|
#define disable(id) EnableWindow(GetDlgItem(dialog, id), 0);
|
|
|
|
#define enable(id) EnableWindow(GetDlgItem(dialog, id), 1);
|
2004-05-04 02:56:46 +00:00
|
|
|
void PRINTERROR(void); /* WINE_TRACE() the plaintext error message from GetLastError() */
|
2003-09-30 00:27:55 +00:00
|
|
|
|
2004-09-28 03:16:43 +00:00
|
|
|
/* returns a string in the win32 heap */
|
|
|
|
static inline char *strdupA(char *s)
|
|
|
|
{
|
2004-09-28 03:55:16 +00:00
|
|
|
char *r = HeapAlloc(GetProcessHeap(), 0, strlen(s));
|
2004-09-28 03:16:43 +00:00
|
|
|
return strcpy(r, s);
|
|
|
|
}
|
|
|
|
|
2004-11-23 13:50:23 +00:00
|
|
|
static inline char *get_text(HWND dialog, WORD id)
|
2004-09-28 04:05:55 +00:00
|
|
|
{
|
|
|
|
HWND item = GetDlgItem(dialog, id);
|
|
|
|
int len = GetWindowTextLength(item) + 1;
|
2004-11-23 13:50:23 +00:00
|
|
|
char *result = len ? HeapAlloc(GetProcessHeap(), 0, len) : NULL;
|
|
|
|
if (!result || GetWindowText(item, result, len) == 0) return NULL;
|
2004-09-28 04:05:55 +00:00
|
|
|
return result;
|
|
|
|
}
|
2004-09-28 03:16:43 +00:00
|
|
|
|
2004-11-23 13:50:23 +00:00
|
|
|
static inline void set_text(HWND dialog, WORD id, char *text)
|
|
|
|
{
|
|
|
|
SetWindowText(GetDlgItem(dialog, id), text);
|
|
|
|
}
|
|
|
|
|
|
|
|
#define WINE_KEY_ROOT "Software\\Wine\\Testing\\Config"
|
2003-08-30 00:27:08 +00:00
|
|
|
|
2003-03-31 19:41:55 +00:00
|
|
|
#endif
|