A first stab at wcstod().
[wine/hacks.git] / programs / winecfg / winecfg.h
blobfa7b0ae1621c4613e70ad2112c2d8c70a6f50a81
1 /*
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
23 #ifndef WINE_CFG_H
24 #define WINE_CFG_H
26 #include <stdarg.h>
28 #include "windef.h"
29 #include "winbase.h"
30 #include "wingdi.h"
31 #include "winuser.h"
32 #include "winnls.h"
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) \
41 if (!(try)) { \
42 WINE_ERR("assertion (##try) failed, returning\n"); \
43 return ret; \
46 #define WRITEME(owner) MessageBox(owner, "Write me!", "", MB_OK | MB_ICONEXCLAMATION);
49 /* Transaction management */
50 enum transaction_action {
51 ACTION_SET,
52 ACTION_REMOVE
55 struct transaction {
56 char *section;
57 char *key;
58 char *newValue;
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 */
84 int initialize(void);
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);
92 /* X11DRV */
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"
110 #endif