Skip to content

Commit 9be2280

Browse files
committed
Update input_controls
1 parent 525672e commit 9be2280

File tree

7 files changed

+205
-0
lines changed

7 files changed

+205
-0
lines changed

input_controls/FlatOut 2.icp

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"id":10,"name":"FlatOut 2","cursorSpeed":1,"elements":[{"type":"D_PAD","shape":"CIRCLE","bindings":["KEY_CTRL_L","KEY_RIGHT","KEY_SPACE","KEY_LEFT"],"scale":1,"x":0.10784313827753067,"y":0.7333333492279053,"toggleSwitch":false,"text":"","iconId":0},{"type":"BUTTON","shape":"CIRCLE","bindings":["KEY_C","NONE","NONE","NONE"],"scale":1,"x":0.8133170008659363,"y":0.7333333492279053,"toggleSwitch":false,"text":"","iconId":0},{"type":"BUTTON","shape":"CIRCLE","bindings":["KEY_UP","NONE","NONE","NONE"],"scale":1,"x":0.8721405267715454,"y":0.6000000238418579,"toggleSwitch":false,"text":"","iconId":0},{"type":"BUTTON","shape":"CIRCLE","bindings":["KEY_DOWN","NONE","NONE","NONE"],"scale":1,"x":0.8721405267715454,"y":0.8666666746139526,"toggleSwitch":false,"text":"","iconId":0},{"type":"BUTTON","shape":"CIRCLE","bindings":["KEY_PG_DOWN","NONE","NONE","NONE"],"scale":1,"x":0.9309640526771545,"y":0.7333333492279053,"toggleSwitch":false,"text":"","iconId":0},{"type":"BUTTON","shape":"ROUND_RECT","bindings":["KEY_ENTER","NONE","NONE","NONE"],"scale":0.85,"x":0.538807213306427,"y":0.9111111164093018,"toggleSwitch":false,"text":"","iconId":0},{"type":"BUTTON","shape":"ROUND_RECT","bindings":["KEY_ESC","NONE","NONE","NONE"],"scale":0.85,"x":0.46078431606292725,"y":0.9111111164093018,"toggleSwitch":false,"text":"","iconId":0}]}

input_controls/Gravity Circuit.icp

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"id":11,"name":"Gravity Circuit","cursorSpeed":1,"elements":[{"type":"D_PAD","shape":"CIRCLE","bindings":["KEY_UP","KEY_RIGHT","KEY_DOWN","KEY_LEFT"],"scale":1,"x":0.10784313827753067,"y":0.7333333492279053,"toggleSwitch":false,"text":"","iconId":0},{"type":"BUTTON","shape":"CIRCLE","bindings":["KEY_X","NONE","NONE","NONE"],"scale":1,"x":0.8133170008659363,"y":0.7333333492279053,"toggleSwitch":false,"text":"","iconId":0},{"type":"BUTTON","shape":"CIRCLE","bindings":["KEY_C","NONE","NONE","NONE"],"scale":1,"x":0.8721405267715454,"y":0.6000000238418579,"toggleSwitch":false,"text":"","iconId":0},{"type":"BUTTON","shape":"CIRCLE","bindings":["KEY_Z","NONE","NONE","NONE"],"scale":1,"x":0.8721405267715454,"y":0.8666666746139526,"toggleSwitch":false,"text":"","iconId":0},{"type":"BUTTON","shape":"CIRCLE","bindings":["KEY_SPACE","NONE","NONE","NONE"],"scale":1,"x":0.9309640526771545,"y":0.7333333492279053,"toggleSwitch":false,"text":"","iconId":0},{"type":"BUTTON","shape":"ROUND_RECT","bindings":["KEY_ENTER","NONE","NONE","NONE"],"scale":0.85,"x":0.538807213306427,"y":0.9111111164093018,"toggleSwitch":false,"text":"","iconId":0},{"type":"BUTTON","shape":"ROUND_RECT","bindings":["KEY_ESC","NONE","NONE","NONE"],"scale":0.85,"x":0.46078431606292725,"y":0.9111111164093018,"toggleSwitch":false,"text":"","iconId":0}],"controllers":[{"id":"0be874ed87b654ec4e25cf18e66d5096eceb59f7","name":"Gamesir-X2_26 650","controllerBindings":[{"keyCode":19,"binding":"KEY_UP"},{"keyCode":22,"binding":"KEY_RIGHT"},{"keyCode":20,"binding":"KEY_DOWN"},{"keyCode":21,"binding":"KEY_LEFT"},{"keyCode":108,"binding":"KEY_ENTER"},{"keyCode":109,"binding":"KEY_ESC"},{"keyCode":97,"binding":"KEY_SHIFT_L"},{"keyCode":96,"binding":"KEY_Z"},{"keyCode":99,"binding":"KEY_X"},{"keyCode":100,"binding":"KEY_A"}]}]}

input_controls/RAGE.icp

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"id":14,"name":"RAGE","cursorSpeed":1,"elements":[{"type":"D_PAD","shape":"CIRCLE","bindings":["KEY_W","KEY_D","KEY_S","KEY_A"],"scale":1,"x":0.10784313827753067,"y":0.7333333492279053,"toggleSwitch":false,"text":"","iconId":0},{"type":"BUTTON","shape":"CIRCLE","bindings":["MOUSE_LEFT_BUTTON","NONE","NONE","NONE"],"scale":1,"x":0.8133170008659363,"y":0.7333333492279053,"toggleSwitch":false,"text":"","iconId":0},{"type":"BUTTON","shape":"CIRCLE","bindings":["KEY_V","NONE","NONE","NONE"],"scale":1,"x":0.8721405267715454,"y":0.6000000238418579,"toggleSwitch":false,"text":"","iconId":0},{"type":"BUTTON","shape":"CIRCLE","bindings":["KEY_E","NONE","NONE","NONE"],"scale":1,"x":0.8721405267715454,"y":0.8666666746139526,"toggleSwitch":false,"text":"","iconId":0},{"type":"BUTTON","shape":"CIRCLE","bindings":["KEY_SPACE","NONE","NONE","NONE"],"scale":1,"x":0.9309640526771545,"y":0.7333333492279053,"toggleSwitch":false,"text":"","iconId":0},{"type":"BUTTON","shape":"RECT","bindings":["KEY_SHIFT_L","NONE","NONE","NONE"],"scale":1,"x":0.8235294222831726,"y":0.08888889104127884,"toggleSwitch":true,"text":"","iconId":0},{"type":"BUTTON","shape":"RECT","bindings":["KEY_Q","NONE","NONE","NONE"],"scale":1,"x":0.9215686321258545,"y":0.08888889104127884,"toggleSwitch":false,"text":"","iconId":0},{"type":"BUTTON","shape":"RECT","bindings":["MOUSE_RIGHT_BUTTON","NONE","NONE","NONE"],"scale":1,"x":0.0784313753247261,"y":0.08888889104127884,"toggleSwitch":false,"text":"","iconId":0},{"type":"BUTTON","shape":"RECT","bindings":["KEY_CTRL_L","NONE","NONE","NONE"],"scale":1,"x":0.1764705926179886,"y":0.08888889104127884,"toggleSwitch":false,"text":"","iconId":0},{"type":"BUTTON","shape":"CIRCLE","bindings":["KEY_R","NONE","NONE","NONE"],"scale":0.85,"x":0.9309640526771545,"y":0.4444444477558136,"toggleSwitch":false,"text":"","iconId":0},{"type":"BUTTON","shape":"ROUND_RECT","bindings":["KEY_ESC","NONE","NONE","NONE"],"scale":0.85,"x":0.538807213306427,"y":0.9111111164093018,"toggleSwitch":false,"text":"","iconId":0},{"type":"BUTTON","shape":"ROUND_RECT","bindings":["KEY_TAB","NONE","NONE","NONE"],"scale":0.85,"x":0.46078431606292725,"y":0.9111111164093018,"toggleSwitch":false,"text":"","iconId":0},{"type":"BUTTON","shape":"CIRCLE","bindings":["KEY_F1","NONE","NONE","NONE"],"scale":0.75,"x":0.0882352963089943,"y":0.2666666805744171,"toggleSwitch":false,"text":"","iconId":9},{"type":"BUTTON","shape":"CIRCLE","bindings":["KEY_F3","NONE","NONE","NONE"],"scale":0.75,"x":0.0882352963089943,"y":0.4444444477558136,"toggleSwitch":false,"text":"","iconId":11},{"type":"BUTTON","shape":"CIRCLE","bindings":["KEY_F2","NONE","NONE","NONE"],"scale":0.75,"x":0.12745098769664764,"y":0.35555556416511536,"toggleSwitch":false,"text":"","iconId":10},{"type":"BUTTON","shape":"CIRCLE","bindings":["KEY_F4","NONE","NONE","NONE"],"scale":0.75,"x":0.04901960864663124,"y":0.35555556416511536,"toggleSwitch":false,"text":"","iconId":8},{"type":"BUTTON","shape":"CIRCLE","bindings":["KEY_C","NONE","NONE","NONE"],"scale":0.85,"x":0.9309640526771545,"y":0.2666666805744171,"toggleSwitch":false,"text":"","iconId":0}]}

input_controls/Ultima Underworld.icp

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"id":8,"name":"Ultima Underworld","cursorSpeed":1,"elements":[{"type":"BUTTON","shape":"CIRCLE","bindings":["MOUSE_RIGHT_BUTTON","NONE","NONE","NONE"],"scale":1,"x":0.7941176295280457,"y":0.7111111283302307,"toggleSwitch":false,"text":"","iconId":0},{"type":"BUTTON","shape":"CIRCLE","bindings":["KEY_J","NONE","NONE","NONE"],"scale":1,"x":0.9313725233078003,"y":0.7111111283302307,"toggleSwitch":false,"text":"","iconId":0},{"type":"BUTTON","shape":"CIRCLE","bindings":["KEY_P","NONE","NONE","NONE"],"scale":1,"x":0.8627451062202454,"y":0.7111111283302307,"toggleSwitch":false,"text":"","iconId":0},{"type":"BUTTON","shape":"ROUND_RECT","bindings":["KEY_ENTER","NONE","NONE","NONE"],"scale":0.85,"x":0.538807213306427,"y":0.9111111164093018,"toggleSwitch":false,"text":"","iconId":0},{"type":"BUTTON","shape":"ROUND_RECT","bindings":["KEY_ESC","NONE","NONE","NONE"],"scale":0.85,"x":0.46078431606292725,"y":0.9111111164093018,"toggleSwitch":false,"text":"","iconId":0},{"type":"BUTTON","shape":"CIRCLE","bindings":["KEY_A","NONE","NONE","NONE"],"scale":1,"x":0.0784313753247261,"y":0.7555555701255798,"toggleSwitch":false,"text":"","iconId":2},{"type":"BUTTON","shape":"CIRCLE","bindings":["KEY_X","NONE","NONE","NONE"],"scale":1,"x":0.12745098769664764,"y":0.8666666746139526,"toggleSwitch":false,"text":"","iconId":5},{"type":"BUTTON","shape":"CIRCLE","bindings":["KEY_S","NONE","NONE","NONE"],"scale":1,"x":0.12745098769664764,"y":0.644444465637207,"toggleSwitch":false,"text":"","iconId":3},{"type":"BUTTON","shape":"CIRCLE","bindings":["KEY_D","NONE","NONE","NONE"],"scale":1,"x":0.1764705926179886,"y":0.7555555701255798,"toggleSwitch":false,"text":"","iconId":4},{"type":"BUTTON","shape":"SQUARE","bindings":["KEY_F2","NONE","NONE","NONE"],"scale":0.85,"x":0.9411764740943909,"y":0.08888889104127884,"toggleSwitch":false,"text":"","iconId":0},{"type":"BUTTON","shape":"SQUARE","bindings":["KEY_F3","NONE","NONE","NONE"],"scale":0.85,"x":0.9411764740943909,"y":0.20000000298023224,"toggleSwitch":false,"text":"","iconId":0},{"type":"BUTTON","shape":"SQUARE","bindings":["KEY_F4","NONE","NONE","NONE"],"scale":0.85,"x":0.9411764740943909,"y":0.31111112236976624,"toggleSwitch":false,"text":"","iconId":0},{"type":"BUTTON","shape":"SQUARE","bindings":["KEY_F5","NONE","NONE","NONE"],"scale":0.85,"x":0.9411764740943909,"y":0.42222222685813904,"toggleSwitch":false,"text":"","iconId":0},{"type":"BUTTON","shape":"SQUARE","bindings":["KEY_F6","NONE","NONE","NONE"],"scale":0.85,"x":0.9411764740943909,"y":0.5333333611488342,"toggleSwitch":false,"text":"","iconId":0},{"type":"BUTTON","shape":"CIRCLE","bindings":["KEY_1","NONE","NONE","NONE"],"scale":1,"x":0.7941176295280457,"y":0.8666666746139526,"toggleSwitch":false,"text":"","iconId":0},{"type":"BUTTON","shape":"CIRCLE","bindings":["KEY_2","NONE","NONE","NONE"],"scale":1,"x":0.8627451062202454,"y":0.8666666746139526,"toggleSwitch":false,"text":"","iconId":0},{"type":"BUTTON","shape":"CIRCLE","bindings":["KEY_3","NONE","NONE","NONE"],"scale":1,"x":0.9313725233078003,"y":0.8666666746139526,"toggleSwitch":false,"text":"","iconId":0}]}

input_controls/Unepic.icp

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"id":12,"name":"Unepic","cursorSpeed":1,"elements":[{"type":"BUTTON","shape":"CIRCLE","bindings":["KEY_SPACE","NONE","NONE","NONE"],"scale":1,"x":0.8133170008659363,"y":0.7333333492279053,"toggleSwitch":false,"text":"","iconId":0},{"type":"BUTTON","shape":"CIRCLE","bindings":["KEY_UP","NONE","NONE","NONE"],"scale":1,"x":0.8721405267715454,"y":0.6000000238418579,"toggleSwitch":false,"text":"","iconId":0},{"type":"BUTTON","shape":"CIRCLE","bindings":["KEY_DOWN","NONE","NONE","NONE"],"scale":1,"x":0.8721405267715454,"y":0.8666666746139526,"toggleSwitch":false,"text":"","iconId":0},{"type":"BUTTON","shape":"CIRCLE","bindings":["KEY_ENTER","NONE","NONE","NONE"],"scale":1,"x":0.9309640526771545,"y":0.7333333492279053,"toggleSwitch":false,"text":"","iconId":0},{"type":"BUTTON","shape":"RECT","bindings":["KEY_T","NONE","NONE","NONE"],"scale":1,"x":0.8235294222831726,"y":0.08888889104127884,"toggleSwitch":false,"text":"","iconId":0},{"type":"BUTTON","shape":"RECT","bindings":["KEY_C","NONE","NONE","NONE"],"scale":1,"x":0.9215686321258545,"y":0.08888889104127884,"toggleSwitch":false,"text":"","iconId":0},{"type":"BUTTON","shape":"CIRCLE","bindings":["KEY_TAB","NONE","NONE","NONE"],"scale":0.85,"x":0.06862745434045792,"y":0.4444444477558136,"toggleSwitch":false,"text":"","iconId":0},{"type":"BUTTON","shape":"RECT","bindings":["KEY_M","NONE","NONE","NONE"],"scale":1,"x":0.0784313753247261,"y":0.08888889104127884,"toggleSwitch":false,"text":"","iconId":0},{"type":"BUTTON","shape":"RECT","bindings":["KEY_Q","NONE","NONE","NONE"],"scale":1,"x":0.1764705926179886,"y":0.08888889104127884,"toggleSwitch":false,"text":"","iconId":0},{"type":"BUTTON","shape":"CIRCLE","bindings":["KEY_R","NONE","NONE","NONE"],"scale":0.85,"x":0.9309640526771545,"y":0.4444444477558136,"toggleSwitch":false,"text":"","iconId":0},{"type":"BUTTON","shape":"ROUND_RECT","bindings":["KEY_ESC","NONE","NONE","NONE"],"scale":0.85,"x":0.538807213306427,"y":0.9111111164093018,"toggleSwitch":false,"text":"","iconId":0},{"type":"BUTTON","shape":"ROUND_RECT","bindings":["KEY_I","NONE","NONE","NONE"],"scale":0.85,"x":0.46078431606292725,"y":0.9111111164093018,"toggleSwitch":false,"text":"","iconId":0},{"type":"RANGE_BUTTON","shape":"CIRCLE","bindings":["NONE","NONE","NONE","NONE"],"scale":1,"x":0.5,"y":0.08888889104127884,"toggleSwitch":false,"text":"","iconId":0,"range":"FROM_F1_TO_F12"},{"type":"BUTTON","shape":"CIRCLE","bindings":["KEY_LEFT","NONE","NONE","NONE"],"scale":1,"x":0.06862745434045792,"y":0.7333333492279053,"toggleSwitch":false,"text":"","iconId":2},{"type":"BUTTON","shape":"CIRCLE","bindings":["KEY_RIGHT","NONE","NONE","NONE"],"scale":1,"x":0.1568627506494522,"y":0.7333333492279053,"toggleSwitch":false,"text":"","iconId":4}]}

input_controls/index.txt

+5
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ Driver Parallel Lines.icp
99
Fallout 3.icp
1010
Final Fantasy 8.icp
1111
Final Fantasy Type-0.icp
12+
FlatOut 2.icp
1213
Front Mission Evolved.icp
14+
Gravity Circuit.icp
1315
GTA 5.icp
1416
Hitman 2.icp
1517
IGI 2.icp
@@ -20,6 +22,7 @@ Metro 2033.icp
2022
Oblivion.icp
2123
Prey.icp
2224
Quake 4.icp
25+
RAGE.icp
2326
Rayman 3.icp
2427
Second Sight.icp
2528
Shovel Knight.icp
@@ -30,5 +33,7 @@ Stalker CS.icp
3033
Star Wars Jedi Knight 2.icp
3134
SteamWorld Dig 2.icp
3235
The Saboteur.icp
36+
Ultima Underworld.icp
37+
Unepic.icp
3338
Wolfenstein.icp
3439
Xanadu Next.icp

wine_patches/dlls/user32/desktop.c

+195
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,195 @@
1+
/*
2+
* Desktop window class.
3+
*
4+
* Copyright 1994 Alexandre Julliard
5+
*
6+
* This library is free software; you can redistribute it and/or
7+
* modify it under the terms of the GNU Lesser General Public
8+
* License as published by the Free Software Foundation; either
9+
* version 2.1 of the License, or (at your option) any later version.
10+
*
11+
* This library is distributed in the hope that it will be useful,
12+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14+
* Lesser General Public License for more details.
15+
*
16+
* You should have received a copy of the GNU Lesser General Public
17+
* License along with this library; if not, write to the Free Software
18+
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19+
*/
20+
21+
#include <stdarg.h>
22+
#include <stdio.h>
23+
#include <string.h>
24+
25+
#include "windef.h"
26+
#include "winbase.h"
27+
#include "wingdi.h"
28+
#include "winnls.h"
29+
#include "controls.h"
30+
31+
static HBRUSH hbrushPattern;
32+
static HBITMAP hbitmapWallPaper;
33+
static SIZE bitmapSize;
34+
static BOOL fTileWallPaper;
35+
36+
37+
/***********************************************************************
38+
* DESKTOP_LoadBitmap
39+
*/
40+
static HBITMAP DESKTOP_LoadBitmap( const WCHAR *filename )
41+
{
42+
HBITMAP hbitmap;
43+
44+
if (!filename[0]) return 0;
45+
hbitmap = LoadImageW( 0, filename, IMAGE_BITMAP, 0, 0, LR_CREATEDIBSECTION | LR_LOADFROMFILE );
46+
if (!hbitmap)
47+
{
48+
WCHAR buffer[MAX_PATH];
49+
UINT len = GetWindowsDirectoryW( buffer, MAX_PATH - 2 );
50+
if (buffer[len - 1] != '\\') buffer[len++] = '\\';
51+
lstrcpynW( buffer + len, filename, MAX_PATH - len );
52+
hbitmap = LoadImageW( 0, buffer, IMAGE_BITMAP, 0, 0, LR_CREATEDIBSECTION | LR_LOADFROMFILE );
53+
}
54+
return hbitmap;
55+
}
56+
57+
/***********************************************************************
58+
* init_wallpaper
59+
*/
60+
static void init_wallpaper( const WCHAR *wallpaper )
61+
{
62+
HBITMAP hbitmap = DESKTOP_LoadBitmap( wallpaper );
63+
64+
if (hbitmapWallPaper) DeleteObject( hbitmapWallPaper );
65+
hbitmapWallPaper = hbitmap;
66+
if (hbitmap)
67+
{
68+
BITMAP bmp;
69+
GetObjectA( hbitmap, sizeof(bmp), &bmp );
70+
bitmapSize.cx = (bmp.bmWidth != 0) ? bmp.bmWidth : 1;
71+
bitmapSize.cy = (bmp.bmHeight != 0) ? bmp.bmHeight : 1;
72+
fTileWallPaper = GetProfileIntA( "desktop", "TileWallPaper", 0 );
73+
}
74+
}
75+
76+
/***********************************************************************
77+
* DesktopWndProc
78+
*/
79+
LRESULT WINAPI DesktopWndProc( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam )
80+
{
81+
switch (message)
82+
{
83+
case WM_NCCREATE:
84+
case WM_NCCALCSIZE:
85+
case WM_PARENTNOTIFY:
86+
case WM_DISPLAYCHANGE:
87+
return NtUserMessageCall( hwnd, message, wParam, lParam, 0, NtUserDesktopWindowProc, FALSE );
88+
89+
default:
90+
if (message < WM_USER)
91+
return DefWindowProcW( hwnd, message, wParam, lParam );
92+
return NtUserMessageCall( hwnd, message, wParam, lParam, 0, NtUserDesktopWindowProc, FALSE );
93+
}
94+
}
95+
96+
/***********************************************************************
97+
* PaintDesktop (USER32.@)
98+
*
99+
*/
100+
BOOL WINAPI PaintDesktop(HDC hdc)
101+
{
102+
HWND hwnd = GetDesktopWindow();
103+
104+
/* check for an owning thread; otherwise don't paint anything (non-desktop mode) */
105+
if (GetWindowThreadProcessId( hwnd, NULL ))
106+
{
107+
RECT rect;
108+
109+
GetClientRect( hwnd, &rect );
110+
111+
/* Paint desktop pattern (only if wall paper does not cover everything) */
112+
113+
if (!hbitmapWallPaper ||
114+
(!fTileWallPaper && ((bitmapSize.cx < rect.right) || (bitmapSize.cy < rect.bottom))))
115+
{
116+
HBRUSH brush = hbrushPattern;
117+
if (!brush) brush = (HBRUSH)GetClassLongPtrW( hwnd, GCLP_HBRBACKGROUND );
118+
/* Set colors in case pattern is a monochrome bitmap */
119+
SetBkColor( hdc, RGB(0,0,0) );
120+
SetTextColor( hdc, GetSysColor(COLOR_BACKGROUND) );
121+
FillRect( hdc, &rect, brush );
122+
}
123+
124+
/* Paint wall paper */
125+
126+
if (hbitmapWallPaper)
127+
{
128+
INT x, y;
129+
HDC hMemDC = CreateCompatibleDC( hdc );
130+
131+
SelectObject( hMemDC, hbitmapWallPaper );
132+
133+
if (fTileWallPaper)
134+
{
135+
for (y = 0; y < rect.bottom; y += bitmapSize.cy)
136+
for (x = 0; x < rect.right; x += bitmapSize.cx)
137+
BitBlt( hdc, x, y, bitmapSize.cx, bitmapSize.cy, hMemDC, 0, 0, SRCCOPY );
138+
}
139+
else
140+
{
141+
SIZE deskSize;
142+
deskSize.cx = rect.right - rect.left;
143+
deskSize.cy = rect.bottom - rect.top;
144+
145+
StretchBlt( hdc, 0, 0, deskSize.cx, deskSize.cy, hMemDC, 0, 0, bitmapSize.cx, bitmapSize.cy, SRCCOPY );
146+
}
147+
DeleteDC( hMemDC );
148+
}
149+
}
150+
return TRUE;
151+
}
152+
153+
/***********************************************************************
154+
* SetDeskWallPaper (USER32.@)
155+
*
156+
* FIXME: is there a unicode version?
157+
*/
158+
BOOL WINAPI SetDeskWallPaper( LPCSTR filename )
159+
{
160+
return SystemParametersInfoA( SPI_SETDESKWALLPAPER, MAX_PATH, (void *)filename, SPIF_UPDATEINIFILE );
161+
}
162+
163+
164+
/***********************************************************************
165+
* update_wallpaper
166+
*/
167+
BOOL update_wallpaper( const WCHAR *wallpaper, const WCHAR *pattern )
168+
{
169+
int pat[8];
170+
171+
if (hbrushPattern) DeleteObject( hbrushPattern );
172+
hbrushPattern = 0;
173+
memset( pat, 0, sizeof(pat) );
174+
if (pattern)
175+
{
176+
char buffer[64];
177+
WideCharToMultiByte( CP_ACP, 0, pattern, -1, buffer, sizeof(buffer), NULL, NULL );
178+
if (sscanf( buffer, " %d %d %d %d %d %d %d %d",
179+
&pat[0], &pat[1], &pat[2], &pat[3],
180+
&pat[4], &pat[5], &pat[6], &pat[7] ))
181+
{
182+
WORD ptrn[8];
183+
HBITMAP hbitmap;
184+
int i;
185+
186+
for (i = 0; i < 8; i++) ptrn[i] = pat[i] & 0xffff;
187+
hbitmap = CreateBitmap( 8, 8, 1, 1, ptrn );
188+
hbrushPattern = CreatePatternBrush( hbitmap );
189+
DeleteObject( hbitmap );
190+
}
191+
}
192+
init_wallpaper( wallpaper );
193+
NtUserRedrawWindow( GetDesktopWindow(), 0, 0, RDW_INVALIDATE | RDW_ERASE | RDW_NOCHILDREN );
194+
return TRUE;
195+
}

0 commit comments

Comments
 (0)