2 * X11DRV configuration code
4 * Copyright 2003 Mark Westcott
5 * Copyright 2003 Mike Hearn
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
30 #include <wine/debug.h>
35 WINE_DEFAULT_DEBUG_CHANNEL(winecfg);
37 /* pokes the win32 api to setup the dialog from the config struct */
38 void initX11DrvDlg (HWND hDlg)
43 sprintf (szBuf, "%d", config.sX11Drv.nSysColors);
44 SendDlgItemMessage (hDlg, IDC_SYSCOLORS, WM_SETTEXT, 0, (LPARAM) szBuf);
46 /* private color map */
47 if (config.sX11Drv.nPrivateMap)
48 SendDlgItemMessage( hDlg, IDC_PRIVATEMAP, BM_SETCHECK, BST_CHECKED, 0);
50 /* perfect graphics */
51 if (config.sX11Drv.nPerfect)
52 SendDlgItemMessage( hDlg, IDC_PERFECTGRAPH, BM_SETCHECK, BST_CHECKED, 0);
55 sprintf (szBuf, "%d", config.sX11Drv.nDesktopSizeX);
56 SendDlgItemMessage (hDlg, IDC_DESKTOP_WIDTH, WM_SETTEXT, 0, (LPARAM) szBuf);
57 sprintf (szBuf, "%d", config.sX11Drv.nDesktopSizeY);
58 SendDlgItemMessage (hDlg, IDC_DESKTOP_HEIGHT, WM_SETTEXT, 0, (LPARAM) szBuf);
60 if (config.sX11Drv.nDGA) SendDlgItemMessage( hDlg, IDC_XDGA, BM_SETCHECK, BST_CHECKED, 0);
61 if (config.sX11Drv.nXShm) SendDlgItemMessage( hDlg, IDC_XSHM, BM_SETCHECK, BST_CHECKED, 0);
65 saveX11DrvDlgSettings (HWND hDlg)
70 X11DrvDlgProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
77 switch(HIWORD(wParam)) {
79 SendMessage(GetParent(hDlg), PSM_CHANGED, 0, 0);
89 switch (((LPNMHDR)lParam)->code) {
90 case PSN_KILLACTIVE: {
91 /* validate user info. Lets just assume everything is okay for now */
92 SetWindowLong(hDlg, DWL_MSGRESULT, FALSE);
96 /* should probably check everything is really all rosy :) */
97 saveX11DrvDlgSettings (hDlg);
98 SetWindowLong(hDlg, DWL_MSGRESULT, PSNRET_NOERROR);
101 case PSN_SETACTIVE: {
102 initX11DrvDlg (hDlg);