2 * WineCfg configuration management
4 * Copyright 2002 Jaco Greeff
5 * Copyright 2003 Dimitrie O. Paun
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.
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.
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
33 #include "properties.h"
35 #define IS_OPTION_TRUE(ch) \
36 ((ch) == 'y' || (ch) == 'Y' || (ch) == 't' || (ch) == 'T' || (ch) == '1')
37 #define IS_OPTION_FALSE(ch) \
38 ((ch) == 'n' || (ch) == 'N' || (ch) == 'f' || (ch) == 'F' || (ch) == '0')
40 #define return_if_fail(try, ret) \
42 WINE_ERR("assertion (##try) failed, returning\n"); \
46 #define WRITEME(owner) MessageBox(owner, "Write me!", "", MB_OK | MB_ICONEXCLAMATION);
49 /* Transaction management */
50 enum transaction_action
{
59 enum transaction_action action
;
60 struct transaction
*next
, *prev
;
62 extern struct transaction
*tqhead
, *tqtail
;
64 extern int instantApply
; /* non-zero means apply all changes instantly */
67 /* Commits a transaction to the registry */
68 void processTransaction(struct transaction
*trans
);
70 /* Processes every pending transaction in the queue, removing them as it works from head to tail */
71 void processTransQueue();
73 /* Adds a transaction to the head of the queue. If we're using instant apply, this calls processTransaction
74 * action can be either:
75 * ACTION_SET -> this transaction will change a registry key, newValue is the replacement value
76 * ACTION_REMOVE -> this transaction will remove a registry key. In this case, newValue is ignored.
78 void addTransaction(char *section
, char *key
, enum transaction_action action
, char *newValue
);
80 /* frees the transaction structure, all fields, and removes it from the queue if in it */
81 void destroyTransaction(struct transaction
*trans
);
83 /* Initializes the transaction system */
85 extern HKEY configKey
;
87 int setConfigValue (char *subkey
, char *valueName
, const char *value
);
88 char *getConfigValue (char *subkey
, char *valueName
, char *defaultResult
);
89 HRESULT
doesConfigValueExist (char *subkey
, char *valueName
);
90 HRESULT
removeConfigValue (char *subkey
, char *valueName
);
94 void initX11DrvDlg (HWND hDlg
);
95 void saveX11DrvDlgSettings (HWND hDlg
);
96 INT_PTR CALLBACK
X11DrvDlgProc (HWND hDlg
, UINT uMsg
, WPARAM wParam
, LPARAM lParam
);
98 /* Drive management */
99 void initDriveDlg (HWND hDlg
);
100 void saveDriveSettings (HWND hDlg
);
102 INT_PTR CALLBACK
DriveDlgProc (HWND hDlg
, UINT uMsg
, WPARAM wParam
, LPARAM lParam
);
103 INT_PTR CALLBACK
DriveEditDlgProc (HWND hDlg
, UINT uMsg
, WPARAM wParam
, LPARAM lParam
);
105 /* some basic utilities to make win32 suck less */
106 char *getDialogItemText(HWND hDlg
, WORD controlID
);
108 #define WINE_KEY_ROOT "Software\\Wine\\WineCfg\\Config"