2003-03-31 21:41:55 +02:00
|
|
|
/*
|
|
|
|
* WineCfg configuration management
|
|
|
|
*
|
|
|
|
* Copyright 2002 Jaco Greeff
|
|
|
|
* Copyright 2003 Dimitrie O. Paun
|
|
|
|
*
|
|
|
|
* 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-06 01:08:26 +02:00
|
|
|
#include <stdarg.h>
|
|
|
|
|
|
|
|
#include "windef.h"
|
|
|
|
#include "winbase.h"
|
|
|
|
#include "wingdi.h"
|
|
|
|
#include "winuser.h"
|
|
|
|
#include "winnls.h"
|
2003-03-31 21:41:55 +02:00
|
|
|
#include "properties.h"
|
|
|
|
|
2003-08-30 02:40:46 +02: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')
|
|
|
|
|
2003-09-30 02:27:55 +02:00
|
|
|
#define return_if_fail(try) \
|
2003-09-08 20:58:07 +02:00
|
|
|
if (!(try)) { \
|
2003-09-30 02:27:55 +02:00
|
|
|
WINE_ERR("check (" #try ") at %s:%d failed, returning\n", __FILE__, __LINE__ - 1); \
|
|
|
|
return; \
|
2003-09-08 20:58:07 +02:00
|
|
|
}
|
|
|
|
|
2003-09-18 00:40:38 +02:00
|
|
|
#define WRITEME(owner) MessageBox(owner, "Write me!", "", MB_OK | MB_ICONEXCLAMATION);
|
|
|
|
|
|
|
|
|
2003-09-08 20:58:07 +02:00
|
|
|
/* Transaction management */
|
|
|
|
enum transaction_action {
|
|
|
|
ACTION_SET,
|
|
|
|
ACTION_REMOVE
|
|
|
|
};
|
|
|
|
|
|
|
|
struct transaction {
|
|
|
|
char *section;
|
|
|
|
char *key;
|
|
|
|
char *newValue;
|
|
|
|
enum transaction_action action;
|
|
|
|
struct transaction *next, *prev;
|
|
|
|
};
|
|
|
|
extern struct transaction *tqhead, *tqtail;
|
|
|
|
|
|
|
|
extern int instantApply; /* non-zero means apply all changes instantly */
|
|
|
|
|
2003-09-30 02:27:55 +02:00
|
|
|
#define EDITING_GLOBAL 0
|
|
|
|
#define EDITING_APP 1
|
|
|
|
extern int appSettings; /* non-zero means we are editing appdefault settings */
|
|
|
|
|
|
|
|
/* returns a string of the form AppDefaults\\appname.exe\\section */
|
|
|
|
/* no explicit free is needed of the string returned by this function */
|
|
|
|
char *getSectionForApp(char *section);
|
2003-09-08 20:58:07 +02:00
|
|
|
|
|
|
|
/* Commits a transaction to the registry */
|
|
|
|
void processTransaction(struct transaction *trans);
|
|
|
|
|
|
|
|
/* Processes every pending transaction in the queue, removing them as it works from head to tail */
|
|
|
|
void processTransQueue();
|
|
|
|
|
|
|
|
/* Adds a transaction to the head of the queue. If we're using instant apply, this calls processTransaction
|
|
|
|
* action can be either:
|
|
|
|
* ACTION_SET -> this transaction will change a registry key, newValue is the replacement value
|
|
|
|
* ACTION_REMOVE -> this transaction will remove a registry key. In this case, newValue is ignored.
|
|
|
|
*/
|
2003-10-09 06:39:01 +02:00
|
|
|
void addTransaction(const char *section, const char *key, enum transaction_action action, const char *newValue);
|
2003-09-08 20:58:07 +02:00
|
|
|
|
|
|
|
/* frees the transaction structure, all fields, and removes it from the queue if in it */
|
|
|
|
void destroyTransaction(struct transaction *trans);
|
|
|
|
|
|
|
|
/* Initializes the transaction system */
|
|
|
|
int initialize(void);
|
2003-09-08 21:29:28 +02:00
|
|
|
extern HKEY configKey;
|
2003-03-31 21:41:55 +02:00
|
|
|
|
2003-10-09 06:39:01 +02:00
|
|
|
int setConfigValue (const char *subkey, const char *valueName, const char *value);
|
|
|
|
char *getConfigValue (const char *subkey, const char *valueName, const char *defaultResult);
|
|
|
|
HRESULT doesConfigValueExist (const char *subkey, const char *valueName);
|
|
|
|
HRESULT removeConfigValue (const char *subkey, const char *valueName);
|
2003-08-30 02:49:00 +02:00
|
|
|
|
|
|
|
/* X11DRV */
|
2003-09-08 20:58:07 +02:00
|
|
|
|
2003-08-30 02:40:46 +02:00
|
|
|
void initX11DrvDlg (HWND hDlg);
|
|
|
|
void saveX11DrvDlgSettings (HWND hDlg);
|
|
|
|
INT_PTR CALLBACK X11DrvDlgProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
|
|
|
|
|
2003-08-30 02:49:00 +02:00
|
|
|
/* Drive management */
|
|
|
|
void initDriveDlg (HWND hDlg);
|
|
|
|
void saveDriveSettings (HWND hDlg);
|
|
|
|
|
|
|
|
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 02:27:55 +02:00
|
|
|
INT_PTR CALLBACK AppDlgProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
|
2003-08-30 02:49:00 +02:00
|
|
|
|
2003-09-10 05:41:44 +02:00
|
|
|
/* some basic utilities to make win32 suck less */
|
|
|
|
char *getDialogItemText(HWND hDlg, WORD controlID);
|
2003-09-30 02:27:55 +02:00
|
|
|
#define disable(id) EnableWindow(GetDlgItem(dialog, id), 0);
|
|
|
|
#define enable(id) EnableWindow(GetDlgItem(dialog, id), 1);
|
|
|
|
|
2003-09-10 05:41:44 +02:00
|
|
|
|
2003-09-30 02:27:55 +02:00
|
|
|
#define WINE_KEY_ROOT "Software\\Wine\\Wine\\Config"
|
2003-08-30 02:27:08 +02:00
|
|
|
|
2003-03-31 21:41:55 +02:00
|
|
|
#endif
|