Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
8d8703cb
Commit
8d8703cb
authored
Feb 04, 1999
by
Patrik Stridvall
Committed by
Alexandre Julliard
Feb 04, 1999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved some more code to the X11 driver.
parent
c6e6a9af
Show whitespace changes
Inline
Side-by-side
Showing
35 changed files
with
682 additions
and
679 deletions
+682
-679
desktop.c
controls/desktop.c
+72
-34
widgets.c
controls/widgets.c
+1
-1
dbg.y
debugger/dbg.y
+1
-2
ddraw.c
graphics/ddraw.c
+48
-41
painting.c
graphics/painting.c
+8
-5
wing.c
graphics/wing.c
+29
-10
bitmap.h
include/bitmap.h
+2
-2
color.h
include/color.h
+0
-2
ddraw.h
include/ddraw.h
+3
-7
debug.h
include/debug.h
+16
-15
debugdefs.h
include/debugdefs.h
+3
-1
desktop.h
include/desktop.h
+18
-2
display.h
include/display.h
+2
-2
main.h
include/main.h
+3
-0
options.h
include/options.h
+3
-0
ttydrv.h
include/ttydrv.h
+86
-7
win.h
include/win.h
+6
-17
x11drv.h
include/x11drv.h
+111
-61
main.c
misc/main.c
+122
-414
bitmap.c
objects/bitmap.c
+3
-2
color.c
objects/color.c
+23
-20
dc.c
objects/dc.c
+4
-2
dib.c
objects/dib.c
+7
-2
gdiobj.c
objects/gdiobj.c
+13
-1
palette.c
objects/palette.c
+1
-0
clipboard.c
windows/clipboard.c
+8
-0
dce.c
windows/dce.c
+4
-1
display.c
windows/display.c
+10
-0
event.c
windows/event.c
+10
-0
keyboard.c
windows/keyboard.c
+10
-0
mouse.c
windows/mouse.c
+9
-6
sysmetrics.c
windows/sysmetrics.c
+4
-4
user.c
windows/user.c
+9
-7
win.c
windows/win.c
+20
-0
winpos.c
windows/winpos.c
+13
-11
No files found.
controls/desktop.c
View file @
8d8703cb
...
@@ -4,14 +4,50 @@
...
@@ -4,14 +4,50 @@
* Copyright 1994 Alexandre Julliard
* Copyright 1994 Alexandre Julliard
*/
*/
#include "x11drv.h"
#include <stdio.h>
#include <stdio.h>
#include <string.h>
#include <string.h>
#include <unistd.h>
#include <unistd.h>
#include "win.h"
#include "desktop.h"
#include "desktop.h"
#include "heap.h"
#include "heap.h"
#include "monitor.h"
#include "win.h"
#include "wine/winuser16.h"
#include "wine/winuser16.h"
/***********************************************************************
* DESKTOP_GetScreenWidth
*
* Return the width of the screen associated to the current desktop.
*/
int
DESKTOP_GetScreenWidth
()
{
DESKTOP
*
pDesktop
=
(
DESKTOP
*
)
WIN_GetDesktop
()
->
wExtra
;
return
MONITOR_GetWidth
(
pDesktop
->
pPrimaryMonitor
);
}
/***********************************************************************
* DESKTOP_GetScreenHeight
*
* Return the height of the screen associated to the current desktop.
*/
int
DESKTOP_GetScreenHeight
()
{
DESKTOP
*
pDesktop
=
(
DESKTOP
*
)
WIN_GetDesktop
()
->
wExtra
;
return
MONITOR_GetHeight
(
pDesktop
->
pPrimaryMonitor
);
}
/***********************************************************************
* DESKTOP_GetScreenDepth
*
* Return the depth of the screen associated to the current desktop.
*/
int
DESKTOP_GetScreenDepth
()
{
DESKTOP
*
pDesktop
=
(
DESKTOP
*
)
WIN_GetDesktop
()
->
wExtra
;
return
MONITOR_GetDepth
(
pDesktop
->
pPrimaryMonitor
);
}
/***********************************************************************
/***********************************************************************
* DESKTOP_LoadBitmap
* DESKTOP_LoadBitmap
...
@@ -74,7 +110,7 @@ static HBITMAP32 DESKTOP_LoadBitmap( HDC32 hdc, const char *filename )
...
@@ -74,7 +110,7 @@ static HBITMAP32 DESKTOP_LoadBitmap( HDC32 hdc, const char *filename )
* Handle the WM_ERASEBKGND message.
* Handle the WM_ERASEBKGND message.
*/
*/
static
LRESULT
DESKTOP_DoEraseBkgnd
(
HWND32
hwnd
,
HDC32
hdc
,
static
LRESULT
DESKTOP_DoEraseBkgnd
(
HWND32
hwnd
,
HDC32
hdc
,
DESKTOP
INFO
*
info
Ptr
)
DESKTOP
*
desktop
Ptr
)
{
{
RECT32
rect
;
RECT32
rect
;
WND
*
Wnd
=
WIN_FindWndPtr
(
hwnd
);
WND
*
Wnd
=
WIN_FindWndPtr
(
hwnd
);
...
@@ -86,40 +122,40 @@ static LRESULT DESKTOP_DoEraseBkgnd( HWND32 hwnd, HDC32 hdc,
...
@@ -86,40 +122,40 @@ static LRESULT DESKTOP_DoEraseBkgnd( HWND32 hwnd, HDC32 hdc,
/* Paint desktop pattern (only if wall paper does not cover everything) */
/* Paint desktop pattern (only if wall paper does not cover everything) */
if
(
!
info
Ptr
->
hbitmapWallPaper
||
if
(
!
desktop
Ptr
->
hbitmapWallPaper
||
(
!
infoPtr
->
fTileWallPaper
&&
((
info
Ptr
->
bitmapSize
.
cx
<
rect
.
right
)
||
(
!
desktopPtr
->
fTileWallPaper
&&
((
desktop
Ptr
->
bitmapSize
.
cx
<
rect
.
right
)
||
(
info
Ptr
->
bitmapSize
.
cy
<
rect
.
bottom
))))
(
desktop
Ptr
->
bitmapSize
.
cy
<
rect
.
bottom
))))
{
{
/* Set colors in case pattern is a monochrome bitmap */
/* Set colors in case pattern is a monochrome bitmap */
SetBkColor32
(
hdc
,
RGB
(
0
,
0
,
0
)
);
SetBkColor32
(
hdc
,
RGB
(
0
,
0
,
0
)
);
SetTextColor32
(
hdc
,
GetSysColor32
(
COLOR_BACKGROUND
)
);
SetTextColor32
(
hdc
,
GetSysColor32
(
COLOR_BACKGROUND
)
);
FillRect32
(
hdc
,
&
rect
,
info
Ptr
->
hbrushPattern
);
FillRect32
(
hdc
,
&
rect
,
desktop
Ptr
->
hbrushPattern
);
}
}
/* Paint wall paper */
/* Paint wall paper */
if
(
info
Ptr
->
hbitmapWallPaper
)
if
(
desktop
Ptr
->
hbitmapWallPaper
)
{
{
INT32
x
,
y
;
INT32
x
,
y
;
HDC32
hMemDC
=
CreateCompatibleDC32
(
hdc
);
HDC32
hMemDC
=
CreateCompatibleDC32
(
hdc
);
SelectObject32
(
hMemDC
,
info
Ptr
->
hbitmapWallPaper
);
SelectObject32
(
hMemDC
,
desktop
Ptr
->
hbitmapWallPaper
);
if
(
info
Ptr
->
fTileWallPaper
)
if
(
desktop
Ptr
->
fTileWallPaper
)
{
{
for
(
y
=
0
;
y
<
rect
.
bottom
;
y
+=
info
Ptr
->
bitmapSize
.
cy
)
for
(
y
=
0
;
y
<
rect
.
bottom
;
y
+=
desktop
Ptr
->
bitmapSize
.
cy
)
for
(
x
=
0
;
x
<
rect
.
right
;
x
+=
info
Ptr
->
bitmapSize
.
cx
)
for
(
x
=
0
;
x
<
rect
.
right
;
x
+=
desktop
Ptr
->
bitmapSize
.
cx
)
BitBlt32
(
hdc
,
x
,
y
,
info
Ptr
->
bitmapSize
.
cx
,
BitBlt32
(
hdc
,
x
,
y
,
desktop
Ptr
->
bitmapSize
.
cx
,
info
Ptr
->
bitmapSize
.
cy
,
hMemDC
,
0
,
0
,
SRCCOPY
);
desktop
Ptr
->
bitmapSize
.
cy
,
hMemDC
,
0
,
0
,
SRCCOPY
);
}
}
else
else
{
{
x
=
(
rect
.
left
+
rect
.
right
-
info
Ptr
->
bitmapSize
.
cx
)
/
2
;
x
=
(
rect
.
left
+
rect
.
right
-
desktop
Ptr
->
bitmapSize
.
cx
)
/
2
;
y
=
(
rect
.
top
+
rect
.
bottom
-
info
Ptr
->
bitmapSize
.
cy
)
/
2
;
y
=
(
rect
.
top
+
rect
.
bottom
-
desktop
Ptr
->
bitmapSize
.
cy
)
/
2
;
if
(
x
<
0
)
x
=
0
;
if
(
x
<
0
)
x
=
0
;
if
(
y
<
0
)
y
=
0
;
if
(
y
<
0
)
y
=
0
;
BitBlt32
(
hdc
,
x
,
y
,
info
Ptr
->
bitmapSize
.
cx
,
BitBlt32
(
hdc
,
x
,
y
,
desktop
Ptr
->
bitmapSize
.
cx
,
info
Ptr
->
bitmapSize
.
cy
,
hMemDC
,
0
,
0
,
SRCCOPY
);
desktop
Ptr
->
bitmapSize
.
cy
,
hMemDC
,
0
,
0
,
SRCCOPY
);
}
}
DeleteDC32
(
hMemDC
);
DeleteDC32
(
hMemDC
);
}
}
...
@@ -137,7 +173,7 @@ LRESULT WINAPI DesktopWndProc( HWND32 hwnd, UINT32 message,
...
@@ -137,7 +173,7 @@ LRESULT WINAPI DesktopWndProc( HWND32 hwnd, UINT32 message,
WPARAM32
wParam
,
LPARAM
lParam
)
WPARAM32
wParam
,
LPARAM
lParam
)
{
{
WND
*
wndPtr
=
WIN_FindWndPtr
(
hwnd
);
WND
*
wndPtr
=
WIN_FindWndPtr
(
hwnd
);
DESKTOP
INFO
*
infoPtr
=
(
DESKTOPINFO
*
)
wndPtr
->
wExtra
;
DESKTOP
*
desktopPtr
=
(
DESKTOP
*
)
wndPtr
->
wExtra
;
/* Most messages are ignored (we DON'T call DefWindowProc) */
/* Most messages are ignored (we DON'T call DefWindowProc) */
...
@@ -146,15 +182,17 @@ LRESULT WINAPI DesktopWndProc( HWND32 hwnd, UINT32 message,
...
@@ -146,15 +182,17 @@ LRESULT WINAPI DesktopWndProc( HWND32 hwnd, UINT32 message,
/* Warning: this message is sent directly by */
/* Warning: this message is sent directly by */
/* WIN_CreateDesktopWindow() and does not contain a valid lParam */
/* WIN_CreateDesktopWindow() and does not contain a valid lParam */
case
WM_NCCREATE
:
case
WM_NCCREATE
:
info
Ptr
->
hbrushPattern
=
0
;
desktop
Ptr
->
hbrushPattern
=
0
;
info
Ptr
->
hbitmapWallPaper
=
0
;
desktop
Ptr
->
hbitmapWallPaper
=
0
;
SetDeskPattern
();
SetDeskPattern
();
SetDeskWallPaper32
(
(
LPSTR
)
-
1
);
SetDeskWallPaper32
(
(
LPSTR
)
-
1
);
return
1
;
return
1
;
case
WM_ERASEBKGND
:
case
WM_ERASEBKGND
:
if
(
rootWindow
==
DefaultRootWindow
(
display
))
return
1
;
if
(
X11DRV_WND_GetXRootWindow
(
wndPtr
)
==
return
DESKTOP_DoEraseBkgnd
(
hwnd
,
(
HDC32
)
wParam
,
infoPtr
);
DefaultRootWindow
(
display
))
return
1
;
return
DESKTOP_DoEraseBkgnd
(
hwnd
,
(
HDC32
)
wParam
,
desktopPtr
);
case
WM_SYSCOMMAND
:
case
WM_SYSCOMMAND
:
if
((
wParam
&
0xfff0
)
!=
SC_CLOSE
)
return
0
;
if
((
wParam
&
0xfff0
)
!=
SC_CLOSE
)
return
0
;
...
@@ -175,9 +213,9 @@ BOOL32 WINAPI PaintDesktop(HDC32 hdc)
...
@@ -175,9 +213,9 @@ BOOL32 WINAPI PaintDesktop(HDC32 hdc)
{
{
HWND32
hwnd
=
GetDesktopWindow32
();
HWND32
hwnd
=
GetDesktopWindow32
();
WND
*
wndPtr
=
WIN_FindWndPtr
(
hwnd
);
WND
*
wndPtr
=
WIN_FindWndPtr
(
hwnd
);
DESKTOP
INFO
*
infoPtr
=
(
DESKTOPINFO
*
)
wndPtr
->
wExtra
;
DESKTOP
*
desktopPtr
=
(
DESKTOP
*
)
wndPtr
->
wExtra
;
return
DESKTOP_DoEraseBkgnd
(
hwnd
,
hdc
,
info
Ptr
);
return
DESKTOP_DoEraseBkgnd
(
hwnd
,
hdc
,
desktop
Ptr
);
}
}
/***********************************************************************
/***********************************************************************
...
@@ -211,7 +249,7 @@ BOOL32 WINAPI SetDeskWallPaper32( LPCSTR filename )
...
@@ -211,7 +249,7 @@ BOOL32 WINAPI SetDeskWallPaper32( LPCSTR filename )
HDC32
hdc
;
HDC32
hdc
;
char
buffer
[
256
];
char
buffer
[
256
];
WND
*
wndPtr
=
WIN_GetDesktop
();
WND
*
wndPtr
=
WIN_GetDesktop
();
DESKTOP
INFO
*
infoPtr
=
(
DESKTOPINFO
*
)
wndPtr
->
wExtra
;
DESKTOP
*
desktopPtr
=
(
DESKTOP
*
)
wndPtr
->
wExtra
;
if
(
filename
==
(
LPSTR
)
-
1
)
if
(
filename
==
(
LPSTR
)
-
1
)
{
{
...
@@ -221,15 +259,15 @@ BOOL32 WINAPI SetDeskWallPaper32( LPCSTR filename )
...
@@ -221,15 +259,15 @@ BOOL32 WINAPI SetDeskWallPaper32( LPCSTR filename )
hdc
=
GetDC32
(
0
);
hdc
=
GetDC32
(
0
);
hbitmap
=
DESKTOP_LoadBitmap
(
hdc
,
filename
);
hbitmap
=
DESKTOP_LoadBitmap
(
hdc
,
filename
);
ReleaseDC32
(
0
,
hdc
);
ReleaseDC32
(
0
,
hdc
);
if
(
infoPtr
->
hbitmapWallPaper
)
DeleteObject32
(
info
Ptr
->
hbitmapWallPaper
);
if
(
desktopPtr
->
hbitmapWallPaper
)
DeleteObject32
(
desktop
Ptr
->
hbitmapWallPaper
);
info
Ptr
->
hbitmapWallPaper
=
hbitmap
;
desktop
Ptr
->
hbitmapWallPaper
=
hbitmap
;
info
Ptr
->
fTileWallPaper
=
GetProfileInt32A
(
"desktop"
,
"TileWallPaper"
,
0
);
desktop
Ptr
->
fTileWallPaper
=
GetProfileInt32A
(
"desktop"
,
"TileWallPaper"
,
0
);
if
(
hbitmap
)
if
(
hbitmap
)
{
{
BITMAP32
bmp
;
BITMAP32
bmp
;
GetObject32A
(
hbitmap
,
sizeof
(
bmp
),
&
bmp
);
GetObject32A
(
hbitmap
,
sizeof
(
bmp
),
&
bmp
);
info
Ptr
->
bitmapSize
.
cx
=
(
bmp
.
bmWidth
!=
0
)
?
bmp
.
bmWidth
:
1
;
desktop
Ptr
->
bitmapSize
.
cx
=
(
bmp
.
bmWidth
!=
0
)
?
bmp
.
bmWidth
:
1
;
info
Ptr
->
bitmapSize
.
cy
=
(
bmp
.
bmHeight
!=
0
)
?
bmp
.
bmHeight
:
1
;
desktop
Ptr
->
bitmapSize
.
cy
=
(
bmp
.
bmHeight
!=
0
)
?
bmp
.
bmHeight
:
1
;
}
}
return
TRUE
;
return
TRUE
;
}
}
...
@@ -243,10 +281,10 @@ BOOL32 WINAPI SetDeskWallPaper32( LPCSTR filename )
...
@@ -243,10 +281,10 @@ BOOL32 WINAPI SetDeskWallPaper32( LPCSTR filename )
BOOL32
DESKTOP_SetPattern
(
LPCSTR
pattern
)
BOOL32
DESKTOP_SetPattern
(
LPCSTR
pattern
)
{
{
WND
*
wndPtr
=
WIN_GetDesktop
();
WND
*
wndPtr
=
WIN_GetDesktop
();
DESKTOP
INFO
*
infoPtr
=
(
DESKTOPINFO
*
)
wndPtr
->
wExtra
;
DESKTOP
*
desktopPtr
=
(
DESKTOP
*
)
wndPtr
->
wExtra
;
int
pat
[
8
];
int
pat
[
8
];
if
(
infoPtr
->
hbrushPattern
)
DeleteObject32
(
info
Ptr
->
hbrushPattern
);
if
(
desktopPtr
->
hbrushPattern
)
DeleteObject32
(
desktop
Ptr
->
hbrushPattern
);
memset
(
pat
,
0
,
sizeof
(
pat
)
);
memset
(
pat
,
0
,
sizeof
(
pat
)
);
if
(
pattern
&&
sscanf
(
pattern
,
" %d %d %d %d %d %d %d %d"
,
if
(
pattern
&&
sscanf
(
pattern
,
" %d %d %d %d %d %d %d %d"
,
&
pat
[
0
],
&
pat
[
1
],
&
pat
[
2
],
&
pat
[
3
],
&
pat
[
0
],
&
pat
[
1
],
&
pat
[
2
],
&
pat
[
3
],
...
@@ -258,10 +296,10 @@ BOOL32 DESKTOP_SetPattern( LPCSTR pattern )
...
@@ -258,10 +296,10 @@ BOOL32 DESKTOP_SetPattern( LPCSTR pattern )
for
(
i
=
0
;
i
<
8
;
i
++
)
pattern
[
i
]
=
pat
[
i
]
&
0xffff
;
for
(
i
=
0
;
i
<
8
;
i
++
)
pattern
[
i
]
=
pat
[
i
]
&
0xffff
;
hbitmap
=
CreateBitmap32
(
8
,
8
,
1
,
1
,
(
LPSTR
)
pattern
);
hbitmap
=
CreateBitmap32
(
8
,
8
,
1
,
1
,
(
LPSTR
)
pattern
);
info
Ptr
->
hbrushPattern
=
CreatePatternBrush32
(
hbitmap
);
desktop
Ptr
->
hbrushPattern
=
CreatePatternBrush32
(
hbitmap
);
DeleteObject32
(
hbitmap
);
DeleteObject32
(
hbitmap
);
}
}
else
info
Ptr
->
hbrushPattern
=
CreateSolidBrush32
(
GetSysColor32
(
COLOR_BACKGROUND
)
);
else
desktop
Ptr
->
hbrushPattern
=
CreateSolidBrush32
(
GetSysColor32
(
COLOR_BACKGROUND
)
);
return
TRUE
;
return
TRUE
;
}
}
controls/widgets.c
View file @
8d8703cb
...
@@ -68,7 +68,7 @@ static WNDCLASS32A WIDGETS_BuiltinClasses[BIC32_NB_CLASSES] =
...
@@ -68,7 +68,7 @@ static WNDCLASS32A WIDGETS_BuiltinClasses[BIC32_NB_CLASSES] =
{
CS_GLOBALCLASS
,
MDIClientWndProc
,
{
CS_GLOBALCLASS
,
MDIClientWndProc
,
0
,
sizeof
(
MDICLIENTINFO
),
0
,
0
,
0
,
STOCK_LTGRAY_BRUSH
,
0
,
"MDIClient"
},
0
,
sizeof
(
MDICLIENTINFO
),
0
,
0
,
0
,
STOCK_LTGRAY_BRUSH
,
0
,
"MDIClient"
},
/* BIC32_DESKTOP */
/* BIC32_DESKTOP */
{
CS_GLOBALCLASS
,
DesktopWndProc
,
0
,
sizeof
(
DESKTOP
INFO
),
{
CS_GLOBALCLASS
,
DesktopWndProc
,
0
,
sizeof
(
DESKTOP
),
0
,
0
,
(
HCURSOR32
)
IDC_ARROW32A
,
0
,
0
,
DESKTOP_CLASS_NAME
},
0
,
0
,
(
HCURSOR32
)
IDC_ARROW32A
,
0
,
0
,
DESKTOP_CLASS_NAME
},
/* BIC32_DIALOG */
/* BIC32_DIALOG */
{
CS_GLOBALCLASS
|
CS_SAVEBITS
,
DefDlgProc32A
,
0
,
DLGWINDOWEXTRA
,
{
CS_GLOBALCLASS
|
CS_SAVEBITS
,
DefDlgProc32A
,
0
,
DLGWINDOWEXTRA
,
...
...
debugger/dbg.y
View file @
8d8703cb
...
@@ -7,6 +7,7 @@
...
@@ -7,6 +7,7 @@
*/
*/
#include "ts_xlib.h"
#include "ts_xlib.h"
#include "x11drv.h"
#include <stdio.h>
#include <stdio.h>
#include <signal.h>
#include <signal.h>
...
@@ -24,8 +25,6 @@
...
@@ -24,8 +25,6 @@
#include "neexe.h"
#include "neexe.h"
#include "process.h"
#include "process.h"
#include "main.h"
#include "main.h"
#include "ts_xlib.h"
#include "expr.h"
#include "expr.h"
extern FILE * yyin;
extern FILE * yyin;
...
...
graphics/ddraw.c
View file @
8d8703cb
...
@@ -15,22 +15,38 @@
...
@@ -15,22 +15,38 @@
*/
*/
#include "config.h"
#include "config.h"
#include <unistd.h>
#include <assert.h>
#include "ts_xlib.h"
#include "ts_xlib.h"
#include "ts_xutil.h"
#include "ts_xutil.h"
#include <sys/signal.h>
#include <fcntl.h>
#ifdef HAVE_LIBXXSHM
#include <string.h>
#include <sys/types.h>
#include <stdlib.h>
#include <sys/ipc.h>
#include "windows.h"
#include <sys/shm.h>
#include "ts_xshm.h"
#endif
/* defined(HAVE_LIBXXSHM) */
#ifdef HAVE_LIBXXF86DGA
#include "ts_xf86dga.h"
#endif
/* defined(HAVE_LIBXXF86DGA) */
#ifdef HAVE_LIBXXF86VM
#ifdef HAVE_LIBXXF86VM
/* X is retarted and insists on declaring INT32, INT16 etc in Xmd.h,
/* X is retarted and insists on declaring INT32, INT16 etc in Xmd.h,
this is a crude hack to get around it */
this is a crude hack to get around it */
#define XMD_H
#define XMD_H
#include "wintypes.h"
#include "ts_xf86vmode.h"
#include "ts_xf86vmode.h"
#endif
#endif
/* defined(HAVE_LIBXXF86VM) */
#include "x11drv.h"
#include <unistd.h>
#include <assert.h>
#include <sys/signal.h>
#include <fcntl.h>
#include <string.h>
#include <stdlib.h>
#include "windows.h"
#include "winerror.h"
#include "winerror.h"
#include "gdi.h"
#include "gdi.h"
...
@@ -44,21 +60,9 @@
...
@@ -44,21 +60,9 @@
#include "debug.h"
#include "debug.h"
#include "spy.h"
#include "spy.h"
#include "message.h"
#include "message.h"
#include "x11drv.h"
#include "options.h"
#include "options.h"
#include "objbase.h"
#include "objbase.h"
#include "monitor.h"
#ifdef HAVE_LIBXXF86DGA
#include "ts_xf86dga.h"
#include <sys/mman.h>
#endif
#ifdef HAVE_LIBXXSHM
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#include "ts_xshm.h"
#endif
/* This for all the enumeration and creation of D3D-related objects */
/* This for all the enumeration and creation of D3D-related objects */
#include "d3d_private.h"
#include "d3d_private.h"
...
@@ -444,7 +448,7 @@ static void Xlib_copy_surface_on_screen(LPDIRECTDRAWSURFACE4 this) {
...
@@ -444,7 +448,7 @@ static void Xlib_copy_surface_on_screen(LPDIRECTDRAWSURFACE4 this) {
if
(
this
->
s
.
ddraw
->
e
.
xlib
.
xshm_active
)
if
(
this
->
s
.
ddraw
->
e
.
xlib
.
xshm_active
)
TSXShmPutImage
(
display
,
TSXShmPutImage
(
display
,
this
->
s
.
ddraw
->
d
.
drawable
,
this
->
s
.
ddraw
->
d
.
drawable
,
DefaultGCOfScreen
(
screen
),
DefaultGCOfScreen
(
X11DRV_GetXScreen
()
),
this
->
t
.
xlib
.
image
,
this
->
t
.
xlib
.
image
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
this
->
t
.
xlib
.
image
->
width
,
this
->
t
.
xlib
.
image
->
width
,
...
@@ -454,7 +458,7 @@ static void Xlib_copy_surface_on_screen(LPDIRECTDRAWSURFACE4 this) {
...
@@ -454,7 +458,7 @@ static void Xlib_copy_surface_on_screen(LPDIRECTDRAWSURFACE4 this) {
#endif
#endif
TSXPutImage
(
display
,
TSXPutImage
(
display
,
this
->
s
.
ddraw
->
d
.
drawable
,
this
->
s
.
ddraw
->
d
.
drawable
,
DefaultGCOfScreen
(
screen
),
DefaultGCOfScreen
(
X11DRV_GetXScreen
()
),
this
->
t
.
xlib
.
image
,
this
->
t
.
xlib
.
image
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
this
->
t
.
xlib
.
image
->
width
,
this
->
t
.
xlib
.
image
->
width
,
...
@@ -570,7 +574,8 @@ static HRESULT WINAPI Xlib_IDirectDrawSurface4_SetPalette(
...
@@ -570,7 +574,8 @@ static HRESULT WINAPI Xlib_IDirectDrawSurface4_SetPalette(
if
(
!
(
pal
->
cm
)
&&
(
this
->
s
.
ddraw
->
d
.
screen_depth
<=
8
))
if
(
!
(
pal
->
cm
)
&&
(
this
->
s
.
ddraw
->
d
.
screen_depth
<=
8
))
{
{
pal
->
cm
=
TSXCreateColormap
(
display
,
this
->
s
.
ddraw
->
d
.
drawable
,
DefaultVisualOfScreen
(
screen
),
AllocAll
);
pal
->
cm
=
TSXCreateColormap
(
display
,
this
->
s
.
ddraw
->
d
.
drawable
,
DefaultVisualOfScreen
(
X11DRV_GetXScreen
()),
AllocAll
);
if
(
!
Options
.
managed
)
if
(
!
Options
.
managed
)
TSXInstallColormap
(
display
,
pal
->
cm
);
TSXInstallColormap
(
display
,
pal
->
cm
);
...
@@ -2286,7 +2291,7 @@ static XImage *create_ximage(LPDIRECTDRAW2 this, LPDIRECTDRAWSURFACE4 lpdsf) {
...
@@ -2286,7 +2291,7 @@ static XImage *create_ximage(LPDIRECTDRAW2 this, LPDIRECTDRAWSURFACE4 lpdsf) {
#ifdef HAVE_LIBXXSHM
#ifdef HAVE_LIBXXSHM
if
(
this
->
e
.
xlib
.
xshm_active
)
{
if
(
this
->
e
.
xlib
.
xshm_active
)
{
img
=
TSXShmCreateImage
(
display
,
img
=
TSXShmCreateImage
(
display
,
DefaultVisualOfScreen
(
screen
),
DefaultVisualOfScreen
(
X11DRV_GetXScreen
()
),
this
->
d
.
screen_depth
,
this
->
d
.
screen_depth
,
ZPixmap
,
ZPixmap
,
NULL
,
NULL
,
...
@@ -2345,7 +2350,7 @@ static XImage *create_ximage(LPDIRECTDRAW2 this, LPDIRECTDRAWSURFACE4 lpdsf) {
...
@@ -2345,7 +2350,7 @@ static XImage *create_ximage(LPDIRECTDRAW2 this, LPDIRECTDRAWSURFACE4 lpdsf) {
/* In this case, create an XImage */
/* In this case, create an XImage */
img
=
img
=
TSXCreateImage
(
display
,
TSXCreateImage
(
display
,
DefaultVisualOfScreen
(
screen
),
DefaultVisualOfScreen
(
X11DRV_GetXScreen
()
),
this
->
d
.
screen_depth
,
this
->
d
.
screen_depth
,
ZPixmap
,
ZPixmap
,
0
,
0
,
...
@@ -2510,7 +2515,7 @@ static HRESULT WINAPI IDirectDraw2_SetCooperativeLevel(
...
@@ -2510,7 +2515,7 @@ static HRESULT WINAPI IDirectDraw2_SetCooperativeLevel(
/* This will be overwritten in the case of Full Screen mode.
/* This will be overwritten in the case of Full Screen mode.
Windowed games could work with that :-) */
Windowed games could work with that :-) */
if
(
hwnd
)
if
(
hwnd
)
this
->
d
.
drawable
=
((
X11DRV_WND_DATA
*
)
WIN_FindWndPtr
(
hwnd
)
->
pDriverData
)
->
window
;
this
->
d
.
drawable
=
X11DRV_WND_GetXWindow
(
WIN_FindWndPtr
(
hwnd
))
;
return
DD_OK
;
return
DD_OK
;
}
}
...
@@ -2571,6 +2576,7 @@ static HRESULT WINAPI DGA_IDirectDraw_SetDisplayMode(
...
@@ -2571,6 +2576,7 @@ static HRESULT WINAPI DGA_IDirectDraw_SetDisplayMode(
this
->
d
.
screen_depth
=
depth
;
this
->
d
.
screen_depth
=
depth
;
depths
=
TSXListDepths
(
display
,
DefaultScreen
(
display
),
&
depcount
);
depths
=
TSXListDepths
(
display
,
DefaultScreen
(
display
),
&
depcount
);
for
(
i
=
0
;
i
<
depcount
;
i
++
)
for
(
i
=
0
;
i
<
depcount
;
i
++
)
if
(
depths
[
i
]
==
depth
)
if
(
depths
[
i
]
==
depth
)
break
;
break
;
...
@@ -2673,6 +2679,7 @@ static HRESULT WINAPI Xlib_IDirectDraw_SetDisplayMode(
...
@@ -2673,6 +2679,7 @@ static HRESULT WINAPI Xlib_IDirectDraw_SetDisplayMode(
this
->
d
.
screen_depth
=
depth
;
this
->
d
.
screen_depth
=
depth
;
depths
=
TSXListDepths
(
display
,
DefaultScreen
(
display
),
&
depcount
);
depths
=
TSXListDepths
(
display
,
DefaultScreen
(
display
),
&
depcount
);
for
(
i
=
0
;
i
<
depcount
;
i
++
)
for
(
i
=
0
;
i
<
depcount
;
i
++
)
if
(
depths
[
i
]
==
depth
)
if
(
depths
[
i
]
==
depth
)
break
;
break
;
...
@@ -2859,7 +2866,7 @@ static HRESULT WINAPI DGA_IDirectDraw2_CreatePalette(
...
@@ -2859,7 +2866,7 @@ static HRESULT WINAPI DGA_IDirectDraw2_CreatePalette(
if
(
res
!=
0
)
return
res
;
if
(
res
!=
0
)
return
res
;
(
*
lpddpal
)
->
lpvtbl
=
&
dga_ddpalvt
;
(
*
lpddpal
)
->
lpvtbl
=
&
dga_ddpalvt
;
if
(
this
->
d
.
depth
<=
8
)
{
if
(
this
->
d
.
depth
<=
8
)
{
(
*
lpddpal
)
->
cm
=
TSXCreateColormap
(
display
,
DefaultRootWindow
(
display
),
DefaultVisualOfScreen
(
screen
),
AllocAll
);
(
*
lpddpal
)
->
cm
=
TSXCreateColormap
(
display
,
DefaultRootWindow
(
display
),
DefaultVisualOfScreen
(
X11DRV_GetXScreen
()
),
AllocAll
);
}
else
{
}
else
{
FIXME
(
ddraw
,
"why are we doing CreatePalette in hi/truecolor?
\n
"
);
FIXME
(
ddraw
,
"why are we doing CreatePalette in hi/truecolor?
\n
"
);
(
*
lpddpal
)
->
cm
=
0
;
(
*
lpddpal
)
->
cm
=
0
;
...
@@ -3182,8 +3189,8 @@ static HRESULT WINAPI IDirectDraw2_EnumDisplayModes(
...
@@ -3182,8 +3189,8 @@ static HRESULT WINAPI IDirectDraw2_EnumDisplayModes(
}
}
}
}
ddsfd
.
dwWidth
=
screenWidth
;
ddsfd
.
dwWidth
=
MONITOR_GetWidth
(
&
MONITOR_PrimaryMonitor
)
;
ddsfd
.
dwHeight
=
screenHeight
;
ddsfd
.
dwHeight
=
MONITOR_GetHeight
(
&
MONITOR_PrimaryMonitor
)
;
TRACE
(
ddraw
,
" enumerating (%ldx%ldx%d)
\n
"
,
ddsfd
.
dwWidth
,
ddsfd
.
dwHeight
,
depths
[
i
]);
TRACE
(
ddraw
,
" enumerating (%ldx%ldx%d)
\n
"
,
ddsfd
.
dwWidth
,
ddsfd
.
dwHeight
,
depths
[
i
]);
if
(
!
modescb
(
&
ddsfd
,
context
))
return
DD_OK
;
if
(
!
modescb
(
&
ddsfd
,
context
))
return
DD_OK
;
...
@@ -3212,8 +3219,8 @@ static HRESULT WINAPI DGA_IDirectDraw2_GetDisplayMode(
...
@@ -3212,8 +3219,8 @@ static HRESULT WINAPI DGA_IDirectDraw2_GetDisplayMode(
#ifdef HAVE_LIBXXF86DGA
#ifdef HAVE_LIBXXF86DGA
TRACE
(
ddraw
,
"(%p)->(%p)
\n
"
,
this
,
lpddsfd
);
TRACE
(
ddraw
,
"(%p)->(%p)
\n
"
,
this
,
lpddsfd
);
lpddsfd
->
dwFlags
=
DDSD_HEIGHT
|
DDSD_WIDTH
|
DDSD_PITCH
|
DDSD_BACKBUFFERCOUNT
|
DDSD_PIXELFORMAT
|
DDSD_CAPS
;
lpddsfd
->
dwFlags
=
DDSD_HEIGHT
|
DDSD_WIDTH
|
DDSD_PITCH
|
DDSD_BACKBUFFERCOUNT
|
DDSD_PIXELFORMAT
|
DDSD_CAPS
;
lpddsfd
->
dwHeight
=
screenHeight
;
lpddsfd
->
dwHeight
=
MONITOR_GetHeight
(
&
MONITOR_PrimaryMonitor
)
;
lpddsfd
->
dwWidth
=
screenWidth
;
lpddsfd
->
dwWidth
=
MONITOR_GetWidth
(
&
MONITOR_PrimaryMonitor
)
;
lpddsfd
->
lPitch
=
this
->
e
.
dga
.
fb_width
*
this
->
d
.
depth
/
8
;
lpddsfd
->
lPitch
=
this
->
e
.
dga
.
fb_width
*
this
->
d
.
depth
/
8
;
lpddsfd
->
dwBackBufferCount
=
1
;
lpddsfd
->
dwBackBufferCount
=
1
;
lpddsfd
->
x
.
dwRefreshRate
=
60
;
lpddsfd
->
x
.
dwRefreshRate
=
60
;
...
@@ -3230,8 +3237,8 @@ static HRESULT WINAPI Xlib_IDirectDraw2_GetDisplayMode(
...
@@ -3230,8 +3237,8 @@ static HRESULT WINAPI Xlib_IDirectDraw2_GetDisplayMode(
)
{
)
{
TRACE
(
ddraw
,
"(%p)->GetDisplayMode(%p)
\n
"
,
this
,
lpddsfd
);
TRACE
(
ddraw
,
"(%p)->GetDisplayMode(%p)
\n
"
,
this
,
lpddsfd
);
lpddsfd
->
dwFlags
=
DDSD_HEIGHT
|
DDSD_WIDTH
|
DDSD_PITCH
|
DDSD_BACKBUFFERCOUNT
|
DDSD_PIXELFORMAT
|
DDSD_CAPS
;
lpddsfd
->
dwFlags
=
DDSD_HEIGHT
|
DDSD_WIDTH
|
DDSD_PITCH
|
DDSD_BACKBUFFERCOUNT
|
DDSD_PIXELFORMAT
|
DDSD_CAPS
;
lpddsfd
->
dwHeight
=
screenHeight
;
lpddsfd
->
dwHeight
=
MONITOR_GetHeight
(
&
MONITOR_PrimaryMonitor
)
;
lpddsfd
->
dwWidth
=
screenWidth
;
lpddsfd
->
dwWidth
=
MONITOR_GetWidth
(
&
MONITOR_PrimaryMonitor
)
;
/* POOLE FIXME: Xlib */
/* POOLE FIXME: Xlib */
lpddsfd
->
lPitch
=
this
->
e
.
dga
.
fb_width
*
this
->
d
.
depth
/
8
;
lpddsfd
->
lPitch
=
this
->
e
.
dga
.
fb_width
*
this
->
d
.
depth
/
8
;
/* END FIXME: Xlib */
/* END FIXME: Xlib */
...
@@ -3660,7 +3667,7 @@ HRESULT WINAPI DGA_DirectDrawCreate( LPDIRECTDRAW *lplpDD, LPUNKNOWN pUnkOuter)
...
@@ -3660,7 +3667,7 @@ HRESULT WINAPI DGA_DirectDrawCreate( LPDIRECTDRAW *lplpDD, LPUNKNOWN pUnkOuter)
TSXF86DGAGetViewPortSize
(
display
,
DefaultScreen
(
display
),
&
width
,
&
height
);
TSXF86DGAGetViewPortSize
(
display
,
DefaultScreen
(
display
),
&
width
,
&
height
);
TSXF86DGASetViewPort
(
display
,
DefaultScreen
(
display
),
0
,
0
);
TSXF86DGASetViewPort
(
display
,
DefaultScreen
(
display
),
0
,
0
);
(
*
lplpDD
)
->
e
.
dga
.
fb_height
=
screenHeight
;
(
*
lplpDD
)
->
e
.
dga
.
fb_height
=
MONITOR_GetHeight
(
&
MONITOR_PrimaryMonitor
)
;
#ifdef DIABLO_HACK
#ifdef DIABLO_HACK
(
*
lplpDD
)
->
e
.
dga
.
vpmask
=
1
;
(
*
lplpDD
)
->
e
.
dga
.
vpmask
=
1
;
#else
#else
...
@@ -3668,8 +3675,8 @@ HRESULT WINAPI DGA_DirectDrawCreate( LPDIRECTDRAW *lplpDD, LPUNKNOWN pUnkOuter)
...
@@ -3668,8 +3675,8 @@ HRESULT WINAPI DGA_DirectDrawCreate( LPDIRECTDRAW *lplpDD, LPUNKNOWN pUnkOuter)
#endif
#endif
/* just assume the default depth is the DGA depth too */
/* just assume the default depth is the DGA depth too */
(
*
lplpDD
)
->
d
.
screen_depth
=
DefaultDepthOfScreen
(
screen
);
(
*
lplpDD
)
->
d
.
screen_depth
=
DefaultDepthOfScreen
(
X11DRV_GetXScreen
()
);
(
*
lplpDD
)
->
d
.
depth
=
DefaultDepthOfScreen
(
screen
);
(
*
lplpDD
)
->
d
.
depth
=
DefaultDepthOfScreen
(
X11DRV_GetXScreen
()
);
#ifdef RESTORE_SIGNALS
#ifdef RESTORE_SIGNALS
if
(
SIGNAL_Reinit
)
SIGNAL_Reinit
();
if
(
SIGNAL_Reinit
)
SIGNAL_Reinit
();
#endif
#endif
...
@@ -3708,10 +3715,9 @@ HRESULT WINAPI Xlib_DirectDrawCreate( LPDIRECTDRAW *lplpDD, LPUNKNOWN pUnkOuter)
...
@@ -3708,10 +3715,9 @@ HRESULT WINAPI Xlib_DirectDrawCreate( LPDIRECTDRAW *lplpDD, LPUNKNOWN pUnkOuter)
(
*
lplpDD
)
->
ref
=
1
;
(
*
lplpDD
)
->
ref
=
1
;
(
*
lplpDD
)
->
d
.
drawable
=
0
;
/* in SetDisplayMode */
(
*
lplpDD
)
->
d
.
drawable
=
0
;
/* in SetDisplayMode */
(
*
lplpDD
)
->
d
.
screen_depth
=
DefaultDepthOfScreen
(
screen
);
(
*
lplpDD
)
->
d
.
screen_depth
=
DefaultDepthOfScreen
(
X11DRV_GetXScreen
());
(
*
lplpDD
)
->
d
.
depth
=
DefaultDepthOfScreen
(
screen
);
(
*
lplpDD
)
->
d
.
height
=
MONITOR_GetHeight
(
&
MONITOR_PrimaryMonitor
);
(
*
lplpDD
)
->
d
.
height
=
screenHeight
;
(
*
lplpDD
)
->
d
.
width
=
MONITOR_GetWidth
(
&
MONITOR_PrimaryMonitor
);
(
*
lplpDD
)
->
d
.
width
=
screenWidth
;
#ifdef HAVE_LIBXXSHM
#ifdef HAVE_LIBXXSHM
/* Test if XShm is available. */
/* Test if XShm is available. */
...
@@ -3771,6 +3777,7 @@ HRESULT WINAPI DirectDrawCreate( LPGUID lpGUID, LPDIRECTDRAW *lplpDD, LPUNKNOWN
...
@@ -3771,6 +3777,7 @@ HRESULT WINAPI DirectDrawCreate( LPGUID lpGUID, LPDIRECTDRAW *lplpDD, LPUNKNOWN
else
else
goto
err
;
goto
err
;
(
*
lplpDD
)
->
d
.
winclass
=
RegisterClass32A
(
&
wc
);
(
*
lplpDD
)
->
d
.
winclass
=
RegisterClass32A
(
&
wc
);
return
ret
;
return
ret
;
...
...
graphics/painting.c
View file @
8d8703cb
...
@@ -5,11 +5,13 @@
...
@@ -5,11 +5,13 @@
* Copyright 1997 Bertho A. Stultiens
* Copyright 1997 Bertho A. Stultiens
*/
*/
#include <math.h>
#include <X11/Intrinsic.h>
#include <stdlib.h>
#include "ts_xlib.h"
#include "ts_xlib.h"
#include "ts_xutil.h"
#include "ts_xutil.h"
#include <X11/Intrinsic.h>
#include "x11drv.h"
#include <math.h>
#include <stdlib.h>
#ifndef PI
#ifndef PI
#define PI M_PI
#define PI M_PI
#endif
#endif
...
@@ -19,13 +21,14 @@
...
@@ -19,13 +21,14 @@
#include "callback.h"
#include "callback.h"
#include "heap.h"
#include "heap.h"
#include "metafile.h"
#include "metafile.h"
#include "monitor.h"
#include "palette.h"
#include "palette.h"
#include "cache.h"
#include "cache.h"
#include "region.h"
#include "region.h"
#include "path.h"
#include "path.h"
#include "debug.h"
#include "debug.h"
#include "winerror.h"
#include "winerror.h"
#include "x11drv.h"
/***********************************************************************
/***********************************************************************
* LineTo16 (GDI.19)
* LineTo16 (GDI.19)
...
@@ -681,7 +684,7 @@ void WINAPI DrawFocusRect32( HDC32 hdc, const RECT32* rc )
...
@@ -681,7 +684,7 @@ void WINAPI DrawFocusRect32( HDC32 hdc, const RECT32* rc )
oldBkMode
=
SetBkMode32
(
hdc
,
TRANSPARENT
);
oldBkMode
=
SetBkMode32
(
hdc
,
TRANSPARENT
);
/* Hack: make sure the XORPEN operation has an effect */
/* Hack: make sure the XORPEN operation has an effect */
physDev
->
pen
.
pixel
=
(
1
<<
screenDepth
)
-
1
;
physDev
->
pen
.
pixel
=
(
1
<<
MONITOR_GetDepth
(
&
MONITOR_PrimaryMonitor
)
)
-
1
;
if
(
X11DRV_SetupGCForPen
(
dc
))
if
(
X11DRV_SetupGCForPen
(
dc
))
TSXDrawRectangle
(
display
,
physDev
->
drawable
,
physDev
->
gc
,
TSXDrawRectangle
(
display
,
physDev
->
drawable
,
physDev
->
gc
,
...
...
graphics/wing.c
View file @
8d8703cb
...
@@ -4,21 +4,26 @@
...
@@ -4,21 +4,26 @@
* Started by Robert Pouliot <krynos@clic.net>
* Started by Robert Pouliot <krynos@clic.net>
*/
*/
#include "config.h"
#include "ts_xlib.h"
#include "ts_xlib.h"
#i
nclude "ts_xshm.h"
#i
fdef HAVE_LIBXXSHM
#include <sys/types.h>
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/ipc.h>
#ifndef __EMX__
#ifndef __EMX__
#include <sys/shm.h>
#include <sys/shm.h>
#endif
#endif
/* !defined(__EMX__) */
#include "ts_xshm.h"
#endif
/* defined(HAVE_LIBXXSHM) */
#include "x11drv.h"
#include "windows.h"
#include "bitmap.h"
#include "bitmap.h"
#include "dc.h"
#include "dc.h"
#include "debug.h"
#include "gdi.h"
#include "gdi.h"
#include "monitor.h"
#include "wintypes.h"
#include "xmalloc.h"
#include "xmalloc.h"
#include "x11drv.h"
#include "debug.h"
typedef
enum
WING_DITHER_TYPE
typedef
enum
WING_DITHER_TYPE
{
{
...
@@ -46,18 +51,20 @@ static void __initWinG(void)
...
@@ -46,18 +51,20 @@ static void __initWinG(void)
{
{
if
(
__WinGOK
<
0
)
if
(
__WinGOK
<
0
)
{
{
#ifdef HAVE_LIBXXSHM
Status
s
=
TSXShmQueryExtension
(
display
);
Status
s
=
TSXShmQueryExtension
(
display
);
if
(
s
)
if
(
s
)
{
{
int
i
=
TSXShmPixmapFormat
(
display
);
int
i
=
TSXShmPixmapFormat
(
display
);
if
(
i
==
ZPixmap
&&
screenDepth
==
8
)
if
(
i
==
ZPixmap
&&
MONITOR_GetDepth
(
&
MONITOR_PrimaryMonitor
)
==
8
)
{
{
__WinGOK
=
True
;
__WinGOK
=
1
;
return
;
return
;
}
}
}
}
#endif
/* defined(HAVE_LIBXXSHM) */
FIXME
(
wing
,
"WinG: incorrect depth or unsupported card.
\n
"
);
FIXME
(
wing
,
"WinG: incorrect depth or unsupported card.
\n
"
);
__WinGOK
=
False
;
__WinGOK
=
0
;
}
}
}
}
...
@@ -126,7 +133,9 @@ HBITMAP16 WINAPI WinGCreateBitmap16(HDC16 winDC, BITMAPINFO *header,
...
@@ -126,7 +133,9 @@ HBITMAP16 WINAPI WinGCreateBitmap16(HDC16 winDC, BITMAPINFO *header,
HBITMAP16
hbitmap
=
GDI_AllocObject
(
sizeof
(
BITMAPOBJ
),
BITMAP_MAGIC
);
HBITMAP16
hbitmap
=
GDI_AllocObject
(
sizeof
(
BITMAPOBJ
),
BITMAP_MAGIC
);
if
(
hbitmap
)
if
(
hbitmap
)
{
{
#ifdef HAVE_LIBXXSHM
__ShmBitmapCtl
*
p
=
(
__ShmBitmapCtl
*
)
xmalloc
(
sizeof
(
__ShmBitmapCtl
));
__ShmBitmapCtl
*
p
=
(
__ShmBitmapCtl
*
)
xmalloc
(
sizeof
(
__ShmBitmapCtl
));
#endif
/* defined(HAVE_LIBXXSHM) */
BITMAPOBJ
*
bmpObjPtr
=
(
BITMAPOBJ
*
)
GDI_HEAP_LOCK
(
hbitmap
);
BITMAPOBJ
*
bmpObjPtr
=
(
BITMAPOBJ
*
)
GDI_HEAP_LOCK
(
hbitmap
);
bmpObjPtr
->
size
.
cx
=
0
;
bmpObjPtr
->
size
.
cx
=
0
;
...
@@ -138,6 +147,8 @@ HBITMAP16 WINAPI WinGCreateBitmap16(HDC16 winDC, BITMAPINFO *header,
...
@@ -138,6 +147,8 @@ HBITMAP16 WINAPI WinGCreateBitmap16(HDC16 winDC, BITMAPINFO *header,
bmpObjPtr
->
bitmap
.
bmBitsPixel
=
(
BYTE
)
bmpi
->
biBitCount
;
bmpObjPtr
->
bitmap
.
bmBitsPixel
=
(
BYTE
)
bmpi
->
biBitCount
;
bmpObjPtr
->
bitmap
.
bmWidthBytes
=
bmpObjPtr
->
bitmap
.
bmWidthBytes
=
(
INT16
)
BITMAP_WIDTH_BYTES
(
bmpObjPtr
->
bitmap
.
bmWidth
,
bmpi
->
biBitCount
);
(
INT16
)
BITMAP_WIDTH_BYTES
(
bmpObjPtr
->
bitmap
.
bmWidth
,
bmpi
->
biBitCount
);
#ifdef HAVE_LIBXXSHM
bmpObjPtr
->
bitmap
.
bmBits
=
(
SEGPTR
)
p
;
bmpObjPtr
->
bitmap
.
bmBits
=
(
SEGPTR
)
p
;
p
->
si
.
shmid
=
key
;
p
->
si
.
shmid
=
key
;
...
@@ -170,12 +181,16 @@ HBITMAP16 WINAPI WinGCreateBitmap16(HDC16 winDC, BITMAPINFO *header,
...
@@ -170,12 +181,16 @@ HBITMAP16 WINAPI WinGCreateBitmap16(HDC16 winDC, BITMAPINFO *header,
GDI_FreeObject
(
hbitmap
);
GDI_FreeObject
(
hbitmap
);
hbitmap
=
0
;
hbitmap
=
0
;
}
}
#else
/* defined(HAVE_LIBXXSHM) */
bmpObjPtr
->
bitmap
.
bmBits
=
(
SEGPTR
)
NULL
;
bmpObjPtr
->
pixmap
=
NULL
;
#endif
/* defined(HAVE_LIBXXSHM) */
}
}
GDI_HEAP_UNLOCK
(
hbitmap
);
GDI_HEAP_UNLOCK
(
hbitmap
);
return
hbitmap
;
return
hbitmap
;
}
}
}
}
#endif
#endif
/* defined(PRELIMINARY_WING16_SUPPORT) */
}
}
return
0
;
return
0
;
}
}
...
@@ -186,6 +201,7 @@ HBITMAP16 WINAPI WinGCreateBitmap16(HDC16 winDC, BITMAPINFO *header,
...
@@ -186,6 +201,7 @@ HBITMAP16 WINAPI WinGCreateBitmap16(HDC16 winDC, BITMAPINFO *header,
SEGPTR
WINAPI
WinGGetDIBPointer16
(
HBITMAP16
hWinGBitmap
,
BITMAPINFO
*
bmpi
)
SEGPTR
WINAPI
WinGGetDIBPointer16
(
HBITMAP16
hWinGBitmap
,
BITMAPINFO
*
bmpi
)
{
{
#ifdef PRELIMINARY_WING16_SUPPORT
#ifdef PRELIMINARY_WING16_SUPPORT
#ifdef HAVE_LIBXXSHM
BITMAPOBJ
*
bmp
=
(
BITMAPOBJ
*
)
GDI_GetObjPtr
(
hWinGBitmap
,
BITMAP_MAGIC
);
BITMAPOBJ
*
bmp
=
(
BITMAPOBJ
*
)
GDI_GetObjPtr
(
hWinGBitmap
,
BITMAP_MAGIC
);
if
(
bmp
)
if
(
bmp
)
...
@@ -198,7 +214,8 @@ SEGPTR WINAPI WinGGetDIBPointer16(HBITMAP16 hWinGBitmap, BITMAPINFO* bmpi)
...
@@ -198,7 +214,8 @@ SEGPTR WINAPI WinGGetDIBPointer16(HBITMAP16 hWinGBitmap, BITMAPINFO* bmpi)
return
p
->
bits
;
return
p
->
bits
;
}
}
}
}
#endif
#endif
/* defined(HAVE_LIBXXSHM) */
#endif
/* defined(PRELIMINARY_WING16_SUPPORT) */
return
(
SEGPTR
)
NULL
;
return
(
SEGPTR
)
NULL
;
}
}
...
@@ -279,10 +296,12 @@ BOOL16 WINAPI WinGBitBlt16(HDC16 destDC, INT16 xDest, INT16 yDest,
...
@@ -279,10 +296,12 @@ BOOL16 WINAPI WinGBitBlt16(HDC16 destDC, INT16 xDest, INT16 yDest,
widDest
=
widDest
*
dcDst
->
vportExtX
/
dcDst
->
wndExtX
;
widDest
=
widDest
*
dcDst
->
vportExtX
/
dcDst
->
wndExtX
;
heiDest
=
heiDest
*
dcDst
->
vportExtY
/
dcDst
->
wndExtY
;
heiDest
=
heiDest
*
dcDst
->
vportExtY
/
dcDst
->
wndExtY
;
TSXSetFunction
(
display
,
physDevDst
->
gc
,
GXcopy
);
TSXSetFunction
(
display
,
physDevDst
->
gc
,
GXcopy
);
TSXCopyArea
(
display
,
physDevSrc
->
drawable
,
TSXCopyArea
(
display
,
physDevSrc
->
drawable
,
physDevDst
->
drawable
,
physDevDst
->
gc
,
physDevDst
->
drawable
,
physDevDst
->
gc
,
xSrc
,
ySrc
,
widDest
,
heiDest
,
xDest
,
yDest
);
xSrc
,
ySrc
,
widDest
,
heiDest
,
xDest
,
yDest
);
return
TRUE
;
return
TRUE
;
}
}
include/bitmap.h
View file @
8d8703cb
...
@@ -7,9 +7,9 @@
...
@@ -7,9 +7,9 @@
#ifndef __WINE_BITMAP_H
#ifndef __WINE_BITMAP_H
#define __WINE_BITMAP_H
#define __WINE_BITMAP_H
#include <X11/Xlib.h>
#include "gdi.h"
#include "gdi.h"
#include "ts_xlib.h"
#include "ts_xutil.h"
/* Additional info for DIB section objects */
/* Additional info for DIB section objects */
typedef
struct
typedef
struct
...
...
include/color.h
View file @
8d8703cb
...
@@ -3,7 +3,6 @@
...
@@ -3,7 +3,6 @@
#include "palette.h"
#include "palette.h"
#include "gdi.h"
#include "gdi.h"
#include "x11drv.h"
#define COLOR_FIXED 0x0001
/* read-only colormap - have to use XAllocColor (if not virtual)*/
#define COLOR_FIXED 0x0001
/* read-only colormap - have to use XAllocColor (if not virtual)*/
#define COLOR_VIRTUAL 0x0002
/* no mapping needed - pixel == pixel color */
#define COLOR_VIRTUAL 0x0002
/* no mapping needed - pixel == pixel color */
...
@@ -21,7 +20,6 @@ extern COLORREF COLOR_ToLogical(int pixel);
...
@@ -21,7 +20,6 @@ extern COLORREF COLOR_ToLogical(int pixel);
extern
int
COLOR_ToPhysical
(
DC
*
dc
,
COLORREF
color
);
extern
int
COLOR_ToPhysical
(
DC
*
dc
,
COLORREF
color
);
extern
int
COLOR_SetMapping
(
PALETTEOBJ
*
pal
,
UINT32
uStart
,
UINT32
uNum
,
BOOL32
mapOnly
);
extern
int
COLOR_SetMapping
(
PALETTEOBJ
*
pal
,
UINT32
uStart
,
UINT32
uNum
,
BOOL32
mapOnly
);
extern
BOOL32
COLOR_IsSolid
(
COLORREF
color
);
extern
BOOL32
COLOR_IsSolid
(
COLORREF
color
);
extern
Colormap
COLOR_GetColormap
(
void
);
extern
UINT16
COLOR_GetSystemPaletteSize
(
void
);
extern
UINT16
COLOR_GetSystemPaletteSize
(
void
);
extern
UINT16
COLOR_GetSystemPaletteFlags
(
void
);
extern
UINT16
COLOR_GetSystemPaletteFlags
(
void
);
extern
const
PALETTEENTRY
*
COLOR_GetSystemPaletteTemplate
(
void
);
extern
const
PALETTEENTRY
*
COLOR_GetSystemPaletteTemplate
(
void
);
...
...
include/ddraw.h
View file @
8d8703cb
#ifndef __WINE_DDRAW_H
#ifndef __WINE_DDRAW_H
#define __WINE_DDRAW_H
#define __WINE_DDRAW_H
#include "wine/obj_base.h"
#include "config.h"
#ifndef X_DISPLAY_MISSING
#include <X11/Xlib.h>
#include <X11/Xlib.h>
#ifdef HAVE_LIBXXSHM
#ifdef HAVE_LIBXXSHM
#include <X11/extensions/XShm.h>
#include <X11/extensions/XShm.h>
#endif
/* defined(HAVE_LIBXXSHM) */
#endif
/* defined(HAVE_LIBXXSHM) */
#endif
/* !defined(X_DISPLAY_MISSING) */
#include "wine/obj_base.h"
#ifndef DIRECTDRAW_VERSION
#ifndef DIRECTDRAW_VERSION
#define DIRECTDRAW_VERSION 0x0500
#define DIRECTDRAW_VERSION 0x0500
...
@@ -936,7 +932,7 @@ struct _dga_directdrawdata {
...
@@ -936,7 +932,7 @@ struct _dga_directdrawdata {
struct
_xlib_directdrawdata
{
struct
_xlib_directdrawdata
{
#ifdef HAVE_LIBXXSHM
#ifdef HAVE_LIBXXSHM
int
xshm_active
;
int
xshm_active
;
#endif
#endif
/* defined(HAVE_LIBXXSHM) */
/* are these needed for anything? (draw_surf is the active surface)
/* are these needed for anything? (draw_surf is the active surface)
IDirectDrawSurface *surfs;
IDirectDrawSurface *surfs;
...
...
include/debug.h
View file @
8d8703cb
...
@@ -139,21 +139,22 @@
...
@@ -139,21 +139,22 @@
#define dbch_tooltips 131
#define dbch_tooltips 131
#define dbch_trackbar 132
#define dbch_trackbar 132
#define dbch_treeview 133
#define dbch_treeview 133
#define dbch_tweak 134
#define dbch_ttydrv 134
#define dbch_uitools 135
#define dbch_tweak 135
#define dbch_updown 136
#define dbch_uitools 136
#define dbch_ver 137
#define dbch_updown 137
#define dbch_virtual 138
#define dbch_ver 138
#define dbch_vxd 139
#define dbch_virtual 139
#define dbch_wave 140
#define dbch_vxd 140
#define dbch_win 141
#define dbch_wave 141
#define dbch_win16drv 142
#define dbch_win 142
#define dbch_win32 143
#define dbch_win16drv 143
#define dbch_wing 144
#define dbch_win32 144
#define dbch_winsock 145
#define dbch_wing 145
#define dbch_wnet 146
#define dbch_winsock 146
#define dbch_x11 147
#define dbch_wnet 147
#define dbch_x11drv 148
#define dbch_x11 148
#define dbch_x11drv 149
/* Definitions for classes identifiers */
/* Definitions for classes identifiers */
#define dbcl_fixme 0
#define dbcl_fixme 0
#define dbcl_err 1
#define dbcl_err 1
...
...
include/debugdefs.h
View file @
8d8703cb
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
#include "debugtools.h"
#include "debugtools.h"
#endif
#endif
#define DEBUG_CHANNEL_COUNT 1
49
#define DEBUG_CHANNEL_COUNT 1
50
#ifdef DEBUG_RUNTIME
#ifdef DEBUG_RUNTIME
short
debug_msg_enabled
[][
DEBUG_CLASS_COUNT
]
=
{
short
debug_msg_enabled
[][
DEBUG_CLASS_COUNT
]
=
{
{
1
,
1
,
0
,
0
},
{
1
,
1
,
0
,
0
},
...
@@ -156,6 +156,7 @@ short debug_msg_enabled[][DEBUG_CLASS_COUNT] = {
...
@@ -156,6 +156,7 @@ short debug_msg_enabled[][DEBUG_CLASS_COUNT] = {
{
1
,
1
,
0
,
0
},
{
1
,
1
,
0
,
0
},
{
1
,
1
,
0
,
0
},
{
1
,
1
,
0
,
0
},
{
1
,
1
,
0
,
0
},
{
1
,
1
,
0
,
0
},
{
1
,
1
,
0
,
0
},
};
};
const
char
*
debug_ch_name
[]
=
{
const
char
*
debug_ch_name
[]
=
{
"accel"
,
"accel"
,
...
@@ -292,6 +293,7 @@ const char* debug_ch_name[] = {
...
@@ -292,6 +293,7 @@ const char* debug_ch_name[] = {
"tooltips"
,
"tooltips"
,
"trackbar"
,
"trackbar"
,
"treeview"
,
"treeview"
,
"ttydrv"
,
"tweak"
,
"tweak"
,
"uitools"
,
"uitools"
,
"updown"
,
"updown"
,
...
...
include/desktop.h
View file @
8d8703cb
...
@@ -9,13 +9,29 @@
...
@@ -9,13 +9,29 @@
#include "windows.h"
#include "windows.h"
typedef
struct
struct
tagMONITOR
;
struct
_DESKTOP_DRIVER
;
typedef
struct
tagDESKTOP
{
{
HBRUSH32
hbrushPattern
;
HBRUSH32
hbrushPattern
;
HBITMAP32
hbitmapWallPaper
;
HBITMAP32
hbitmapWallPaper
;
SIZE32
bitmapSize
;
SIZE32
bitmapSize
;
BOOL32
fTileWallPaper
;
BOOL32
fTileWallPaper
;
}
DESKTOPINFO
;
struct
tagMONITOR
*
pPrimaryMonitor
;
struct
_DESKTOP_DRIVER
*
pDriver
;
/* Desktop driver */
void
*
pDriverData
;
/* Desktop driver data */
}
DESKTOP
;
typedef
struct
_DESKTOP_DRIVER
{
void
(
*
pInitialize
)(
struct
tagDESKTOP
*
pDesktop
);
void
(
*
pFinalize
)(
struct
tagDESKTOP
*
pDesktop
);
}
DESKTOP_DRIVER
;
extern
int
DESKTOP_GetScreenWidth
();
extern
int
DESKTOP_GetScreenHeight
();
extern
int
DESKTOP_GetScreenDepth
();
extern
BOOL32
DESKTOP_SetPattern
(
LPCSTR
pattern
);
extern
BOOL32
DESKTOP_SetPattern
(
LPCSTR
pattern
);
extern
LRESULT
WINAPI
DesktopWndProc
(
HWND32
hwnd
,
UINT32
message
,
extern
LRESULT
WINAPI
DesktopWndProc
(
HWND32
hwnd
,
UINT32
message
,
...
...
include/display.h
View file @
8d8703cb
...
@@ -11,11 +11,11 @@
...
@@ -11,11 +11,11 @@
#include "wine/winuser16.h"
#include "wine/winuser16.h"
#pragma pack(1)
#pragma pack(1)
typedef
struct
_
CURSORINFO
typedef
struct
tag
CURSORINFO
{
{
WORD
wXMickeys
;
WORD
wXMickeys
;
WORD
wYMickeys
;
WORD
wYMickeys
;
}
CURSORINFO
,
*
LPCURSORINFO
;
}
CURSORINFO
,
*
PCURSORINFO
,
*
LPCURSORINFO
;
#pragma pack(4)
#pragma pack(4)
typedef
struct
_MOUSE_DRIVER
{
typedef
struct
_MOUSE_DRIVER
{
...
...
include/main.h
View file @
8d8703cb
...
@@ -12,6 +12,9 @@ extern HINSTANCE32 MAIN_WinelibInit( int *argc, char *argv[] );
...
@@ -12,6 +12,9 @@ extern HINSTANCE32 MAIN_WinelibInit( int *argc, char *argv[] );
extern
int
MAIN_GetLanguageID
(
char
*
lang
,
char
*
country
,
char
*
charset
,
char
*
dialect
);
extern
int
MAIN_GetLanguageID
(
char
*
lang
,
char
*
country
,
char
*
charset
,
char
*
dialect
);
extern
BOOL32
MAIN_ParseDebugOptions
(
char
*
options
);
extern
BOOL32
MAIN_ParseDebugOptions
(
char
*
options
);
extern
void
MAIN_ParseLanguageOption
(
char
*
arg
);
extern
void
MAIN_ParseModeOption
(
char
*
arg
);
extern
BOOL32
RELAY_Init
(
void
);
extern
BOOL32
RELAY_Init
(
void
);
extern
int
RELAY_ShowDebugmsgRelay
(
const
char
*
func
);
extern
int
RELAY_ShowDebugmsgRelay
(
const
char
*
func
);
extern
void
*
CALL32_Init
(
void
);
extern
void
*
CALL32_Init
(
void
);
...
...
include/options.h
View file @
8d8703cb
...
@@ -51,6 +51,8 @@ typedef enum
...
@@ -51,6 +51,8 @@ typedef enum
struct
options
struct
options
{
{
int
*
argc
;
char
**
argv
;
char
*
desktopGeometry
;
/* NULL when no desktop */
char
*
desktopGeometry
;
/* NULL when no desktop */
char
*
programName
;
/* To use when loading resources */
char
*
programName
;
/* To use when loading resources */
char
*
argv0
;
/* argv[0] of Wine process */
char
*
argv0
;
/* argv[0] of Wine process */
...
@@ -71,6 +73,7 @@ struct options
...
@@ -71,6 +73,7 @@ struct options
int
noDGA
;
/* Disable XFree86 DGA extensions */
int
noDGA
;
/* Disable XFree86 DGA extensions */
char
*
configFileName
;
/* Command line config file */
char
*
configFileName
;
/* Command line config file */
char
*
consoleDrivers
;
/* Console driver list */
char
*
consoleDrivers
;
/* Console driver list */
int
screenDepth
;
};
};
extern
struct
options
Options
;
extern
struct
options
Options
;
...
...
include/ttydrv.h
View file @
8d8703cb
...
@@ -5,22 +5,47 @@
...
@@ -5,22 +5,47 @@
#ifndef __WINE_TTYDRV_H
#ifndef __WINE_TTYDRV_H
#define __WINE_TTYDRV_H
#define __WINE_TTYDRV_H
#include "clipboard.h"
#include "windows.h"
#include "keyboard.h"
#include "wine/winuser16.h"
#include "message.h"
struct
tagCLASS
;
struct
tagDC
;
struct
tagDESKTOP
;
struct
tagWND
;
/* TTY GDI driver */
typedef
struct
{
}
TTYDRV_PDEVICE
;
extern
BOOL32
TTYDRV_GDI_Initialize
();
extern
void
TTDRV_GDI_Finalize
();
extern
BOOL32
TTYDRV_GDI_CreateDC
(
struct
tagDC
*
dc
,
LPCSTR
driver
,
LPCSTR
device
,
LPCSTR
output
,
const
DEVMODE16
*
initData
);
extern
BOOL32
TTYDRV_GDI_DeleteDC
(
struct
tagDC
*
dc
);
extern
INT32
TTYDRV_GDI_Escape
(
struct
tagDC
*
dc
,
INT32
nEscape
,
INT32
cbInput
,
SEGPTR
lpInData
,
SEGPTR
lpOutData
);
/* TTY clipboard driver */
/* TTY clipboard driver */
extern
CLIPBOARD_DRIVER
TTYDRV_CLIPBOARD_Driver
;
extern
struct
_
CLIPBOARD_DRIVER
TTYDRV_CLIPBOARD_Driver
;
extern
void
TTYDRV_CLIPBOARD_EmptyClipboard
();
extern
void
TTYDRV_CLIPBOARD_EmptyClipboard
();
extern
void
TTYDRV_CLIPBOARD_SetClipboardData
(
UINT32
wFormat
);
extern
void
TTYDRV_CLIPBOARD_SetClipboardData
(
UINT32
wFormat
);
extern
BOOL32
TTYDRV_CLIPBOARD_RequestSelection
();
extern
BOOL32
TTYDRV_CLIPBOARD_RequestSelection
();
extern
void
TTYDRV_CLIPBOARD_ResetOwner
(
WND
*
pWnd
,
BOOL32
bFooBar
);
extern
void
TTYDRV_CLIPBOARD_ResetOwner
(
struct
tagWND
*
pWnd
,
BOOL32
bFooBar
);
/* TTY desktop driver */
extern
struct
_DESKTOP_DRIVER
TTYDRV_DESKTOP_Driver
;
extern
void
TTYDRV_DESKTOP_Initialize
(
struct
tagDESKTOP
*
pDesktop
);
extern
void
TTYDRV_DESKTOP_Finalize
(
struct
tagDESKTOP
*
pDesktop
);
extern
int
TTYDRV_DESKTOP_GetScreenWidth
(
struct
tagDESKTOP
*
pDesktop
);
extern
int
TTYDRV_DESKTOP_GetScreenHeight
(
struct
tagDESKTOP
*
pDesktop
);
extern
int
TTYDRV_DESKTOP_GetScreenDepth
(
struct
tagDESKTOP
*
pDesktop
);
/* TTY event driver */
/* TTY event driver */
extern
EVENT_DRIVER
TTYDRV_EVENT_Driver
;
extern
struct
_
EVENT_DRIVER
TTYDRV_EVENT_Driver
;
extern
BOOL32
TTYDRV_EVENT_Init
(
void
);
extern
BOOL32
TTYDRV_EVENT_Init
(
void
);
extern
void
TTYDRV_EVENT_AddIO
(
int
fd
,
unsigned
flag
);
extern
void
TTYDRV_EVENT_AddIO
(
int
fd
,
unsigned
flag
);
...
@@ -35,7 +60,7 @@ extern BOOL16 TTYDRV_EVENT_IsUserIdle(void);
...
@@ -35,7 +60,7 @@ extern BOOL16 TTYDRV_EVENT_IsUserIdle(void);
/* TTY keyboard driver */
/* TTY keyboard driver */
extern
KEYBOARD_DRIVER
TTYDRV_KEYBOARD_Driver
;
extern
struct
_
KEYBOARD_DRIVER
TTYDRV_KEYBOARD_Driver
;
extern
void
TTYDRV_KEYBOARD_Init
(
void
);
extern
void
TTYDRV_KEYBOARD_Init
(
void
);
extern
WORD
TTYDRV_KEYBOARD_VkKeyScan
(
CHAR
cChar
);
extern
WORD
TTYDRV_KEYBOARD_VkKeyScan
(
CHAR
cChar
);
...
@@ -43,4 +68,58 @@ extern UINT16 TTYDRV_KEYBOARD_MapVirtualKey(UINT16 wCode, UINT16 wMapType);
...
@@ -43,4 +68,58 @@ extern UINT16 TTYDRV_KEYBOARD_MapVirtualKey(UINT16 wCode, UINT16 wMapType);
extern
INT16
TTYDRV_KEYBOARD_GetKeyNameText
(
LONG
lParam
,
LPSTR
lpBuffer
,
INT16
nSize
);
extern
INT16
TTYDRV_KEYBOARD_GetKeyNameText
(
LONG
lParam
,
LPSTR
lpBuffer
,
INT16
nSize
);
extern
INT16
TTYDRV_KEYBOARD_ToAscii
(
UINT16
virtKey
,
UINT16
scanCode
,
LPBYTE
lpKeyState
,
LPVOID
lpChar
,
UINT16
flags
);
extern
INT16
TTYDRV_KEYBOARD_ToAscii
(
UINT16
virtKey
,
UINT16
scanCode
,
LPBYTE
lpKeyState
,
LPVOID
lpChar
,
UINT16
flags
);
/* TTY main driver */
extern
void
TTYDRV_MAIN_Finalize
();
extern
void
TTYDRV_MAIN_Initialize
();
extern
void
TTYDRV_MAIN_ParseOptions
(
int
*
argc
,
char
*
argv
[]);
extern
void
TTYDRV_MAIN_Create
();
extern
void
TTYDRV_MAIN_SaveSetup
();
extern
void
TTYDRV_MAIN_RestoreSetup
();
/* TTY monitor driver */
extern
struct
tagMONITOR_DRIVER
TTYDRV_MONITOR_Driver
;
typedef
struct
_TTYDRV_MONITOR_DATA
{
int
width
;
int
height
;
int
depth
;
}
TTYDRV_MONITOR_DATA
;
struct
tagMONITOR
;
extern
void
TTYDRV_MONITOR_Initialize
(
struct
tagMONITOR
*
pMonitor
);
extern
void
TTYDRV_MONITOR_Finalize
(
struct
tagMONITOR
*
pMonitor
);
extern
int
TTYDRV_MONITOR_GetWidth
(
struct
tagMONITOR
*
pMonitor
);
extern
int
TTYDRV_MONITOR_GetHeight
(
struct
tagMONITOR
*
pMonitor
);
extern
int
TTYDRV_MONITOR_GetDepth
(
struct
tagMONITOR
*
pMonitor
);
/* TTY mouse driver */
extern
struct
_MOUSE_DRIVER
TTYDRV_MOUSE_Driver
;
extern
void
TTYDRV_MOUSE_SetCursor
(
CURSORICONINFO
*
lpCursor
);
extern
void
TTYDRV_MOUSE_MoveCursor
(
WORD
wAbsX
,
WORD
wAbsY
);
/* TTY windows driver */
extern
struct
_WND_DRIVER
TTYDRV_WND_Driver
;
extern
void
TTYDRV_WND_Initialize
(
struct
tagWND
*
wndPtr
);
extern
void
TTYDRV_WND_Finalize
(
struct
tagWND
*
wndPtr
);
extern
BOOL32
TTYDRV_WND_CreateDesktopWindow
(
struct
tagWND
*
wndPtr
,
struct
tagCLASS
*
classPtr
,
BOOL32
bUnicode
);
extern
BOOL32
TTYDRV_WND_CreateWindow
(
struct
tagWND
*
wndPtr
,
struct
tagCLASS
*
classPtr
,
CREATESTRUCT32A
*
cs
,
BOOL32
bUnicode
);
extern
BOOL32
TTYDRV_WND_DestroyWindow
(
struct
tagWND
*
pWnd
);
extern
struct
tagWND
*
TTYDRV_WND_SetParent
(
struct
tagWND
*
wndPtr
,
struct
tagWND
*
pWndParent
);
extern
void
TTYDRV_WND_ForceWindowRaise
(
struct
tagWND
*
pWnd
);
extern
void
TTYDRV_WND_SetWindowPos
(
struct
tagWND
*
wndPtr
,
const
WINDOWPOS32
*
winpos
,
BOOL32
bSMC_SETXPOS
);
extern
void
TTYDRV_WND_SetText
(
struct
tagWND
*
wndPtr
,
LPCSTR
text
);
extern
void
TTYDRV_WND_SetFocus
(
struct
tagWND
*
wndPtr
);
extern
void
TTYDRV_WND_PreSizeMove
(
struct
tagWND
*
wndPtr
);
extern
void
TTYDRV_WND_PostSizeMove
(
struct
tagWND
*
wndPtr
);
extern
void
TTYDRV_WND_ScrollWindow
(
struct
tagWND
*
wndPtr
,
struct
tagDC
*
dcPtr
,
INT32
dx
,
INT32
dy
,
const
RECT32
*
clipRect
,
BOOL32
bUpdate
);
extern
void
TTYDRV_WND_SetDrawable
(
struct
tagWND
*
wndPtr
,
struct
tagDC
*
dc
,
WORD
flags
,
BOOL32
bSetClipOrigin
);
extern
BOOL32
TTYDRV_WND_IsSelfClipping
(
struct
tagWND
*
wndPtr
);
#endif
/* !defined(__WINE_TTYDRV_H) */
#endif
/* !defined(__WINE_TTYDRV_H) */
include/win.h
View file @
8d8703cb
...
@@ -7,14 +7,9 @@
...
@@ -7,14 +7,9 @@
#ifndef __WINE_WIN_H
#ifndef __WINE_WIN_H
#define __WINE_WIN_H
#define __WINE_WIN_H
#include "config.h"
#ifndef X_DISPLAY_MISSING
#include <X11/Xlib.h>
#endif
/* !defined(X_DISPLAY_MISSING) */
#include "ldt.h"
#include "class.h"
#include "class.h"
#include "ldt.h"
#include "windows.h"
#include "winproc.h"
#include "winproc.h"
#define WND_MAGIC 0x444e4957
/* 'WIND' */
#define WND_MAGIC 0x444e4957
/* 'WIND' */
...
@@ -54,6 +49,7 @@ typedef enum
...
@@ -54,6 +49,7 @@ typedef enum
#define RDW_C_USEHRGN 0x0001
#define RDW_C_USEHRGN 0x0001
#define RDW_C_DELETEHRGN 0x0002
#define RDW_C_DELETEHRGN 0x0002
struct
tagCLASS
;
struct
tagDCE
;
struct
tagDCE
;
struct
tagDC
;
struct
tagDC
;
struct
_WND_DRIVER
;
struct
_WND_DRIVER
;
...
@@ -64,7 +60,7 @@ typedef struct tagWND
...
@@ -64,7 +60,7 @@ typedef struct tagWND
struct
tagWND
*
child
;
/* First child */
struct
tagWND
*
child
;
/* First child */
struct
tagWND
*
parent
;
/* Window parent (from CreateWindow) */
struct
tagWND
*
parent
;
/* Window parent (from CreateWindow) */
struct
tagWND
*
owner
;
/* Window owner */
struct
tagWND
*
owner
;
/* Window owner */
CLASS
*
class
;
/* Window class */
struct
tagCLASS
*
class
;
/* Window class */
HWINDOWPROC
winproc
;
/* Window procedure */
HWINDOWPROC
winproc
;
/* Window procedure */
DWORD
dwMagic
;
/* Magic number (must be WND_MAGIC) */
DWORD
dwMagic
;
/* Magic number (must be WND_MAGIC) */
HWND32
hwndSelf
;
/* Handle of this window */
HWND32
hwndSelf
;
/* Handle of this window */
...
@@ -84,9 +80,6 @@ typedef struct tagWND
...
@@ -84,9 +80,6 @@ typedef struct tagWND
UINT32
wIDmenu
;
/* ID or hmenu (from CreateWindow) */
UINT32
wIDmenu
;
/* ID or hmenu (from CreateWindow) */
DWORD
helpContext
;
/* Help context ID */
DWORD
helpContext
;
/* Help context ID */
WORD
flags
;
/* Misc. flags (see below) */
WORD
flags
;
/* Misc. flags (see below) */
#if 0
Window window; /* X window (only for top-level windows) */
#endif
HMENU16
hSysMenu
;
/* window's copy of System Menu */
HMENU16
hSysMenu
;
/* window's copy of System Menu */
DWORD
userdata
;
/* User private data */
DWORD
userdata
;
/* User private data */
struct
_WND_DRIVER
*
pDriver
;
/* Window driver */
struct
_WND_DRIVER
*
pDriver
;
/* Window driver */
...
@@ -98,8 +91,8 @@ typedef struct _WND_DRIVER
...
@@ -98,8 +91,8 @@ typedef struct _WND_DRIVER
{
{
void
(
*
pInitialize
)(
WND
*
);
void
(
*
pInitialize
)(
WND
*
);
void
(
*
pFinalize
)(
WND
*
);
void
(
*
pFinalize
)(
WND
*
);
BOOL32
(
*
pCreateDesktopWindow
)(
WND
*
,
CLASS
*
,
BOOL32
);
BOOL32
(
*
pCreateDesktopWindow
)(
WND
*
,
struct
tag
CLASS
*
,
BOOL32
);
BOOL32
(
*
pCreateWindow
)(
WND
*
,
CLASS
*
,
CREATESTRUCT32A
*
,
BOOL32
);
BOOL32
(
*
pCreateWindow
)(
WND
*
,
struct
tag
CLASS
*
,
CREATESTRUCT32A
*
,
BOOL32
);
BOOL32
(
*
pDestroyWindow
)(
WND
*
);
BOOL32
(
*
pDestroyWindow
)(
WND
*
);
WND
*
(
*
pSetParent
)(
WND
*
,
WND
*
);
WND
*
(
*
pSetParent
)(
WND
*
,
WND
*
);
void
(
*
pForceWindowRaise
)(
WND
*
);
void
(
*
pForceWindowRaise
)(
WND
*
);
...
@@ -181,8 +174,4 @@ extern BOOL32 ICONTITLE_Init( void );
...
@@ -181,8 +174,4 @@ extern BOOL32 ICONTITLE_Init( void );
/* windows/focus.c */
/* windows/focus.c */
extern
void
FOCUS_SwitchFocus
(
HWND32
,
HWND32
);
extern
void
FOCUS_SwitchFocus
(
HWND32
,
HWND32
);
extern
Display
*
display
;
extern
Screen
*
screen
;
extern
Window
rootWindow
;
#endif
/* __WINE_WIN_H */
#endif
/* __WINE_WIN_H */
include/x11drv.h
View file @
8d8703cb
...
@@ -14,15 +14,14 @@
...
@@ -14,15 +14,14 @@
#include <X11/Xatom.h>
#include <X11/Xatom.h>
#endif
/* !defined(X_DISPLAY_MISSING) */
#endif
/* !defined(X_DISPLAY_MISSING) */
#include "winbase.h"
#include "wintypes.h"
#include "display.h"
#include "gdi.h"
#include "gdi.h"
#include "xmalloc.h"
/* for XCREATEIMAGE macro */
#include "wintypes.h"
#include "clipboard.h"
#include "wine/winuser16.h"
#include "keyboard.h"
#include "message.h"
struct
tagCLASS
;
#include "win.h"
struct
tagDC
;
struct
tagDeviceCaps
;
struct
tagWND
;
/* X physical pen */
/* X physical pen */
typedef
struct
typedef
struct
...
@@ -75,9 +74,6 @@ extern GC BITMAP_monoGC, BITMAP_colorGC;
...
@@ -75,9 +74,6 @@ extern GC BITMAP_monoGC, BITMAP_colorGC;
/* Wine driver X11 functions */
/* Wine driver X11 functions */
struct
tagDC
;
struct
tagDeviceCaps
;
extern
BOOL32
X11DRV_Init
(
void
);
extern
BOOL32
X11DRV_Init
(
void
);
extern
BOOL32
X11DRV_BitBlt
(
struct
tagDC
*
dcDst
,
INT32
xDst
,
INT32
yDst
,
extern
BOOL32
X11DRV_BitBlt
(
struct
tagDC
*
dcDst
,
INT32
xDst
,
INT32
yDst
,
INT32
width
,
INT32
height
,
struct
tagDC
*
dcSrc
,
INT32
width
,
INT32
height
,
struct
tagDC
*
dcSrc
,
...
@@ -173,12 +169,6 @@ extern BOOL32 X11DRV_SetupGCForText( struct tagDC *dc );
...
@@ -173,12 +169,6 @@ extern BOOL32 X11DRV_SetupGCForText( struct tagDC *dc );
extern
const
int
X11DRV_XROPfunction
[];
extern
const
int
X11DRV_XROPfunction
[];
extern
Display
*
display
;
extern
Screen
*
screen
;
extern
Window
rootWindow
;
extern
int
screenWidth
,
screenHeight
,
screenDepth
;
/* Xlib critical section */
/* Xlib critical section */
extern
CRITICAL_SECTION
X11DRV_CritSection
;
extern
CRITICAL_SECTION
X11DRV_CritSection
;
...
@@ -188,7 +178,7 @@ extern void _XInitImageFuncPtrs(XImage *);
...
@@ -188,7 +178,7 @@ extern void _XInitImageFuncPtrs(XImage *);
#define XCREATEIMAGE(image,width,height,bpp) \
#define XCREATEIMAGE(image,width,height,bpp) \
{ \
{ \
int width_bytes = X11DRV_DIB_GetXImageWidthBytes( (width), (bpp) ); \
int width_bytes = X11DRV_DIB_GetXImageWidthBytes( (width), (bpp) ); \
(image) = TSXCreateImage(display, DefaultVisualOfScreen(
screen
), \
(image) = TSXCreateImage(display, DefaultVisualOfScreen(
X11DRV_GetXScreen()
), \
(bpp), ZPixmap, 0, xcalloc( (height)*width_bytes ),\
(bpp), ZPixmap, 0, xcalloc( (height)*width_bytes ),\
(width), (height), 32, width_bytes ); \
(width), (height), 32, width_bytes ); \
}
}
...
@@ -224,67 +214,43 @@ extern int *X11DRV_DIB_BuildColorMap( struct tagDC *dc, WORD coloruse,
...
@@ -224,67 +214,43 @@ extern int *X11DRV_DIB_BuildColorMap( struct tagDC *dc, WORD coloruse,
WORD
depth
,
const
BITMAPINFO
*
info
,
WORD
depth
,
const
BITMAPINFO
*
info
,
int
*
nColors
);
int
*
nColors
);
/* X11 windows driver */
extern
WND_DRIVER
X11DRV_WND_Driver
;
typedef
struct
_X11DRV_WND_DATA
{
Window
window
;
}
X11DRV_WND_DATA
;
extern
Window
X11DRV_WND_GetXWindow
(
WND
*
wndPtr
);
extern
Window
X11DRV_WND_FindXWindow
(
WND
*
wndPtr
);
extern
void
X11DRV_WND_Initialize
(
WND
*
wndPtr
);
extern
void
X11DRV_WND_Finalize
(
WND
*
wndPtr
);
extern
BOOL32
X11DRV_WND_CreateDesktopWindow
(
WND
*
wndPtr
,
CLASS
*
classPtr
,
BOOL32
bUnicode
);
extern
BOOL32
X11DRV_WND_CreateWindow
(
WND
*
wndPtr
,
CLASS
*
classPtr
,
CREATESTRUCT32A
*
cs
,
BOOL32
bUnicode
);
extern
BOOL32
X11DRV_WND_DestroyWindow
(
WND
*
pWnd
);
extern
WND
*
X11DRV_WND_SetParent
(
WND
*
wndPtr
,
WND
*
pWndParent
);
extern
void
X11DRV_WND_ForceWindowRaise
(
WND
*
pWnd
);
extern
void
X11DRV_WND_SetWindowPos
(
WND
*
wndPtr
,
const
WINDOWPOS32
*
winpos
,
BOOL32
bSMC_SETXPOS
);
extern
void
X11DRV_WND_SetText
(
WND
*
wndPtr
,
LPCSTR
text
);
extern
void
X11DRV_WND_SetFocus
(
WND
*
wndPtr
);
extern
void
X11DRV_WND_PreSizeMove
(
WND
*
wndPtr
);
extern
void
X11DRV_WND_PostSizeMove
(
WND
*
wndPtr
);
extern
void
X11DRV_WND_ScrollWindow
(
WND
*
wndPtr
,
DC
*
dcPtr
,
INT32
dx
,
INT32
dy
,
const
RECT32
*
clipRect
,
BOOL32
bUpdate
);
extern
void
X11DRV_WND_SetDrawable
(
WND
*
wndPtr
,
DC
*
dc
,
WORD
flags
,
BOOL32
bSetClipOrigin
);
extern
BOOL32
X11DRV_WND_IsSelfClipping
(
WND
*
wndPtr
);
/* X11 clipboard driver */
/* X11 clipboard driver */
extern
CLIPBOARD_DRIVER
X11DRV_CLIPBOARD_Driver
;
extern
struct
_
CLIPBOARD_DRIVER
X11DRV_CLIPBOARD_Driver
;
extern
void
X11DRV_CLIPBOARD_EmptyClipboard
();
extern
void
X11DRV_CLIPBOARD_EmptyClipboard
();
extern
void
X11DRV_CLIPBOARD_SetClipboardData
(
UINT32
wFormat
);
extern
void
X11DRV_CLIPBOARD_SetClipboardData
(
UINT32
wFormat
);
extern
BOOL32
X11DRV_CLIPBOARD_RequestSelection
();
extern
BOOL32
X11DRV_CLIPBOARD_RequestSelection
();
extern
void
X11DRV_CLIPBOARD_ResetOwner
(
WND
*
pWnd
,
BOOL32
bFooBar
);
extern
void
X11DRV_CLIPBOARD_ResetOwner
(
struct
tag
WND
*
pWnd
,
BOOL32
bFooBar
);
void
X11DRV_CLIPBOARD_ReadSelection
(
Window
w
,
Atom
prop
);
void
X11DRV_CLIPBOARD_ReadSelection
(
Window
w
,
Atom
prop
);
void
X11DRV_CLIPBOARD_ReleaseSelection
(
Window
w
,
HWND32
hwnd
);
void
X11DRV_CLIPBOARD_ReleaseSelection
(
Window
w
,
HWND32
hwnd
);
/* X11
keyboard
driver */
/* X11
color
driver */
extern
KEYBOARD_DRIVER
X11DRV_KEYBOARD_Driver
;
extern
Colormap
X11DRV_COLOR_GetColormap
(
void
)
;
extern
void
X11DRV_KEYBOARD_Init
(
void
);
/* X11 desktop driver */
extern
WORD
X11DRV_KEYBOARD_VkKeyScan
(
CHAR
cChar
);
extern
UINT16
X11DRV_KEYBOARD_MapVirtualKey
(
UINT16
wCode
,
UINT16
wMapType
);
extern
INT16
X11DRV_KEYBOARD_GetKeyNameText
(
LONG
lParam
,
LPSTR
lpBuffer
,
INT16
nSize
);
extern
INT16
X11DRV_KEYBOARD_ToAscii
(
UINT16
virtKey
,
UINT16
scanCode
,
LPBYTE
lpKeyState
,
LPVOID
lpChar
,
UINT16
flags
);
extern
void
KEYBOARD_HandleEvent
(
WND
*
pWnd
,
XKeyEvent
*
event
);
extern
void
KEYBOARD_UpdateState
(
void
);
/* X11 mouse driver */
extern
struct
_DESKTOP_DRIVER
X11DRV_DESKTOP_Driver
;
extern
MOUSE_DRIVER
X11DRV_MOUSE_Driver
;
typedef
struct
_X11DRV_DESKTOP_DATA
{
}
X11DRV_DESKTOP_DATA
;
extern
void
X11DRV_MOUSE_SetCursor
(
CURSORICONINFO
*
lpCursor
);
struct
tagDESKTOP
;
extern
void
X11DRV_MOUSE_MoveCursor
(
WORD
wAbsX
,
WORD
wAbsY
);
extern
Screen
*
X11DRV_DESKTOP_GetXScreen
(
struct
tagDESKTOP
*
pDesktop
);
extern
Window
X11DRV_DESKTOP_GetXRootWindow
(
struct
tagDESKTOP
*
pDesktop
);
extern
void
X11DRV_DESKTOP_Initialize
(
struct
tagDESKTOP
*
pDesktop
);
extern
void
X11DRV_DESKTOP_Finalize
(
struct
tagDESKTOP
*
pDesktop
);
extern
int
X11DRV_DESKTOP_GetScreenWidth
(
struct
tagDESKTOP
*
pDesktop
);
extern
int
X11DRV_DESKTOP_GetScreenHeight
(
struct
tagDESKTOP
*
pDesktop
);
extern
int
X11DRV_DESKTOP_GetScreenDepth
(
struct
tagDESKTOP
*
pDesktop
);
/* X11 event driver */
/* X11 event driver */
extern
EVENT_DRIVER
X11DRV_EVENT_Driver
;
extern
struct
_
EVENT_DRIVER
X11DRV_EVENT_Driver
;
extern
BOOL32
X11DRV_EVENT_Init
(
void
);
extern
BOOL32
X11DRV_EVENT_Init
(
void
);
extern
void
X11DRV_EVENT_AddIO
(
int
fd
,
unsigned
flag
);
extern
void
X11DRV_EVENT_AddIO
(
int
fd
,
unsigned
flag
);
...
@@ -297,4 +263,88 @@ extern void X11DRV_EVENT_DummyMotionNotify(void);
...
@@ -297,4 +263,88 @@ extern void X11DRV_EVENT_DummyMotionNotify(void);
extern
BOOL32
X11DRV_EVENT_Pending
(
void
);
extern
BOOL32
X11DRV_EVENT_Pending
(
void
);
extern
BOOL16
X11DRV_EVENT_IsUserIdle
(
void
);
extern
BOOL16
X11DRV_EVENT_IsUserIdle
(
void
);
/* X11 keyboard driver */
extern
struct
_KEYBOARD_DRIVER
X11DRV_KEYBOARD_Driver
;
extern
void
X11DRV_KEYBOARD_Init
(
void
);
extern
WORD
X11DRV_KEYBOARD_VkKeyScan
(
CHAR
cChar
);
extern
UINT16
X11DRV_KEYBOARD_MapVirtualKey
(
UINT16
wCode
,
UINT16
wMapType
);
extern
INT16
X11DRV_KEYBOARD_GetKeyNameText
(
LONG
lParam
,
LPSTR
lpBuffer
,
INT16
nSize
);
extern
INT16
X11DRV_KEYBOARD_ToAscii
(
UINT16
virtKey
,
UINT16
scanCode
,
LPBYTE
lpKeyState
,
LPVOID
lpChar
,
UINT16
flags
);
extern
void
KEYBOARD_HandleEvent
(
struct
tagWND
*
pWnd
,
XKeyEvent
*
event
);
extern
void
KEYBOARD_UpdateState
(
void
);
/* X11 main driver */
extern
Display
*
display
;
extern
Screen
*
X11DRV_GetXScreen
();
extern
Window
X11DRV_GetXRootWindow
();
extern
void
X11DRV_MAIN_Finalize
();
extern
void
X11DRV_MAIN_Initialize
();
extern
void
X11DRV_MAIN_ParseOptions
(
int
*
argc
,
char
*
argv
[]);
extern
void
X11DRV_MAIN_Create
();
extern
void
X11DRV_MAIN_SaveSetup
();
extern
void
X11DRV_MAIN_RestoreSetup
();
/* X11 monitor driver */
extern
struct
tagMONITOR_DRIVER
X11DRV_MONITOR_Driver
;
typedef
struct
_X11DRV_MONITOR_DATA
{
Screen
*
screen
;
Window
rootWindow
;
int
width
;
int
height
;
int
depth
;
}
X11DRV_MONITOR_DATA
;
struct
tagMONITOR
;
extern
Screen
*
X11DRV_MONITOR_GetXScreen
(
struct
tagMONITOR
*
pMonitor
);
extern
Window
X11DRV_MONITOR_GetXRootWindow
(
struct
tagMONITOR
*
pMonitor
);
extern
void
X11DRV_MONITOR_Initialize
(
struct
tagMONITOR
*
pMonitor
);
extern
void
X11DRV_MONITOR_Finalize
(
struct
tagMONITOR
*
pMonitor
);
extern
int
X11DRV_MONITOR_GetWidth
(
struct
tagMONITOR
*
pMonitor
);
extern
int
X11DRV_MONITOR_GetHeight
(
struct
tagMONITOR
*
pMonitor
);
extern
int
X11DRV_MONITOR_GetDepth
(
struct
tagMONITOR
*
pMonitor
);
/* X11 mouse driver */
extern
struct
_MOUSE_DRIVER
X11DRV_MOUSE_Driver
;
extern
void
X11DRV_MOUSE_SetCursor
(
CURSORICONINFO
*
lpCursor
);
extern
void
X11DRV_MOUSE_MoveCursor
(
WORD
wAbsX
,
WORD
wAbsY
);
/* X11 windows driver */
extern
struct
_WND_DRIVER
X11DRV_WND_Driver
;
typedef
struct
_X11DRV_WND_DATA
{
Window
window
;
}
X11DRV_WND_DATA
;
extern
Window
X11DRV_WND_GetXWindow
(
struct
tagWND
*
wndPtr
);
extern
Window
X11DRV_WND_FindXWindow
(
struct
tagWND
*
wndPtr
);
extern
Screen
*
X11DRV_WND_GetXScreen
(
struct
tagWND
*
wndPtr
);
extern
Window
X11DRV_WND_GetXRootWindow
(
struct
tagWND
*
wndPtr
);
extern
void
X11DRV_WND_Initialize
(
struct
tagWND
*
wndPtr
);
extern
void
X11DRV_WND_Finalize
(
struct
tagWND
*
wndPtr
);
extern
BOOL32
X11DRV_WND_CreateDesktopWindow
(
struct
tagWND
*
wndPtr
,
struct
tagCLASS
*
classPtr
,
BOOL32
bUnicode
);
extern
BOOL32
X11DRV_WND_CreateWindow
(
struct
tagWND
*
wndPtr
,
struct
tagCLASS
*
classPtr
,
CREATESTRUCT32A
*
cs
,
BOOL32
bUnicode
);
extern
BOOL32
X11DRV_WND_DestroyWindow
(
struct
tagWND
*
pWnd
);
extern
struct
tagWND
*
X11DRV_WND_SetParent
(
struct
tagWND
*
wndPtr
,
struct
tagWND
*
pWndParent
);
extern
void
X11DRV_WND_ForceWindowRaise
(
struct
tagWND
*
pWnd
);
extern
void
X11DRV_WND_SetWindowPos
(
struct
tagWND
*
wndPtr
,
const
WINDOWPOS32
*
winpos
,
BOOL32
bSMC_SETXPOS
);
extern
void
X11DRV_WND_SetText
(
struct
tagWND
*
wndPtr
,
LPCSTR
text
);
extern
void
X11DRV_WND_SetFocus
(
struct
tagWND
*
wndPtr
);
extern
void
X11DRV_WND_PreSizeMove
(
struct
tagWND
*
wndPtr
);
extern
void
X11DRV_WND_PostSizeMove
(
struct
tagWND
*
wndPtr
);
extern
void
X11DRV_WND_ScrollWindow
(
struct
tagWND
*
wndPtr
,
struct
tagDC
*
dcPtr
,
INT32
dx
,
INT32
dy
,
const
RECT32
*
clipRect
,
BOOL32
bUpdate
);
extern
void
X11DRV_WND_SetDrawable
(
struct
tagWND
*
wndPtr
,
struct
tagDC
*
dc
,
WORD
flags
,
BOOL32
bSetClipOrigin
);
extern
BOOL32
X11DRV_WND_IsSelfClipping
(
struct
tagWND
*
wndPtr
);
#endif
/* __WINE_X11DRV_H */
#endif
/* __WINE_X11DRV_H */
misc/main.c
View file @
8d8703cb
...
@@ -4,19 +4,23 @@
...
@@ -4,19 +4,23 @@
* Copyright 1994 Alexandre Julliard
* Copyright 1994 Alexandre Julliard
*/
*/
#include <signal.h>
#include "config.h"
#ifndef X_DISPLAY_MISSING
#include "ts_xlib.h"
#include "x11drv.h"
#else
/* X_DISPLAY_MISSING */
#include "ttydrv.h"
#endif
/* X_DISPLAY_MISSING */
#include <locale.h>
#include <ctype.h>
#include <stdlib.h>
#include <stdlib.h>
#include <string.h>
#include <string.h>
#include <unistd.h>
#include <unistd.h>
#include <ctype.h>
#ifdef MALLOC_DEBUGGING
#ifdef MALLOC_DEBUGGING
# include <malloc.h>
# include <malloc.h>
#endif
#endif
#include "ts_xlib.h"
#include "ts_xresource.h"
#include "ts_xutil.h"
#include <X11/Xlocale.h>
#include <X11/cursorfont.h>
#include "winsock.h"
#include "winsock.h"
#include "heap.h"
#include "heap.h"
#include "message.h"
#include "message.h"
...
@@ -25,7 +29,6 @@
...
@@ -25,7 +29,6 @@
#include "color.h"
#include "color.h"
#include "options.h"
#include "options.h"
#include "desktop.h"
#include "desktop.h"
#include "process.h"
#include "shell.h"
#include "shell.h"
#include "winbase.h"
#include "winbase.h"
#include "builtin32.h"
#include "builtin32.h"
...
@@ -34,8 +37,8 @@
...
@@ -34,8 +37,8 @@
#include "xmalloc.h"
#include "xmalloc.h"
#include "version.h"
#include "version.h"
#include "winnls.h"
#include "winnls.h"
#include "x11drv.h"
#include "console.h"
#include "console.h"
#include "monitor.h"
/* when adding new languages look at ole/ole2nls.c
/* when adding new languages look at ole/ole2nls.c
* for proper iso name and Windows code (add 0x0400
* for proper iso name and Windows code (add 0x0400
...
@@ -64,18 +67,10 @@ const WINE_LANGUAGE_DEF Languages[] =
...
@@ -64,18 +67,10 @@ const WINE_LANGUAGE_DEF Languages[] =
WORD
WINE_LanguageId
=
0x409
;
/* english as default */
WORD
WINE_LanguageId
=
0x409
;
/* english as default */
#define WINE_CLASS "Wine"
/* Class name for resources */
#define WINE_APP_DEFAULTS "/usr/lib/X11/app-defaults/Wine"
Display
*
display
;
Screen
*
screen
;
Window
rootWindow
;
int
screenWidth
=
0
,
screenHeight
=
0
;
/* Desktop window dimensions */
int
screenDepth
=
0
;
/* Screen depth to use */
struct
options
Options
=
struct
options
Options
=
{
/* default options */
{
/* default options */
0
,
/* argc */
NULL
,
/* argv */
NULL
,
/* desktopGeometry */
NULL
,
/* desktopGeometry */
NULL
,
/* programName */
NULL
,
/* programName */
NULL
,
/* argv0 */
NULL
,
/* argv0 */
...
@@ -97,80 +92,53 @@ struct options Options =
...
@@ -97,80 +92,53 @@ struct options Options =
FALSE
,
/* Perfect graphics */
FALSE
,
/* Perfect graphics */
FALSE
,
/* No DGA */
FALSE
,
/* No DGA */
NULL
,
/* Alternate config file name */
NULL
,
/* Alternate config file name */
NULL
/* Console driver list */
NULL
,
/* Console driver list */
0
/* screenDepth */
};
};
static
char
szUsage
[]
=
static
XrmOptionDescRec
optionsTable
[]
=
"%s
\n
"
{
"Usage: %s [options]
\"
program_name [arguments]
\"\n
"
{
"-backingstore"
,
".backingstore"
,
XrmoptionNoArg
,
(
caddr_t
)
"on"
},
#ifndef X_DISPLAY_MISSING
{
"-desktop"
,
".desktop"
,
XrmoptionSepArg
,
(
caddr_t
)
NULL
},
"
\n
"
{
"-depth"
,
".depth"
,
XrmoptionSepArg
,
(
caddr_t
)
NULL
},
"Options:
\n
"
{
"-display"
,
".display"
,
XrmoptionSepArg
,
(
caddr_t
)
NULL
},
" -backingstore Turn on backing store
\n
"
{
"-iconic"
,
".iconic"
,
XrmoptionNoArg
,
(
caddr_t
)
"on"
},
" -config name Specify config file to use
\n
"
{
"-language"
,
".language"
,
XrmoptionSepArg
,
(
caddr_t
)
"En"
},
" -console driver Select which driver(s) to use for the console
\n
"
{
"-name"
,
".name"
,
XrmoptionSepArg
,
(
caddr_t
)
NULL
},
" -debug Enter debugger before starting application
\n
"
{
"-perfect"
,
".perfect"
,
XrmoptionNoArg
,
(
caddr_t
)
"on"
},
" -debugmsg name Turn debugging-messages on or off
\n
"
{
"-privatemap"
,
".privatemap"
,
XrmoptionNoArg
,
(
caddr_t
)
"on"
},
" -depth n Change the depth to use for multiple-depth screens
\n
"
{
"-fixedmap"
,
".fixedmap"
,
XrmoptionNoArg
,
(
caddr_t
)
"on"
},
" -desktop geom Use a desktop window of the given geometry
\n
"
{
"-synchronous"
,
".synchronous"
,
XrmoptionNoArg
,
(
caddr_t
)
"on"
},
" -display name Use the specified display
\n
"
{
"-debug"
,
".debug"
,
XrmoptionNoArg
,
(
caddr_t
)
"on"
},
" -dll name Enable or disable built-in DLLs
\n
"
{
"-debugmsg"
,
".debugmsg"
,
XrmoptionSepArg
,
(
caddr_t
)
NULL
},
" -failreadonly Read only files may not be opened in write mode
\n
"
{
"-dll"
,
".dll"
,
XrmoptionSepArg
,
(
caddr_t
)
NULL
},
" -fixedmap Use a
\"
standard
\"
color map
\n
"
{
"-failreadonly"
,
".failreadonly"
,
XrmoptionNoArg
,
(
caddr_t
)
"on"
},
" -help Show this help message
\n
"
{
"-mode"
,
".mode"
,
XrmoptionSepArg
,
(
caddr_t
)
NULL
},
" -iconic Start as an icon
\n
"
{
"-managed"
,
".managed"
,
XrmoptionNoArg
,
(
caddr_t
)
"off"
},
" -language xx Set the language (one of Ca,Cs,Da,De,En,Eo,Es,Fi,Fr,Hu,It,
\n
"
{
"-winver"
,
".winver"
,
XrmoptionSepArg
,
(
caddr_t
)
NULL
},
" Ko,No,Pl,Pt,Sv)
\n
"
{
"-config"
,
".config"
,
XrmoptionSepArg
,
(
caddr_t
)
NULL
},
" -managed Allow the window manager to manage created windows
\n
"
{
"-nodga"
,
".nodga"
,
XrmoptionNoArg
,
(
caddr_t
)
"off"
},
" -mode mode Start Wine in a particular mode (standard or enhanced)
\n
"
{
"-console"
,
".console"
,
XrmoptionSepArg
,
(
caddr_t
)
NULL
},
" -name name Set the application name
\n
"
{
"-dosver"
,
".dosver"
,
XrmoptionSepArg
,
(
caddr_t
)
NULL
}
" -nodga Disable XFree86 DGA extensions
\n
"
};
" -perfect Favor correctness over speed for graphical operations
\n
"
" -privatemap Use a private color map
\n
"
#define NB_OPTIONS (sizeof(optionsTable) / sizeof(optionsTable[0]))
" -synchronous Turn on synchronous display mode
\n
"
" -version Display the Wine version
\n
"
#define USAGE \
" -winver Version to imitate (one of win31,win95,nt351,nt40)
\n
"
"%s\n" \
"Usage: %s [options] \"program_name [arguments]\"\n" \
"\n" \
"Options:\n" \
" -backingstore Turn on backing store\n" \
" -config name Specify config file to use\n" \
" -console driver Select which driver(s) to use for the console\n" \
" -debug Enter debugger before starting application\n" \
" -debugmsg name Turn debugging-messages on or off\n" \
" -depth n Change the depth to use for multiple-depth screens\n" \
" -desktop geom Use a desktop window of the given geometry\n" \
" -display name Use the specified display\n" \
" -dll name Enable or disable built-in DLLs\n" \
" -failreadonly Read only files may not be opened in write mode\n" \
" -fixedmap Use a \"standard\" color map\n" \
" -help Show this help message\n" \
" -iconic Start as an icon\n" \
" -language xx Set the language (one of Ca,Cs,Da,De,En,Eo,Es,Fi,Fr,Hu,It,\n Ko,No,Pl,Pt,Sv)\n" \
" -managed Allow the window manager to manage created windows\n" \
" -mode mode Start Wine in a particular mode (standard or enhanced)\n" \
" -name name Set the application name\n" \
" -nodga Disable XFree86 DGA extensions\n" \
" -perfect Favor correctness over speed for graphical operations\n" \
" -privatemap Use a private color map\n" \
" -synchronous Turn on synchronous display mode\n" \
" -version Display the Wine version\n" \
" -winver Windows version to imitate (one of win31,win95,nt351,nt40)\n" \
" -dosver DOS version to imitate (x.xx, e.g. 6.22). Only valid with -winver win31
\n
"
" -dosver DOS version to imitate (x.xx, e.g. 6.22). Only valid with -winver win31
\n
"
#endif
/* X_DISPLAY_MISSING */
;
/***********************************************************************
/***********************************************************************
* MAIN_Usage
* MAIN_Usage
*/
*/
void
MAIN_Usage
(
char
*
name
)
void
MAIN_Usage
(
char
*
name
)
{
{
MSG
(
USAGE
,
WINE_RELEASE_INFO
,
name
);
MSG
(
szUsage
,
WINE_RELEASE_INFO
,
name
);
exit
(
1
);
exit
(
1
);
}
}
/***********************************************************************
/***********************************************************************
* MAIN_GetProgramName
* MAIN_GetProgramName
*
*
...
@@ -191,33 +159,6 @@ static char *MAIN_GetProgramName( int argc, char *argv[] )
...
@@ -191,33 +159,6 @@ static char *MAIN_GetProgramName( int argc, char *argv[] )
return
argv
[
0
];
return
argv
[
0
];
}
}
/***********************************************************************
* MAIN_GetResource
*
* Fetch the value of resource 'name' using the correct instance name.
* 'name' must begin with '.' or '*'
*/
static
int
MAIN_GetResource
(
XrmDatabase
db
,
char
*
name
,
XrmValue
*
value
)
{
char
*
buff_instance
,
*
buff_class
;
char
*
dummy
;
int
retval
;
buff_instance
=
(
char
*
)
xmalloc
(
strlen
(
Options
.
programName
)
+
strlen
(
name
)
+
1
);
buff_class
=
(
char
*
)
xmalloc
(
strlen
(
WINE_CLASS
)
+
strlen
(
name
)
+
1
);
strcpy
(
buff_instance
,
Options
.
programName
);
strcat
(
buff_instance
,
name
);
strcpy
(
buff_class
,
WINE_CLASS
);
strcat
(
buff_class
,
name
);
retval
=
TSXrmGetResource
(
db
,
buff_instance
,
buff_class
,
&
dummy
,
value
);
free
(
buff_instance
);
free
(
buff_class
);
return
retval
;
}
/***********************************************************************
/***********************************************************************
* MAIN_ParseDebugOptions
* MAIN_ParseDebugOptions
*
*
...
@@ -235,6 +176,7 @@ BOOL32 MAIN_ParseDebugOptions(char *options)
...
@@ -235,6 +176,7 @@ BOOL32 MAIN_ParseDebugOptions(char *options)
extern
char
**
debug_snoop_includelist
;
extern
char
**
debug_snoop_includelist
;
extern
char
**
debug_snoop_excludelist
;
extern
char
**
debug_snoop_excludelist
;
int
i
;
int
l
,
cls
,
dotracerelay
=
TRACE_ON
(
relay
);
int
l
,
cls
,
dotracerelay
=
TRACE_ON
(
relay
);
l
=
strlen
(
options
);
l
=
strlen
(
options
);
...
@@ -250,10 +192,10 @@ BOOL32 MAIN_ParseDebugOptions(char *options)
...
@@ -250,10 +192,10 @@ BOOL32 MAIN_ParseDebugOptions(char *options)
if
(
!
lstrncmpi32A
(
options
,
debug_cl_name
[
j
],
strlen
(
debug_cl_name
[
j
])))
if
(
!
lstrncmpi32A
(
options
,
debug_cl_name
[
j
],
strlen
(
debug_cl_name
[
j
])))
break
;
break
;
if
(
j
==
DEBUG_CLASS_COUNT
)
if
(
j
==
DEBUG_CLASS_COUNT
)
return
FALSE
;
goto
error
;
options
+=
strlen
(
debug_cl_name
[
j
]);
options
+=
strlen
(
debug_cl_name
[
j
]);
if
((
*
options
!=
'+'
)
&&
(
*
options
!=
'-'
))
if
((
*
options
!=
'+'
)
&&
(
*
options
!=
'-'
))
return
FALSE
;
goto
error
;
cls
=
j
;
cls
=
j
;
}
}
else
else
...
@@ -287,7 +229,7 @@ BOOL32 MAIN_ParseDebugOptions(char *options)
...
@@ -287,7 +229,7 @@ BOOL32 MAIN_ParseDebugOptions(char *options)
}
}
/* should never happen, maybe assert(i!=DEBUG_CHANNEL_COUNT)? */
/* should never happen, maybe assert(i!=DEBUG_CHANNEL_COUNT)? */
if
(
i
==
DEBUG_CHANNEL_COUNT
)
if
(
i
==
DEBUG_CHANNEL_COUNT
)
return
FALSE
;
goto
error
;
output
=
(
*
options
==
'+'
)
?
output
=
(
*
options
==
'+'
)
?
((
*
(
options
+
1
)
==
'r'
)
?
((
*
(
options
+
1
)
==
'r'
)
?
&
debug_relay_includelist
:
&
debug_relay_includelist
:
...
@@ -326,7 +268,7 @@ BOOL32 MAIN_ParseDebugOptions(char *options)
...
@@ -326,7 +268,7 @@ BOOL32 MAIN_ParseDebugOptions(char *options)
break
;
break
;
}
}
if
(
i
==
DEBUG_CHANNEL_COUNT
)
if
(
i
==
DEBUG_CHANNEL_COUNT
)
return
FALSE
;
goto
error
;
}
}
options
+=
l
;
options
+=
l
;
}
}
...
@@ -336,10 +278,33 @@ BOOL32 MAIN_ParseDebugOptions(char *options)
...
@@ -336,10 +278,33 @@ BOOL32 MAIN_ParseDebugOptions(char *options)
if
(
dotracerelay
!=
TRACE_ON
(
relay
))
if
(
dotracerelay
!=
TRACE_ON
(
relay
))
BUILTIN32_SwitchRelayDebug
(
TRACE_ON
(
relay
)
);
BUILTIN32_SwitchRelayDebug
(
TRACE_ON
(
relay
)
);
if
(
*
options
)
if
(
!*
options
)
return
FALSE
;
else
return
TRUE
;
return
TRUE
;
error:
MSG
(
"%s: Syntax: -debugmsg [class]+xxx,... or "
"-debugmsg [class]-xxx,...
\n
"
,
Options
.
argv
[
0
]);
MSG
(
"Example: -debugmsg +all,warn-heap
\n
"
" turn on all messages except warning heap messages
\n
"
);
MSG
(
"Special case: -debugmsg +relay=DLL:DLL.###:FuncName
\n
"
" turn on -debugmsg +relay only as specified
\n
"
"Special case: -debugmsg -relay=DLL:DLL.###:FuncName
\n
"
" turn on -debugmsg +relay except as specified
\n
"
"Also permitted, +snoop=..., -snoop=... as with relay.
\n\n
"
);
MSG
(
"Available message classes:
\n
"
);
for
(
i
=
0
;
i
<
DEBUG_CLASS_COUNT
;
i
++
)
MSG
(
"%-9s"
,
debug_cl_name
[
i
]);
MSG
(
"
\n\n
"
);
MSG
(
"Available message types:
\n
"
);
MSG
(
"%-9s "
,
"all"
);
for
(
i
=
0
;
i
<
DEBUG_CHANNEL_COUNT
;
i
++
)
if
(
debug_ch_name
[
i
])
MSG
(
"%-9s%c"
,
debug_ch_name
[
i
],
(((
i
+
2
)
%
8
==
0
)
?
'\n'
:
' '
));
MSG
(
"
\n\n
"
);
exit
(
1
);
}
}
/***********************************************************************
/***********************************************************************
...
@@ -697,7 +662,7 @@ end_MAIN_GetLanguageID:
...
@@ -697,7 +662,7 @@ end_MAIN_GetLanguageID:
*
*
* Parse -language option.
* Parse -language option.
*/
*/
static
void
MAIN_ParseLanguageOption
(
char
*
arg
)
void
MAIN_ParseLanguageOption
(
char
*
arg
)
{
{
const
WINE_LANGUAGE_DEF
*
p
=
Languages
;
const
WINE_LANGUAGE_DEF
*
p
=
Languages
;
...
@@ -728,7 +693,7 @@ static void MAIN_ParseLanguageOption( char *arg )
...
@@ -728,7 +693,7 @@ static void MAIN_ParseLanguageOption( char *arg )
*
*
* Parse -mode option.
* Parse -mode option.
*/
*/
static
void
MAIN_ParseModeOption
(
char
*
arg
)
void
MAIN_ParseModeOption
(
char
*
arg
)
{
{
if
(
!
lstrcmpi32A
(
"enhanced"
,
arg
))
Options
.
mode
=
MODE_ENHANCED
;
if
(
!
lstrcmpi32A
(
"enhanced"
,
arg
))
Options
.
mode
=
MODE_ENHANCED
;
else
if
(
!
lstrcmpi32A
(
"standard"
,
arg
))
Options
.
mode
=
MODE_STANDARD
;
else
if
(
!
lstrcmpi32A
(
"standard"
,
arg
))
Options
.
mode
=
MODE_STANDARD
;
...
@@ -747,22 +712,18 @@ static void MAIN_ParseModeOption( char *arg )
...
@@ -747,22 +712,18 @@ static void MAIN_ParseModeOption( char *arg )
*/
*/
static
void
MAIN_ParseOptions
(
int
*
argc
,
char
*
argv
[]
)
static
void
MAIN_ParseOptions
(
int
*
argc
,
char
*
argv
[]
)
{
{
char
*
display_name
=
NULL
;
XrmValue
value
;
XrmDatabase
db
=
TSXrmGetFileDatabase
(
WINE_APP_DEFAULTS
);
int
i
;
int
i
;
char
*
xrm_string
;
Options
.
argc
=
argc
;
Options
.
argv
=
argv
;
Options
.
programName
=
MAIN_GetProgramName
(
*
argc
,
argv
);
Options
.
programName
=
MAIN_GetProgramName
(
*
argc
,
argv
);
Options
.
argv0
=
argv
[
0
];
Options
.
argv0
=
argv
[
0
];
/* initialise Options.language to 0 to tell "no language choosen yet" */
/* initialise Options.language to 0 to tell "no language choosen yet" */
Options
.
language
=
0
;
Options
.
language
=
0
;
/* Get display name from command line */
for
(
i
=
1
;
i
<
*
argc
;
i
++
)
for
(
i
=
1
;
i
<
*
argc
;
i
++
)
{
{
if
(
!
strcmp
(
argv
[
i
],
"-display"
))
display_name
=
argv
[
i
+
1
];
if
(
!
strcmp
(
argv
[
i
],
"-v"
)
||
!
strcmp
(
argv
[
i
],
"-version"
))
if
(
!
strcmp
(
argv
[
i
],
"-v"
)
||
!
strcmp
(
argv
[
i
],
"-version"
))
{
{
MSG
(
"%s
\n
"
,
WINE_RELEASE_INFO
);
MSG
(
"%s
\n
"
,
WINE_RELEASE_INFO
);
...
@@ -775,250 +736,25 @@ static void MAIN_ParseOptions( int *argc, char *argv[] )
...
@@ -775,250 +736,25 @@ static void MAIN_ParseOptions( int *argc, char *argv[] )
}
}
}
}
/* Open display */
#ifndef X_DISPLAY_MISSING
X11DRV_MAIN_ParseOptions
(
argc
,
argv
);
if
(
display_name
==
NULL
&&
#else
/* X_DISPLAY_MISSING */
MAIN_GetResource
(
db
,
".display"
,
&
value
))
display_name
=
value
.
addr
;
TTYDRV_MAIN_ParseOptions
(
argc
,
argv
);
#endif
/* X_DISPLAY_MISSING */
if
(
!
(
display
=
TSXOpenDisplay
(
display_name
)))
{
MSG
(
"%s: Can't open display: %s
\n
"
,
argv
[
0
],
display_name
?
display_name
:
"(none specified)"
);
exit
(
1
);
}
/* tell the libX11 that we will do input method handling ourselves
* that keep libX11 from doing anything whith dead keys, allowing Wine
* to have total control over dead keys, that is this line allows
* them to work in Wine, even whith a libX11 including the dead key
* patches from Th.Quinot (http://Web.FdN.FR/~tquinot/dead-keys.en.html)
*/
TSXOpenIM
(
display
,
NULL
,
NULL
,
NULL
);
/* Merge file and screen databases */
if
((
xrm_string
=
TSXResourceManagerString
(
display
))
!=
NULL
)
{
XrmDatabase
display_db
=
TSXrmGetStringDatabase
(
xrm_string
);
TSXrmMergeDatabases
(
display_db
,
&
db
);
}
/* Parse command line */
TSXrmParseCommand
(
&
db
,
optionsTable
,
NB_OPTIONS
,
Options
.
programName
,
argc
,
argv
);
/* Get all options */
if
(
MAIN_GetResource
(
db
,
".iconic"
,
&
value
))
Options
.
cmdShow
=
SW_SHOWMINIMIZED
;
if
(
MAIN_GetResource
(
db
,
".privatemap"
,
&
value
))
Options
.
usePrivateMap
=
TRUE
;
if
(
MAIN_GetResource
(
db
,
".fixedmap"
,
&
value
))
Options
.
useFixedMap
=
TRUE
;
if
(
MAIN_GetResource
(
db
,
".synchronous"
,
&
value
))
Options
.
synchronous
=
TRUE
;
if
(
MAIN_GetResource
(
db
,
".backingstore"
,
&
value
))
Options
.
backingstore
=
TRUE
;
if
(
MAIN_GetResource
(
db
,
".debug"
,
&
value
))
Options
.
debug
=
TRUE
;
if
(
MAIN_GetResource
(
db
,
".failreadonly"
,
&
value
))
Options
.
failReadOnly
=
TRUE
;
if
(
MAIN_GetResource
(
db
,
".perfect"
,
&
value
))
Options
.
perfectGraphics
=
TRUE
;
if
(
MAIN_GetResource
(
db
,
".depth"
,
&
value
))
screenDepth
=
atoi
(
value
.
addr
);
if
(
MAIN_GetResource
(
db
,
".desktop"
,
&
value
))
Options
.
desktopGeometry
=
value
.
addr
;
if
(
MAIN_GetResource
(
db
,
".language"
,
&
value
))
MAIN_ParseLanguageOption
(
(
char
*
)
value
.
addr
);
if
(
MAIN_GetResource
(
db
,
".managed"
,
&
value
))
Options
.
managed
=
TRUE
;
if
(
MAIN_GetResource
(
db
,
".mode"
,
&
value
))
MAIN_ParseModeOption
(
(
char
*
)
value
.
addr
);
if
(
MAIN_GetResource
(
db
,
".debugoptions"
,
&
value
))
MAIN_ParseDebugOptions
((
char
*
)
value
.
addr
);
if
(
MAIN_GetResource
(
db
,
".debugmsg"
,
&
value
))
{
#ifndef DEBUG_RUNTIME
MSG
(
"%s: Option
\"
-debugmsg
\"
not implemented.
\n
"
\
" Recompile with DEBUG_RUNTIME in include/debugtools.h defined.
\n
"
,
argv
[
0
]);
exit
(
1
);
#else
if
(
MAIN_ParseDebugOptions
((
char
*
)
value
.
addr
)
==
FALSE
)
{
int
i
;
MSG
(
"%s: Syntax: -debugmsg [class]+xxx,... or "
"-debugmsg [class]-xxx,...
\n
"
,
argv
[
0
]);
MSG
(
"Example: -debugmsg +all,warn-heap
\n
"
" turn on all messages except warning heap messages
\n
"
);
MSG
(
"Special case: -debugmsg +relay=DLL:DLL.###:FuncName
\n
"
" turn on -debugmsg +relay only as specified
\n
"
"Special case: -debugmsg -relay=DLL:DLL.###:FuncName
\n
"
" turn on -debugmsg +relay except as specified
\n
"
"Also permitted, +snoop=..., -snoop=... as with relay.
\n\n
"
);
MSG
(
"Available message classes:
\n
"
);
for
(
i
=
0
;
i
<
DEBUG_CLASS_COUNT
;
i
++
)
MSG
(
"%-9s"
,
debug_cl_name
[
i
]);
MSG
(
"
\n\n
"
);
MSG
(
"Available message types:
\n
"
);
MSG
(
"%-9s "
,
"all"
);
for
(
i
=
0
;
i
<
DEBUG_CHANNEL_COUNT
;
i
++
)
if
(
debug_ch_name
[
i
])
MSG
(
"%-9s%c"
,
debug_ch_name
[
i
],
(((
i
+
2
)
%
8
==
0
)
?
'\n'
:
' '
));
MSG
(
"
\n\n
"
);
exit
(
1
);
}
#endif
}
if
(
MAIN_GetResource
(
db
,
".dll"
,
&
value
))
{
/* Hack: store option value in Options to be retrieved */
/* later on inside the emulator code. */
if
(
!
__winelib
)
{
if
(
Options
.
dllFlags
)
{
/* don't overwrite previous value. Should we
* automatically add the ',' between multiple DLLs ?
*/
MSG
(
"Only one -dll flag is allowed. Use ',' between multiple DLLs
\n
"
);
}
else
{
Options
.
dllFlags
=
xstrdup
((
char
*
)
value
.
addr
);
}
}
else
{
MSG
(
"-dll not supported in Winelib
\n
"
);
exit
(
1
);
}
}
if
(
MAIN_GetResource
(
db
,
".winver"
,
&
value
))
VERSION_ParseWinVersion
(
(
char
*
)
value
.
addr
);
if
(
MAIN_GetResource
(
db
,
".dosver"
,
&
value
))
VERSION_ParseDosVersion
(
(
char
*
)
value
.
addr
);
if
(
MAIN_GetResource
(
db
,
".config"
,
&
value
))
Options
.
configFileName
=
xstrdup
((
char
*
)
value
.
addr
);
if
(
MAIN_GetResource
(
db
,
".nodga"
,
&
value
))
Options
.
noDGA
=
TRUE
;
if
(
MAIN_GetResource
(
db
,
".console"
,
&
value
))
Options
.
consoleDrivers
=
xstrdup
((
char
*
)
value
.
addr
);
else
Options
.
consoleDrivers
=
CONSOLE_DEFAULT_DRIVER
;
CONSOLE_Init
(
Options
.
consoleDrivers
);
CONSOLE_Init
(
Options
.
consoleDrivers
);
}
}
/***********************************************************************
* MAIN_CreateDesktop
*/
static
void
MAIN_CreateDesktop
(
int
argc
,
char
*
argv
[]
)
{
int
x
,
y
,
flags
;
unsigned
int
width
=
640
,
height
=
480
;
/* Default size = 640x480 */
char
*
name
=
"Wine desktop"
;
XSizeHints
*
size_hints
;
XWMHints
*
wm_hints
;
XClassHint
*
class_hints
;
XSetWindowAttributes
win_attr
;
XTextProperty
window_name
;
Atom
XA_WM_DELETE_WINDOW
;
flags
=
TSXParseGeometry
(
Options
.
desktopGeometry
,
&
x
,
&
y
,
&
width
,
&
height
);
screenWidth
=
width
;
screenHeight
=
height
;
/* Create window */
win_attr
.
background_pixel
=
BlackPixel
(
display
,
0
);
win_attr
.
event_mask
=
ExposureMask
|
KeyPressMask
|
KeyReleaseMask
|
PointerMotionMask
|
ButtonPressMask
|
ButtonReleaseMask
|
EnterWindowMask
;
win_attr
.
cursor
=
TSXCreateFontCursor
(
display
,
XC_top_left_arrow
);
rootWindow
=
TSXCreateWindow
(
display
,
DefaultRootWindow
(
display
),
x
,
y
,
width
,
height
,
0
,
CopyFromParent
,
InputOutput
,
CopyFromParent
,
CWBackPixel
|
CWEventMask
|
CWCursor
,
&
win_attr
);
/* Set window manager properties */
size_hints
=
TSXAllocSizeHints
();
wm_hints
=
TSXAllocWMHints
();
class_hints
=
TSXAllocClassHint
();
if
(
!
size_hints
||
!
wm_hints
||
!
class_hints
)
{
MSG
(
"Not enough memory for window manager hints.
\n
"
);
exit
(
1
);
}
size_hints
->
min_width
=
size_hints
->
max_width
=
width
;
size_hints
->
min_height
=
size_hints
->
max_height
=
height
;
size_hints
->
flags
=
PMinSize
|
PMaxSize
;
if
(
flags
&
(
XValue
|
YValue
))
size_hints
->
flags
|=
USPosition
;
if
(
flags
&
(
WidthValue
|
HeightValue
))
size_hints
->
flags
|=
USSize
;
else
size_hints
->
flags
|=
PSize
;
wm_hints
->
flags
=
InputHint
|
StateHint
;
wm_hints
->
input
=
True
;
wm_hints
->
initial_state
=
NormalState
;
class_hints
->
res_name
=
argv
[
0
];
class_hints
->
res_class
=
"Wine"
;
TSXStringListToTextProperty
(
&
name
,
1
,
&
window_name
);
TSXSetWMProperties
(
display
,
rootWindow
,
&
window_name
,
&
window_name
,
argv
,
argc
,
size_hints
,
wm_hints
,
class_hints
);
XA_WM_DELETE_WINDOW
=
TSXInternAtom
(
display
,
"WM_DELETE_WINDOW"
,
False
);
TSXSetWMProtocols
(
display
,
rootWindow
,
&
XA_WM_DELETE_WINDOW
,
1
);
TSXFree
(
size_hints
);
TSXFree
(
wm_hints
);
TSXFree
(
class_hints
);
/* Map window */
TSXMapWindow
(
display
,
rootWindow
);
}
XKeyboardState
keyboard_state
;
/***********************************************************************
* MAIN_SaveSetup
*/
static
void
MAIN_SaveSetup
(
void
)
{
TSXGetKeyboardControl
(
display
,
&
keyboard_state
);
}
/***********************************************************************
* MAIN_RestoreSetup
*/
static
void
MAIN_RestoreSetup
(
void
)
{
XKeyboardControl
keyboard_value
;
keyboard_value
.
key_click_percent
=
keyboard_state
.
key_click_percent
;
keyboard_value
.
bell_percent
=
keyboard_state
.
bell_percent
;
keyboard_value
.
bell_pitch
=
keyboard_state
.
bell_pitch
;
keyboard_value
.
bell_duration
=
keyboard_state
.
bell_duration
;
keyboard_value
.
auto_repeat_mode
=
keyboard_state
.
global_auto_repeat
;
XChangeKeyboardControl
(
display
,
KBKeyClickPercent
|
KBBellPercent
|
KBBellPitch
|
KBBellDuration
|
KBAutoRepeatMode
,
&
keyboard_value
);
}
/***********************************************************************
/***********************************************************************
* called_at_exit
* called_at_exit
*/
*/
static
void
called_at_exit
(
void
)
static
void
called_at_exit
(
void
)
{
{
MAIN_RestoreSetup
();
#ifndef X_DISPLAY_MISSING
X11DRV_MAIN_RestoreSetup
();
#else
/* X_DISPLAY_MISSING */
TTYDRV_MAIN_RestoreSetup
();
#endif
/* X_DISPLAY_MISSING */
COLOR_Cleanup
();
COLOR_Cleanup
();
WINSOCK_Shutdown
();
WINSOCK_Shutdown
();
/* FIXME: should check for other processes or threads */
/* FIXME: should check for other processes or threads */
...
@@ -1026,12 +762,6 @@ static void called_at_exit(void)
...
@@ -1026,12 +762,6 @@ static void called_at_exit(void)
CONSOLE_Close
();
CONSOLE_Close
();
}
}
static
int
WINE_X11_ErrorHandler
(
Display
*
display
,
XErrorEvent
*
error_evt
)
{
kill
(
getpid
(),
SIGHUP
);
/* force an entry in the debugger */
return
0
;
}
/***********************************************************************
/***********************************************************************
* MAIN_WineInit
* MAIN_WineInit
*
*
...
@@ -1039,8 +769,6 @@ static int WINE_X11_ErrorHandler(Display *display,XErrorEvent *error_evt)
...
@@ -1039,8 +769,6 @@ static int WINE_X11_ErrorHandler(Display *display,XErrorEvent *error_evt)
*/
*/
BOOL32
MAIN_WineInit
(
int
*
argc
,
char
*
argv
[]
)
BOOL32
MAIN_WineInit
(
int
*
argc
,
char
*
argv
[]
)
{
{
int
depth_count
,
i
;
int
*
depth_list
;
struct
timeval
tv
;
struct
timeval
tv
;
#ifdef MALLOC_DEBUGGING
#ifdef MALLOC_DEBUGGING
...
@@ -1065,56 +793,29 @@ BOOL32 MAIN_WineInit( int *argc, char *argv[] )
...
@@ -1065,56 +793,29 @@ BOOL32 MAIN_WineInit( int *argc, char *argv[] )
gettimeofday
(
&
tv
,
NULL
);
gettimeofday
(
&
tv
,
NULL
);
MSG_WineStartTicks
=
(
tv
.
tv_sec
*
1000
)
+
(
tv
.
tv_usec
/
1000
);
MSG_WineStartTicks
=
(
tv
.
tv_sec
*
1000
)
+
(
tv
.
tv_usec
/
1000
);
/* We need this before calling any Xlib function */
#ifndef X_DISPLAY_MISSING
InitializeCriticalSection
(
&
X11DRV_CritSection
);
X11DRV_MAIN_Initialize
();
MakeCriticalSectionGlobal
(
&
X11DRV_CritSection
);
TSXrmInitialize
();
putenv
(
"XKB_DISABLE="
);
/* Disable XKB extension if present. */
MAIN_ParseOptions
(
argc
,
argv
);
MAIN_ParseOptions
(
argc
,
argv
);
X11DRV_MAIN_Create
();
X11DRV_MAIN_SaveSetup
();
#else
/* !defined(X_DISPLAY_MISSING) */
TTYDRV_MAIN_Initialize
();
MAIN_ParseOptions
(
argc
,
argv
);
TTYDRV_MAIN_Create
();
TTYDRV_MAIN_SaveSetup
();
#endif
/* !defined(X_DISPLAY_MISSING) */
if
(
Options
.
synchronous
)
XSetErrorHandler
(
WINE_X11_ErrorHandler
);
#ifndef X_DISPLAY_MISSING
MONITOR_PrimaryMonitor
.
pDriver
=
&
X11DRV_MONITOR_Driver
;
if
(
Options
.
desktopGeometry
&&
Options
.
managed
)
#else
/* !defined(X_DISPLAY_MISSING) */
{
MONITOR_PrimaryMonitor
.
pDriver
=
&
TTYDRV_MONITOR_Driver
;
#if 0
#endif
/* !defined(X_DISPLAY_MISSING) */
MSG( "%s: -managed and -desktop options cannot be used together\n",
MONITOR_Initialize
(
&
MONITOR_PrimaryMonitor
);
Options.programName );
exit(1);
#else
Options
.
managed
=
FALSE
;
#endif
}
screen
=
DefaultScreenOfDisplay
(
display
);
screenWidth
=
WidthOfScreen
(
screen
);
screenHeight
=
HeightOfScreen
(
screen
);
if
(
screenDepth
)
/* -depth option specified */
{
depth_list
=
TSXListDepths
(
display
,
DefaultScreen
(
display
),
&
depth_count
);
for
(
i
=
0
;
i
<
depth_count
;
i
++
)
if
(
depth_list
[
i
]
==
screenDepth
)
break
;
TSXFree
(
depth_list
);
if
(
i
>=
depth_count
)
{
MSG
(
"%s: Depth %d not supported on this screen.
\n
"
,
Options
.
programName
,
screenDepth
);
exit
(
1
);
}
}
else
screenDepth
=
DefaultDepthOfScreen
(
screen
);
if
(
Options
.
synchronous
)
TSXSynchronize
(
display
,
True
);
if
(
Options
.
desktopGeometry
)
MAIN_CreateDesktop
(
*
argc
,
argv
);
else
rootWindow
=
DefaultRootWindow
(
display
);
MAIN_SaveSetup
();
atexit
(
called_at_exit
);
atexit
(
called_at_exit
);
return
TRUE
;
return
TRUE
;
}
}
/***********************************************************************
/***********************************************************************
* MessageBeep16 (USER.104)
* MessageBeep16 (USER.104)
*/
*/
...
@@ -1159,7 +860,8 @@ LONG WINAPI GetTimerResolution(void)
...
@@ -1159,7 +860,8 @@ LONG WINAPI GetTimerResolution(void)
BOOL32
WINAPI
SystemParametersInfo32A
(
UINT32
uAction
,
UINT32
uParam
,
BOOL32
WINAPI
SystemParametersInfo32A
(
UINT32
uAction
,
UINT32
uParam
,
LPVOID
lpvParam
,
UINT32
fuWinIni
)
LPVOID
lpvParam
,
UINT32
fuWinIni
)
{
{
int
timeout
,
temp
;
int
timeout
;
int
temp
;
XKeyboardState
keyboard_state
;
XKeyboardState
keyboard_state
;
switch
(
uAction
)
{
switch
(
uAction
)
{
...
@@ -1217,8 +919,11 @@ BOOL32 WINAPI SystemParametersInfo32A( UINT32 uAction, UINT32 uParam,
...
@@ -1217,8 +919,11 @@ BOOL32 WINAPI SystemParametersInfo32A( UINT32 uAction, UINT32 uParam,
break
;
break
;
case
SPI_GETSCREENSAVETIMEOUT
:
case
SPI_GETSCREENSAVETIMEOUT
:
/* FIXME GetProfileInt( "windows", "ScreenSaveTimeout", 300 ); */
#ifndef X_DISPLAY_MISSING
TSXGetScreenSaver
(
display
,
&
timeout
,
&
temp
,
&
temp
,
&
temp
);
TSXGetScreenSaver
(
display
,
&
timeout
,
&
temp
,
&
temp
,
&
temp
);
#else
/* X_DISPLAY_MISSING */
timeout
=
GetProfileInt32A
(
"windows"
,
"ScreenSaveTimeout"
,
300
);
#endif
/* X_DISPLAY_MISSING */
*
(
INT32
*
)
lpvParam
=
timeout
*
1000
;
*
(
INT32
*
)
lpvParam
=
timeout
*
1000
;
break
;
break
;
...
@@ -1340,12 +1045,12 @@ BOOL32 WINAPI SystemParametersInfo32A( UINT32 uAction, UINT32 uParam,
...
@@ -1340,12 +1045,12 @@ BOOL32 WINAPI SystemParametersInfo32A( UINT32 uAction, UINT32 uParam,
BOOL16
WINAPI
SystemParametersInfo16
(
UINT16
uAction
,
UINT16
uParam
,
BOOL16
WINAPI
SystemParametersInfo16
(
UINT16
uAction
,
UINT16
uParam
,
LPVOID
lpvParam
,
UINT16
fuWinIni
)
LPVOID
lpvParam
,
UINT16
fuWinIni
)
{
{
int
timeout
,
temp
;
int
timeout
;
char
buffer
[
256
];
char
buffer
[
256
];
int
temp
;
XKeyboardState
keyboard_state
;
XKeyboardState
keyboard_state
;
XKeyboardControl
keyboard_value
;
XKeyboardControl
keyboard_value
;
switch
(
uAction
)
switch
(
uAction
)
{
{
case
SPI_GETBEEP
:
case
SPI_GETBEEP
:
...
@@ -1402,8 +1107,11 @@ BOOL16 WINAPI SystemParametersInfo16( UINT16 uAction, UINT16 uParam,
...
@@ -1402,8 +1107,11 @@ BOOL16 WINAPI SystemParametersInfo16( UINT16 uAction, UINT16 uParam,
break
;
break
;
case
SPI_GETSCREENSAVETIMEOUT
:
case
SPI_GETSCREENSAVETIMEOUT
:
/* FIXME GetProfileInt( "windows", "ScreenSaveTimeout", 300 ); */
#ifndef X_DISPLAY_MISSING
TSXGetScreenSaver
(
display
,
&
timeout
,
&
temp
,
&
temp
,
&
temp
);
TSXGetScreenSaver
(
display
,
&
timeout
,
&
temp
,
&
temp
,
&
temp
);
#else
/* X_DISPLAY_MISSING */
timeout
=
GetProfileInt32A
(
"windows"
,
"ScreenSaveTimeout"
,
300
);
#endif
/* X_DISPLAY_MISSING */
*
(
INT16
*
)
lpvParam
=
timeout
;
*
(
INT16
*
)
lpvParam
=
timeout
;
break
;
break
;
...
...
objects/bitmap.c
View file @
8d8703cb
...
@@ -15,7 +15,8 @@
...
@@ -15,7 +15,8 @@
#include "sysmetrics.h"
#include "sysmetrics.h"
#include "cursoricon.h"
#include "cursoricon.h"
#include "debug.h"
#include "debug.h"
#include "x11drv.h"
#include "monitor.h"
#include "wine/winuser16.h"
/***********************************************************************
/***********************************************************************
* BITMAP_GetPadding
* BITMAP_GetPadding
...
@@ -107,7 +108,7 @@ HBITMAP16 WINAPI CreateUserBitmap16( INT16 width, INT16 height, UINT16 planes,
...
@@ -107,7 +108,7 @@ HBITMAP16 WINAPI CreateUserBitmap16( INT16 width, INT16 height, UINT16 planes,
HBITMAP16
WINAPI
CreateUserDiscardableBitmap16
(
WORD
dummy
,
HBITMAP16
WINAPI
CreateUserDiscardableBitmap16
(
WORD
dummy
,
INT16
width
,
INT16
height
)
INT16
width
,
INT16
height
)
{
{
return
CreateUserBitmap16
(
width
,
height
,
1
,
screenDepth
,
NULL
);
return
CreateUserBitmap16
(
width
,
height
,
1
,
MONITOR_GetDepth
(
&
MONITOR_PrimaryMonitor
)
,
NULL
);
}
}
...
...
objects/color.c
View file @
8d8703cb
...
@@ -5,16 +5,18 @@
...
@@ -5,16 +5,18 @@
* Copyright 1996 Alex Korobka
* Copyright 1996 Alex Korobka
*/
*/
#include <stdlib.h>
#include "ts_xlib.h"
#include "ts_xlib.h"
#include "x11drv.h"
#include <stdlib.h>
#include <string.h>
#include <string.h>
#include "win
dow
s.h"
#include "win
type
s.h"
#include "options.h"
#include "options.h"
#include "gdi.h"
#include "gdi.h"
#include "color.h"
#include "color.h"
#include "debug.h"
#include "debug.h"
#include "xmalloc.h"
#include "xmalloc.h"
#include "
x11drv
.h"
#include "
monitor
.h"
/* Palette indexed mode:
/* Palette indexed mode:
...
@@ -121,7 +123,7 @@ int COLOR_mapEGAPixel[16];
...
@@ -121,7 +123,7 @@ int COLOR_mapEGAPixel[16];
/***********************************************************************
/***********************************************************************
* Misc auxiliary functions
* Misc auxiliary functions
*/
*/
Colormap
COLOR_GetColormap
(
void
)
Colormap
X11DRV_
COLOR_GetColormap
(
void
)
{
{
return
cSpace
.
colorMap
;
return
cSpace
.
colorMap
;
}
}
...
@@ -238,7 +240,6 @@ static void COLOR_FillDefaultColors(void)
...
@@ -238,7 +240,6 @@ static void COLOR_FillDefaultColors(void)
(
DoRed
|
DoGreen
|
DoBlue
)
};
(
DoRed
|
DoGreen
|
DoBlue
)
};
TSXStoreColor
(
display
,
cSpace
.
colorMap
,
&
color
);
TSXStoreColor
(
display
,
cSpace
.
colorMap
,
&
color
);
}
}
idx
=
COLOR_freeList
[
idx
];
idx
=
COLOR_freeList
[
idx
];
}
}
...
@@ -327,6 +328,7 @@ static BOOL32 COLOR_BuildPrivateMap(CSPACE* cs)
...
@@ -327,6 +328,7 @@ static BOOL32 COLOR_BuildPrivateMap(CSPACE* cs)
COLOR_gapStart
=
256
;
COLOR_gapEnd
=
-
1
;
COLOR_gapStart
=
256
;
COLOR_gapEnd
=
-
1
;
COLOR_firstFree
=
(
cs
->
size
>
NB_RESERVED_COLORS
)
?
NB_RESERVED_COLORS
/
2
:
-
1
;
COLOR_firstFree
=
(
cs
->
size
>
NB_RESERVED_COLORS
)
?
NB_RESERVED_COLORS
/
2
:
-
1
;
return
FALSE
;
return
FALSE
;
}
}
...
@@ -369,7 +371,7 @@ static BOOL32 COLOR_BuildSharedMap(CSPACE* cs)
...
@@ -369,7 +371,7 @@ static BOOL32 COLOR_BuildSharedMap(CSPACE* cs)
bp
=
BlackPixel
(
display
,
DefaultScreen
(
display
));
bp
=
BlackPixel
(
display
,
DefaultScreen
(
display
));
wp
=
WhitePixel
(
display
,
DefaultScreen
(
display
));
wp
=
WhitePixel
(
display
,
DefaultScreen
(
display
));
max
=
(
0xffffffff
)
>>
(
32
-
screenDepth
);
max
=
(
0xffffffff
)
>>
(
32
-
MONITOR_GetDepth
(
&
MONITOR_PrimaryMonitor
)
);
if
(
max
>
256
)
if
(
max
>
256
)
{
{
step
=
max
/
256
;
step
=
max
/
256
;
...
@@ -470,7 +472,7 @@ static BOOL32 COLOR_BuildSharedMap(CSPACE* cs)
...
@@ -470,7 +472,7 @@ static BOOL32 COLOR_BuildSharedMap(CSPACE* cs)
* to maintain compatibility
* to maintain compatibility
*/
*/
cs
->
size
=
256
;
cs
->
size
=
256
;
TRACE
(
palette
,
"Virtual colorspace - screendepth %i
\n
"
,
screenDepth
);
TRACE
(
palette
,
"Virtual colorspace - screendepth %i
\n
"
,
MONITOR_GetDepth
(
&
MONITOR_PrimaryMonitor
)
);
}
}
else
cs
->
size
=
NB_RESERVED_COLORS
;
/* system palette only - however we can alloc a bunch
else
cs
->
size
=
NB_RESERVED_COLORS
;
/* system palette only - however we can alloc a bunch
* of colors and map to them */
* of colors and map to them */
...
@@ -493,7 +495,7 @@ static BOOL32 COLOR_BuildSharedMap(CSPACE* cs)
...
@@ -493,7 +495,7 @@ static BOOL32 COLOR_BuildSharedMap(CSPACE* cs)
/* setup system palette entry <-> pixel mappings and fill in 20 fixed entries */
/* setup system palette entry <-> pixel mappings and fill in 20 fixed entries */
if
(
screenDepth
<=
8
)
if
(
MONITOR_GetDepth
(
&
MONITOR_PrimaryMonitor
)
<=
8
)
{
{
COLOR_PixelToPalette
=
(
int
*
)
xmalloc
(
sizeof
(
int
)
*
256
);
COLOR_PixelToPalette
=
(
int
*
)
xmalloc
(
sizeof
(
int
)
*
256
);
memset
(
COLOR_PixelToPalette
,
0
,
256
*
sizeof
(
int
)
);
memset
(
COLOR_PixelToPalette
,
0
,
256
*
sizeof
(
int
)
);
...
@@ -536,6 +538,7 @@ static BOOL32 COLOR_BuildSharedMap(CSPACE* cs)
...
@@ -536,6 +538,7 @@ static BOOL32 COLOR_BuildSharedMap(CSPACE* cs)
}
}
if
(
pixDynMapping
)
free
(
pixDynMapping
);
if
(
pixDynMapping
)
free
(
pixDynMapping
);
return
TRUE
;
return
TRUE
;
}
}
...
@@ -576,8 +579,8 @@ BOOL32 COLOR_Init(void)
...
@@ -576,8 +579,8 @@ BOOL32 COLOR_Init(void)
TRACE
(
palette
,
"initializing palette manager...
\n
"
);
TRACE
(
palette
,
"initializing palette manager...
\n
"
);
white
=
WhitePixelOfScreen
(
screen
);
white
=
WhitePixelOfScreen
(
X11DRV_GetXScreen
()
);
black
=
BlackPixelOfScreen
(
screen
);
black
=
BlackPixelOfScreen
(
X11DRV_GetXScreen
()
);
cSpace
.
monoPlane
=
1
;
cSpace
.
monoPlane
=
1
;
for
(
mask
=
1
;
!
((
white
&
mask
)
^
(
black
&
mask
));
mask
<<=
1
)
for
(
mask
=
1
;
!
((
white
&
mask
)
^
(
black
&
mask
));
mask
<<=
1
)
cSpace
.
monoPlane
++
;
cSpace
.
monoPlane
++
;
...
@@ -594,7 +597,7 @@ BOOL32 COLOR_Init(void)
...
@@ -594,7 +597,7 @@ BOOL32 COLOR_Init(void)
{
{
XSetWindowAttributes
win_attr
;
XSetWindowAttributes
win_attr
;
cSpace
.
colorMap
=
TSXCreateColormap
(
display
,
rootWindow
,
cSpace
.
colorMap
=
TSXCreateColormap
(
display
,
X11DRV_GetXRootWindow
()
,
visual
,
AllocAll
);
visual
,
AllocAll
);
if
(
cSpace
.
colorMap
)
if
(
cSpace
.
colorMap
)
{
{
...
@@ -604,22 +607,22 @@ BOOL32 COLOR_Init(void)
...
@@ -604,22 +607,22 @@ BOOL32 COLOR_Init(void)
for
(
white
=
cSpace
.
size
-
1
;
!
(
white
&
1
);
white
>>=
1
)
for
(
white
=
cSpace
.
size
-
1
;
!
(
white
&
1
);
white
>>=
1
)
cSpace
.
monoPlane
++
;
cSpace
.
monoPlane
++
;
if
(
rootWindow
!=
DefaultRootWindow
(
display
)
)
if
(
X11DRV_GetXRootWindow
()
!=
DefaultRootWindow
(
display
)
)
{
{
win_attr
.
colormap
=
cSpace
.
colorMap
;
win_attr
.
colormap
=
cSpace
.
colorMap
;
TSXChangeWindowAttributes
(
display
,
rootWindow
,
TSXChangeWindowAttributes
(
display
,
X11DRV_GetXRootWindow
()
,
CWColormap
,
&
win_attr
);
CWColormap
,
&
win_attr
);
}
}
break
;
break
;
}
}
}
}
cSpace
.
colorMap
=
DefaultColormapOfScreen
(
screen
);
cSpace
.
colorMap
=
DefaultColormapOfScreen
(
X11DRV_GetXScreen
()
);
break
;
break
;
case
StaticGray
:
case
StaticGray
:
cSpace
.
colorMap
=
DefaultColormapOfScreen
(
screen
);
cSpace
.
colorMap
=
DefaultColormapOfScreen
(
X11DRV_GetXScreen
()
);
cSpace
.
flags
|=
COLOR_FIXED
;
cSpace
.
flags
|=
COLOR_FIXED
;
COLOR_Graymax
=
(
1
<<
screenDepth
)
-
1
;
COLOR_Graymax
=
(
1
<<
MONITOR_GetDepth
(
&
MONITOR_PrimaryMonitor
)
)
-
1
;
break
;
break
;
case
TrueColor
:
case
TrueColor
:
...
@@ -635,12 +638,12 @@ BOOL32 COLOR_Init(void)
...
@@ -635,12 +638,12 @@ BOOL32 COLOR_Init(void)
for
(
white
=
cSpace
.
size
-
1
;
!
(
white
&
1
);
white
>>=
1
)
for
(
white
=
cSpace
.
size
-
1
;
!
(
white
&
1
);
white
>>=
1
)
cSpace
.
monoPlane
++
;
cSpace
.
monoPlane
++
;
cSpace
.
flags
=
(
white
&
mask
)
?
COLOR_WHITESET
:
0
;
cSpace
.
flags
=
(
white
&
mask
)
?
COLOR_WHITESET
:
0
;
cSpace
.
colorMap
=
DefaultColormapOfScreen
(
screen
);
cSpace
.
colorMap
=
DefaultColormapOfScreen
(
X11DRV_GetXScreen
()
);
TSXFree
(
depths
);
TSXFree
(
depths
);
break
;
break
;
}
}
TSXFree
(
depths
);
TSXFree
(
depths
);
cSpace
.
colorMap
=
DefaultColormapOfScreen
(
screen
);
cSpace
.
colorMap
=
DefaultColormapOfScreen
(
X11DRV_GetXScreen
()
);
cSpace
.
flags
|=
COLOR_FIXED
;
cSpace
.
flags
|=
COLOR_FIXED
;
COLOR_Computeshifts
(
visual
->
red_mask
,
&
COLOR_Redshift
,
&
COLOR_Redmax
);
COLOR_Computeshifts
(
visual
->
red_mask
,
&
COLOR_Redshift
,
&
COLOR_Redmax
);
COLOR_Computeshifts
(
visual
->
green_mask
,
&
COLOR_Greenshift
,
&
COLOR_Greenmax
);
COLOR_Computeshifts
(
visual
->
green_mask
,
&
COLOR_Greenshift
,
&
COLOR_Greenmax
);
...
@@ -822,7 +825,7 @@ COLORREF COLOR_ToLogical(int pixel)
...
@@ -822,7 +825,7 @@ COLORREF COLOR_ToLogical(int pixel)
#if 0
#if 0
/* truecolor visual */
/* truecolor visual */
if (
screenDepth
>= 24) return pixel;
if (
MONITOR_GetDepth(&MONITOR_PrimaryMonitor)
>= 24) return pixel;
#endif
#endif
/* check for hicolor visuals first */
/* check for hicolor visuals first */
...
@@ -839,7 +842,7 @@ COLORREF COLOR_ToLogical(int pixel)
...
@@ -839,7 +842,7 @@ COLORREF COLOR_ToLogical(int pixel)
/* check if we can bypass X */
/* check if we can bypass X */
if
((
screenDepth
<=
8
)
&&
(
pixel
<
256
)
&&
if
((
MONITOR_GetDepth
(
&
MONITOR_PrimaryMonitor
)
<=
8
)
&&
(
pixel
<
256
)
&&
!
(
cSpace
.
flags
&
(
COLOR_VIRTUAL
|
COLOR_FIXED
))
)
!
(
cSpace
.
flags
&
(
COLOR_VIRTUAL
|
COLOR_FIXED
))
)
return
(
*
(
COLORREF
*
)(
COLOR_sysPal
+
return
(
*
(
COLORREF
*
)(
COLOR_sysPal
+
((
COLOR_PixelToPalette
)
?
COLOR_PixelToPalette
[
pixel
]
:
pixel
))
)
&
0x00ffffff
;
((
COLOR_PixelToPalette
)
?
COLOR_PixelToPalette
[
pixel
]
:
pixel
))
)
&
0x00ffffff
;
...
...
objects/dc.c
View file @
8d8703cb
...
@@ -5,6 +5,9 @@
...
@@ -5,6 +5,9 @@
*
*
*/
*/
#include "ts_xlib.h"
#include "x11drv.h"
#include <stdlib.h>
#include <stdlib.h>
#include <string.h>
#include <string.h>
#include "dc.h"
#include "dc.h"
...
@@ -14,8 +17,7 @@
...
@@ -14,8 +17,7 @@
#include "debug.h"
#include "debug.h"
#include "font.h"
#include "font.h"
#include "winerror.h"
#include "winerror.h"
#include "x11drv.h"
#include "wine/winuser16.h"
#include "ts_xlib.h"
/***********************************************************************
/***********************************************************************
* DC_Init_DC_INFO
* DC_Init_DC_INFO
...
...
objects/dib.c
View file @
8d8703cb
...
@@ -6,6 +6,9 @@
...
@@ -6,6 +6,9 @@
* TODO: Still contains some references to X11DRV.
* TODO: Still contains some references to X11DRV.
*/
*/
#include "ts_xlib.h"
#include "x11drv.h"
#include <stdlib.h>
#include <stdlib.h>
#include "dc.h"
#include "dc.h"
#include "bitmap.h"
#include "bitmap.h"
...
@@ -13,7 +16,9 @@
...
@@ -13,7 +16,9 @@
#include "palette.h"
#include "palette.h"
#include "global.h"
#include "global.h"
#include "debug.h"
#include "debug.h"
#include "x11drv.h"
#include "local.h"
#include "xmalloc.h"
/* for XCREATEIMAGE macro */
#include "monitor.h"
/***********************************************************************
/***********************************************************************
...
@@ -696,7 +701,7 @@ HBITMAP32 WINAPI CreateDIBitmap32( HDC32 hdc, const BITMAPINFOHEADER *header,
...
@@ -696,7 +701,7 @@ HBITMAP32 WINAPI CreateDIBitmap32( HDC32 hdc, const BITMAPINFOHEADER *header,
/* Now create the bitmap */
/* Now create the bitmap */
handle
=
fColor
?
CreateBitmap32
(
width
,
height
,
1
,
screenDepth
,
NULL
)
:
handle
=
fColor
?
CreateBitmap32
(
width
,
height
,
1
,
MONITOR_GetDepth
(
&
MONITOR_PrimaryMonitor
)
,
NULL
)
:
CreateBitmap32
(
width
,
height
,
1
,
1
,
NULL
);
CreateBitmap32
(
width
,
height
,
1
,
1
,
NULL
);
if
(
!
handle
)
return
0
;
if
(
!
handle
)
return
0
;
...
...
objects/gdiobj.c
View file @
8d8703cb
...
@@ -4,6 +4,14 @@
...
@@ -4,6 +4,14 @@
* Copyright 1993 Alexandre Julliard
* Copyright 1993 Alexandre Julliard
*/
*/
#include "config.h"
#ifndef X_DISPLAY_MISSING
#include "x11drv.h"
#else
/* !defined(X_DISPLAY_MISSING) */
#include "ttydrv.h"
#endif
/* !defined(X_DISPLAY_MISSING) */
#include <stdlib.h>
#include <stdlib.h>
#include "bitmap.h"
#include "bitmap.h"
#include "brush.h"
#include "brush.h"
...
@@ -16,7 +24,6 @@
...
@@ -16,7 +24,6 @@
#include "region.h"
#include "region.h"
#include "debug.h"
#include "debug.h"
#include "gdi.h"
#include "gdi.h"
#include "x11drv.h"
/***********************************************************************
/***********************************************************************
* GDI stock objects
* GDI stock objects
...
@@ -243,8 +250,13 @@ BOOL32 GDI_Init(void)
...
@@ -243,8 +250,13 @@ BOOL32 GDI_Init(void)
/* Initialize drivers */
/* Initialize drivers */
#ifndef X_DISPLAY_MISSING
if
(
!
X11DRV_Init
()
)
if
(
!
X11DRV_Init
()
)
return
FALSE
;
return
FALSE
;
#else
/* !defined(X_DISPLAY_MISSING) */
if
(
!
TTYDRV_GDI_Initialize
()
)
return
FALSE
;
#endif
/* !defined(X_DISPLAY_MISSING) */
/* Create default palette */
/* Create default palette */
...
...
objects/palette.c
View file @
8d8703cb
...
@@ -15,6 +15,7 @@
...
@@ -15,6 +15,7 @@
#include "palette.h"
#include "palette.h"
#include "xmalloc.h"
#include "xmalloc.h"
#include "debug.h"
#include "debug.h"
#include "wine/winuser16.h"
FARPROC32
pfnSelectPalette
=
NULL
;
FARPROC32
pfnSelectPalette
=
NULL
;
FARPROC32
pfnRealizePalette
=
NULL
;
FARPROC32
pfnRealizePalette
=
NULL
;
...
...
windows/clipboard.c
View file @
8d8703cb
...
@@ -22,7 +22,11 @@
...
@@ -22,7 +22,11 @@
#include "xmalloc.h"
#include "xmalloc.h"
#include "debug.h"
#include "debug.h"
#ifndef X_DISPLAY_MISSING
extern
CLIPBOARD_DRIVER
X11DRV_CLIPBOARD_Driver
;
extern
CLIPBOARD_DRIVER
X11DRV_CLIPBOARD_Driver
;
#else
/* X_DISPLAY_MISSING */
extern
CLIPBOARD_DRIVER
TTYDRV_CLIPBOARD_Driver
;
#endif
/* X_DISPLAY_MISSING */
#define CF_REGFORMATBASE 0xC000
#define CF_REGFORMATBASE 0xC000
...
@@ -75,7 +79,11 @@ static LPCLIPFORMAT __lookup_format( LPCLIPFORMAT lpFormat, WORD wID )
...
@@ -75,7 +79,11 @@ static LPCLIPFORMAT __lookup_format( LPCLIPFORMAT lpFormat, WORD wID )
*/
*/
CLIPBOARD_DRIVER
*
CLIPBOARD_GetDriver
()
CLIPBOARD_DRIVER
*
CLIPBOARD_GetDriver
()
{
{
#ifndef X_DISPLAY_MISSING
return
&
X11DRV_CLIPBOARD_Driver
;
return
&
X11DRV_CLIPBOARD_Driver
;
#else
/* X_DISPLAY_MISSING */
return
&
TTYDRV_CLIPBOARD_Driver
;
#endif
/* X_DISPLAY_MISSING */
};
};
/**************************************************************************
/**************************************************************************
...
...
windows/dce.c
View file @
8d8703cb
...
@@ -17,6 +17,8 @@
...
@@ -17,6 +17,8 @@
* DCX_WINDOWPAINT - BeginPaint() is in effect
* DCX_WINDOWPAINT - BeginPaint() is in effect
*/
*/
#include "x11drv.h"
#include "options.h"
#include "options.h"
#include "dce.h"
#include "dce.h"
#include "class.h"
#include "class.h"
...
@@ -25,6 +27,7 @@
...
@@ -25,6 +27,7 @@
#include "region.h"
#include "region.h"
#include "heap.h"
#include "heap.h"
#include "sysmetrics.h"
#include "sysmetrics.h"
#include "local.h"
#include "debug.h"
#include "debug.h"
#include "wine/winuser16.h"
#include "wine/winuser16.h"
...
@@ -725,7 +728,7 @@ HDC32 WINAPI GetDCEx32( HWND32 hwnd, HRGN32 hrgnClip, DWORD flags )
...
@@ -725,7 +728,7 @@ HDC32 WINAPI GetDCEx32( HWND32 hwnd, HRGN32 hrgnClip, DWORD flags )
}
}
else
else
if
((
hwnd
==
GetDesktopWindow32
())
&&
if
((
hwnd
==
GetDesktopWindow32
())
&&
(
rootWindow
==
DefaultRootWindow
(
display
)))
(
X11DRV_WND_GetXRootWindow
(
wndPtr
)
==
DefaultRootWindow
(
display
)))
hrgnVisible
=
CreateRectRgn32
(
0
,
0
,
SYSMETRICS_CXSCREEN
,
hrgnVisible
=
CreateRectRgn32
(
0
,
0
,
SYSMETRICS_CXSCREEN
,
SYSMETRICS_CYSCREEN
);
SYSMETRICS_CYSCREEN
);
else
else
...
...
windows/display.c
View file @
8d8703cb
...
@@ -5,18 +5,28 @@
...
@@ -5,18 +5,28 @@
*
*
*/
*/
#include "config.h"
#include "debug.h"
#include "debug.h"
#include "display.h"
#include "display.h"
#include "wintypes.h"
#include "wintypes.h"
#ifndef X_DISPLAY_MISSING
extern
MOUSE_DRIVER
X11DRV_MOUSE_Driver
;
extern
MOUSE_DRIVER
X11DRV_MOUSE_Driver
;
#else
/* X_DISPLAY_MISSING */
extern
MOUSE_DRIVER
TTYDRV_MOUSE_Driver
;
#endif
/* X_DISPLAY_MISSING */
/***********************************************************************
/***********************************************************************
* MOUSE_GetDriver()
* MOUSE_GetDriver()
*/
*/
MOUSE_DRIVER
*
MOUSE_GetDriver
()
MOUSE_DRIVER
*
MOUSE_GetDriver
()
{
{
#ifndef X_DISPLAY_MISSING
return
&
X11DRV_MOUSE_Driver
;
return
&
X11DRV_MOUSE_Driver
;
#else
/* X_DISPLAY_MISSING */
return
&
TTYDRV_MOUSE_Driver
;
#endif
/* X_DISPLAY_MISSING */
}
}
/***********************************************************************
/***********************************************************************
...
...
windows/event.c
View file @
8d8703cb
...
@@ -5,16 +5,26 @@
...
@@ -5,16 +5,26 @@
*
*
*/
*/
#include "config.h"
#include "message.h"
#include "message.h"
#ifndef X_DISPLAY_MISSING
extern
EVENT_DRIVER
X11DRV_EVENT_Driver
;
extern
EVENT_DRIVER
X11DRV_EVENT_Driver
;
#else
/* X_DISPLAY_MISSING */
extern
EVENT_DRIVER
TTYDRV_EVENT_Driver
;
#endif
/* X_DISPLAY_MISSING */
/***********************************************************************
/***********************************************************************
* EVENT_GetDriver
* EVENT_GetDriver
*/
*/
EVENT_DRIVER
*
EVENT_GetDriver
(
void
)
EVENT_DRIVER
*
EVENT_GetDriver
(
void
)
{
{
#ifndef X_DISPLAY_MISSING
return
&
X11DRV_EVENT_Driver
;
return
&
X11DRV_EVENT_Driver
;
#else
/* X_DISPLAY_MISSING */
return
&
TTYDRV_EVENT_Driver
;
#endif
/* X_DISPLAY_MISSING */
}
}
/***********************************************************************
/***********************************************************************
...
...
windows/keyboard.c
View file @
8d8703cb
...
@@ -9,6 +9,8 @@
...
@@ -9,6 +9,8 @@
*
*
*/
*/
#include "config.h"
#include <stdlib.h>
#include <stdlib.h>
#include <string.h>
#include <string.h>
#include <ctype.h>
#include <ctype.h>
...
@@ -26,14 +28,22 @@
...
@@ -26,14 +28,22 @@
static
LPKEYBD_EVENT_PROC
DefKeybEventProc
=
NULL
;
static
LPKEYBD_EVENT_PROC
DefKeybEventProc
=
NULL
;
LPBYTE
pKeyStateTable
=
NULL
;
LPBYTE
pKeyStateTable
=
NULL
;
#ifndef X_DISPLAY_MISSING
extern
KEYBOARD_DRIVER
X11DRV_KEYBOARD_Driver
;
extern
KEYBOARD_DRIVER
X11DRV_KEYBOARD_Driver
;
#else
/* X_DISPLAY_MISSING */
extern
KEYBOARD_DRIVER
TTYDRV_KEYBOARD_Driver
;
#endif
/* X_DISPLAY_MISSING */
/***********************************************************************
/***********************************************************************
* KEYBOARD_GetDriver
* KEYBOARD_GetDriver
*/
*/
KEYBOARD_DRIVER
*
KEYBOARD_GetDriver
()
KEYBOARD_DRIVER
*
KEYBOARD_GetDriver
()
{
{
#ifndef X_DISPLAY_MISSING
return
&
X11DRV_KEYBOARD_Driver
;
return
&
X11DRV_KEYBOARD_Driver
;
#else
/* X_DISPLAY_MISSING */
return
&
TTYDRV_KEYBOARD_Driver
;
#endif
/* X_DISPLAY_MISSING */
}
}
/***********************************************************************
/***********************************************************************
...
...
windows/mouse.c
View file @
8d8703cb
...
@@ -11,7 +11,11 @@
...
@@ -11,7 +11,11 @@
#include "mouse.h"
#include "mouse.h"
#include "debug.h"
#include "debug.h"
#include "debugtools.h"
#include "debugtools.h"
#include "x11drv.h"
#include "desktop.h"
/**********************************************************************/
extern
BOOL32
X11DRV_MOUSE_DisableWarpPointer
;
static
LPMOUSE_EVENT_PROC
DefMouseEventProc
=
NULL
;
static
LPMOUSE_EVENT_PROC
DefMouseEventProc
=
NULL
;
...
@@ -55,7 +59,6 @@ VOID WINAPI MOUSE_Disable(VOID)
...
@@ -55,7 +59,6 @@ VOID WINAPI MOUSE_Disable(VOID)
void
MOUSE_SendEvent
(
DWORD
mouseStatus
,
DWORD
posX
,
DWORD
posY
,
void
MOUSE_SendEvent
(
DWORD
mouseStatus
,
DWORD
posX
,
DWORD
posY
,
DWORD
keyState
,
DWORD
time
,
HWND32
hWnd
)
DWORD
keyState
,
DWORD
time
,
HWND32
hWnd
)
{
{
extern
BOOL32
DISPLAY_DisableWarpPointer
;
WINE_MOUSEEVENT
wme
;
WINE_MOUSEEVENT
wme
;
if
(
!
DefMouseEventProc
)
return
;
if
(
!
DefMouseEventProc
)
return
;
...
@@ -63,16 +66,16 @@ void MOUSE_SendEvent( DWORD mouseStatus, DWORD posX, DWORD posY,
...
@@ -63,16 +66,16 @@ void MOUSE_SendEvent( DWORD mouseStatus, DWORD posX, DWORD posY,
TRACE
(
event
,
"(%04lX,%ld,%ld)
\n
"
,
mouseStatus
,
posX
,
posY
);
TRACE
(
event
,
"(%04lX,%ld,%ld)
\n
"
,
mouseStatus
,
posX
,
posY
);
mouseStatus
|=
MOUSEEVENTF_ABSOLUTE
;
mouseStatus
|=
MOUSEEVENTF_ABSOLUTE
;
posX
=
(((
long
)
posX
<<
16
)
+
screenWidth
-
1
)
/
screenWidth
;
posX
=
(((
long
)
posX
<<
16
)
+
DESKTOP_GetScreenWidth
()
-
1
)
/
DESKTOP_GetScreenWidth
()
;
posY
=
(((
long
)
posY
<<
16
)
+
screenHeight
-
1
)
/
screenHeight
;
posY
=
(((
long
)
posY
<<
16
)
+
DESKTOP_GetScreenHeight
()
-
1
)
/
DESKTOP_GetScreenHeight
()
;
wme
.
magic
=
WINE_MOUSEEVENT_MAGIC
;
wme
.
magic
=
WINE_MOUSEEVENT_MAGIC
;
wme
.
keyState
=
keyState
;
wme
.
keyState
=
keyState
;
wme
.
time
=
time
;
wme
.
time
=
time
;
wme
.
hWnd
=
hWnd
;
wme
.
hWnd
=
hWnd
;
DISPLAY
_DisableWarpPointer
=
TRUE
;
X11DRV_MOUSE
_DisableWarpPointer
=
TRUE
;
DefMouseEventProc
(
mouseStatus
,
posX
,
posY
,
0
,
(
DWORD
)
&
wme
);
DefMouseEventProc
(
mouseStatus
,
posX
,
posY
,
0
,
(
DWORD
)
&
wme
);
DISPLAY
_DisableWarpPointer
=
FALSE
;
X11DRV_MOUSE
_DisableWarpPointer
=
FALSE
;
}
}
windows/sysmetrics.c
View file @
8d8703cb
...
@@ -7,10 +7,10 @@
...
@@ -7,10 +7,10 @@
#include <stdio.h>
#include <stdio.h>
#include "gdi.h"
#include "gdi.h"
#include "monitor.h"
#include "options.h"
#include "options.h"
#include "tweak.h"
#include "sysmetrics.h"
#include "sysmetrics.h"
#include "
x11drv
.h"
#include "
tweak
.h"
short
sysMetrics
[
SM_CMETRICS
+
1
];
short
sysMetrics
[
SM_CMETRICS
+
1
];
...
@@ -35,8 +35,8 @@ void SYSMETRICS_Init(void)
...
@@ -35,8 +35,8 @@ void SYSMETRICS_Init(void)
{
{
sysMetrics
[
SM_CXCURSOR
]
=
32
;
sysMetrics
[
SM_CXCURSOR
]
=
32
;
sysMetrics
[
SM_CYCURSOR
]
=
32
;
sysMetrics
[
SM_CYCURSOR
]
=
32
;
sysMetrics
[
SM_CXSCREEN
]
=
screenWidth
;
sysMetrics
[
SM_CXSCREEN
]
=
MONITOR_GetWidth
(
&
MONITOR_PrimaryMonitor
)
;
sysMetrics
[
SM_CYSCREEN
]
=
screenHeight
;
sysMetrics
[
SM_CYSCREEN
]
=
MONITOR_GetHeight
(
&
MONITOR_PrimaryMonitor
)
;
sysMetrics
[
SM_CXVSCROLL
]
=
sysMetrics
[
SM_CXVSCROLL
]
=
PROFILE_GetWineIniInt
(
"Tweak.Layout"
,
"ScrollBarWidth"
,
16
)
+
1
;
PROFILE_GetWineIniInt
(
"Tweak.Layout"
,
"ScrollBarWidth"
,
16
)
+
1
;
sysMetrics
[
SM_CYHSCROLL
]
=
sysMetrics
[
SM_CXVSCROLL
];
sysMetrics
[
SM_CYHSCROLL
]
=
sysMetrics
[
SM_CXVSCROLL
];
...
...
windows/user.c
View file @
8d8703cb
...
@@ -24,7 +24,9 @@
...
@@ -24,7 +24,9 @@
#include "miscemu.h"
#include "miscemu.h"
#include "shell.h"
#include "shell.h"
#include "callback.h"
#include "callback.h"
#include "x11drv.h"
#include "local.h"
#include "class.h"
#include "desktop.h"
/***********************************************************************
/***********************************************************************
* GetFreeSystemResources (USER.284)
* GetFreeSystemResources (USER.284)
...
@@ -312,9 +314,9 @@ LONG WINAPI ChangeDisplaySettings32A( LPDEVMODE32A devmode, DWORD flags )
...
@@ -312,9 +314,9 @@ LONG WINAPI ChangeDisplaySettings32A( LPDEVMODE32A devmode, DWORD flags )
FIXME
(
system
,
": stub
\n
"
);
FIXME
(
system
,
": stub
\n
"
);
if
(
devmode
==
NULL
)
if
(
devmode
==
NULL
)
FIXME
(
system
,
" devmode=NULL (return to default mode)
\n
"
);
FIXME
(
system
,
" devmode=NULL (return to default mode)
\n
"
);
else
if
(
(
devmode
->
dmBitsPerPel
!=
D
efaultDepthOfScreen
(
screen
))
else
if
(
(
devmode
->
dmBitsPerPel
!=
D
ESKTOP_GetScreenDepth
(
))
||
(
devmode
->
dmPelsHeight
!=
screenHeight
)
||
(
devmode
->
dmPelsHeight
!=
DESKTOP_GetScreenHeight
()
)
||
(
devmode
->
dmPelsWidth
!=
screenWidth
)
)
||
(
devmode
->
dmPelsWidth
!=
DESKTOP_GetScreenWidth
()
)
)
{
{
...
@@ -353,9 +355,9 @@ BOOL32 WINAPI EnumDisplaySettings32A(
...
@@ -353,9 +355,9 @@ BOOL32 WINAPI EnumDisplaySettings32A(
TRACE
(
system
,
"(%s,%ld,%p)
\n
"
,
name
,
n
,
devmode
);
TRACE
(
system
,
"(%s,%ld,%p)
\n
"
,
name
,
n
,
devmode
);
if
(
n
==
0
)
{
if
(
n
==
0
)
{
devmode
->
dmBitsPerPel
=
D
efaultDepthOfScreen
(
screen
);
devmode
->
dmBitsPerPel
=
D
ESKTOP_GetScreenDepth
(
);
devmode
->
dmPelsHeight
=
screenHeight
;
devmode
->
dmPelsHeight
=
DESKTOP_GetScreenHeight
()
;
devmode
->
dmPelsWidth
=
screenWidth
;
devmode
->
dmPelsWidth
=
DESKTOP_GetScreenWidth
()
;
return
TRUE
;
return
TRUE
;
}
}
if
((
n
-
1
)
<
NRMODES
*
NRDEPTHS
)
{
if
((
n
-
1
)
<
NRMODES
*
NRDEPTHS
)
{
...
...
windows/win.c
View file @
8d8703cb
...
@@ -4,6 +4,8 @@
...
@@ -4,6 +4,8 @@
* Copyright 1993, 1994 Alexandre Julliard
* Copyright 1993, 1994 Alexandre Julliard
*/
*/
#include "config.h"
#include <stdlib.h>
#include <stdlib.h>
#include <string.h>
#include <string.h>
#include "options.h"
#include "options.h"
...
@@ -31,8 +33,16 @@
...
@@ -31,8 +33,16 @@
#include "debug.h"
#include "debug.h"
#include "winerror.h"
#include "winerror.h"
#include "mdi.h"
#include "mdi.h"
#include "local.h"
#include "desktop.h"
#ifndef X_DISPLAY_MISSING
extern
DESKTOP_DRIVER
X11DRV_DESKTOP_Driver
;
extern
WND_DRIVER
X11DRV_WND_Driver
;
extern
WND_DRIVER
X11DRV_WND_Driver
;
#else
/* X_DISPLAY_MISSING */
extern
DESKTOP_DRIVER
TTYDRV_DESKTOP_Driver
;
extern
WND_DRIVER
TTYDRV_WND_Driver
;
#endif
/* X_DISPLAY_MISSING */
/* Desktop window */
/* Desktop window */
static
WND
*
pWndDesktop
=
NULL
;
static
WND
*
pWndDesktop
=
NULL
;
...
@@ -387,6 +397,7 @@ BOOL32 WIN_CreateDesktopWindow(void)
...
@@ -387,6 +397,7 @@ BOOL32 WIN_CreateDesktopWindow(void)
{
{
CLASS
*
class
;
CLASS
*
class
;
HWND32
hwndDesktop
;
HWND32
hwndDesktop
;
DESKTOP
*
pDesktop
;
TRACE
(
win
,
"Creating desktop window
\n
"
);
TRACE
(
win
,
"Creating desktop window
\n
"
);
...
@@ -399,7 +410,16 @@ BOOL32 WIN_CreateDesktopWindow(void)
...
@@ -399,7 +410,16 @@ BOOL32 WIN_CreateDesktopWindow(void)
if
(
!
hwndDesktop
)
return
FALSE
;
if
(
!
hwndDesktop
)
return
FALSE
;
pWndDesktop
=
(
WND
*
)
USER_HEAP_LIN_ADDR
(
hwndDesktop
);
pWndDesktop
=
(
WND
*
)
USER_HEAP_LIN_ADDR
(
hwndDesktop
);
pDesktop
=
(
DESKTOP
*
)
pWndDesktop
->
wExtra
;
#ifndef X_DISPLAY_MISSING
pDesktop
->
pDriver
=
&
X11DRV_DESKTOP_Driver
;
pWndDesktop
->
pDriver
=
&
X11DRV_WND_Driver
;
pWndDesktop
->
pDriver
=
&
X11DRV_WND_Driver
;
#else
/* X_DISPLAY_MISSING */
pDesktop
->
pDriver
=
&
TTYDRV_DESKTOP_Driver
;
pWndDesktop
->
pDriver
=
&
TTYDRV_WND_Driver
;
#endif
/* X_DISPLAY_MISSING */
pDesktop
->
pDriver
->
pInitialize
(
pDesktop
);
pWndDesktop
->
pDriver
->
pInitialize
(
pWndDesktop
);
pWndDesktop
->
pDriver
->
pInitialize
(
pWndDesktop
);
pWndDesktop
->
next
=
NULL
;
pWndDesktop
->
next
=
NULL
;
...
...
windows/winpos.c
View file @
8d8703cb
...
@@ -5,6 +5,8 @@
...
@@ -5,6 +5,8 @@
* 1995, 1996 Alex Korobka
* 1995, 1996 Alex Korobka
*/
*/
#include "x11drv.h"
#include <string.h>
#include <string.h>
#include "sysmetrics.h"
#include "sysmetrics.h"
#include "heap.h"
#include "heap.h"
...
@@ -20,7 +22,8 @@
...
@@ -20,7 +22,8 @@
#include "dce.h"
#include "dce.h"
#include "nonclient.h"
#include "nonclient.h"
#include "debug.h"
#include "debug.h"
#include "x11drv.h"
#include "local.h"
#include "ldt.h"
#define HAS_DLGFRAME(style,exStyle) \
#define HAS_DLGFRAME(style,exStyle) \
(((exStyle) & WS_EX_DLGMODALFRAME) || \
(((exStyle) & WS_EX_DLGMODALFRAME) || \
...
@@ -2120,7 +2123,7 @@ BOOL32 WINAPI SetWindowPos32( HWND32 hwnd, HWND32 hwndInsertAfter,
...
@@ -2120,7 +2123,7 @@ BOOL32 WINAPI SetWindowPos32( HWND32 hwnd, HWND32 hwndInsertAfter,
if
(
wnd
->
next
==
wndPtr
)
flags
|=
SWP_NOZORDER
;
if
(
wnd
->
next
==
wndPtr
)
flags
|=
SWP_NOZORDER
;
}
}
}
}
else
if
(
!
((
X11DRV_WND_DATA
*
)
wndPtr
->
pDriverData
)
->
window
)
else
if
(
!
X11DRV_WND_GetXWindow
(
wndPtr
)
)
{
{
/* FIXME: the following optimization is no good for "X-ed" windows */
/* FIXME: the following optimization is no good for "X-ed" windows */
if
(
hwndInsertAfter
==
HWND_TOP
)
if
(
hwndInsertAfter
==
HWND_TOP
)
...
@@ -2177,21 +2180,21 @@ BOOL32 WINAPI SetWindowPos32( HWND32 hwnd, HWND32 hwndInsertAfter,
...
@@ -2177,21 +2180,21 @@ BOOL32 WINAPI SetWindowPos32( HWND32 hwnd, HWND32 hwndInsertAfter,
if
(
wndPtr
->
parent
==
WIN_GetDesktop
()
)
if
(
wndPtr
->
parent
==
WIN_GetDesktop
()
)
hwndInsertAfter
=
WINPOS_ReorderOwnedPopups
(
hwndInsertAfter
,
hwndInsertAfter
=
WINPOS_ReorderOwnedPopups
(
hwndInsertAfter
,
wndPtr
,
winpos
.
flags
);
wndPtr
,
winpos
.
flags
);
if
(
X11DRV_WND_GetXWindow
(
wndPtr
))
if
(((
X11DRV_WND_DATA
*
)
wndPtr
->
pDriverData
)
->
window
)
{
{
WIN_UnlinkWindow
(
winpos
.
hwnd
);
WIN_UnlinkWindow
(
winpos
.
hwnd
);
WIN_LinkWindow
(
winpos
.
hwnd
,
hwndInsertAfter
);
WIN_LinkWindow
(
winpos
.
hwnd
,
hwndInsertAfter
);
}
}
else
WINPOS_MoveWindowZOrder
(
winpos
.
hwnd
,
hwndInsertAfter
);
else
WINPOS_MoveWindowZOrder
(
winpos
.
hwnd
,
hwndInsertAfter
);
}
}
if
(
!
((
X11DRV_WND_DATA
*
)
wndPtr
->
pDriverData
)
->
window
&&
!
(
winpos
.
flags
&
SWP_NOREDRAW
)
&&
if
(
!
X11DRV_WND_GetXWindow
(
wndPtr
)
&&
!
(
winpos
.
flags
&
SWP_NOREDRAW
)
&&
((
winpos
.
flags
&
(
SWP_NOMOVE
|
SWP_NOSIZE
|
SWP_FRAMECHANGED
))
((
winpos
.
flags
&
(
SWP_NOMOVE
|
SWP_NOSIZE
|
SWP_FRAMECHANGED
))
!=
(
SWP_NOMOVE
|
SWP_NOSIZE
))
)
!=
(
SWP_NOMOVE
|
SWP_NOSIZE
))
)
visRgn
=
DCE_GetVisRgn
(
hwnd
,
DCX_WINDOW
|
DCX_CLIPSIBLINGS
);
visRgn
=
DCE_GetVisRgn
(
hwnd
,
DCX_WINDOW
|
DCX_CLIPSIBLINGS
);
/* Send WM_NCCALCSIZE message to get new client area */
/* Send WM_NCCALCSIZE message to get new client area */
if
(
(
winpos
.
flags
&
(
SWP_FRAMECHANGED
|
SWP_NOSIZE
))
!=
SWP_NOSIZE
)
if
(
(
winpos
.
flags
&
(
SWP_FRAMECHANGED
|
SWP_NOSIZE
))
!=
SWP_NOSIZE
)
{
{
...
@@ -2234,7 +2237,7 @@ BOOL32 WINAPI SetWindowPos32( HWND32 hwnd, HWND32 hwndInsertAfter,
...
@@ -2234,7 +2237,7 @@ BOOL32 WINAPI SetWindowPos32( HWND32 hwnd, HWND32 hwndInsertAfter,
oldWindowRect
=
wndPtr
->
rectWindow
;
oldWindowRect
=
wndPtr
->
rectWindow
;
if
(
((
X11DRV_WND_DATA
*
)
wndPtr
->
pDriverData
)
->
window
)
if
(
X11DRV_WND_GetXWindow
(
wndPtr
)
)
{
{
RECT32
oldClientRect
=
wndPtr
->
rectClient
;
RECT32
oldClientRect
=
wndPtr
->
rectClient
;
...
@@ -2337,7 +2340,7 @@ BOOL32 WINAPI SetWindowPos32( HWND32 hwnd, HWND32 hwndInsertAfter,
...
@@ -2337,7 +2340,7 @@ BOOL32 WINAPI SetWindowPos32( HWND32 hwnd, HWND32 hwndInsertAfter,
if
(
flags
&
SWP_SHOWWINDOW
)
if
(
flags
&
SWP_SHOWWINDOW
)
{
{
wndPtr
->
dwStyle
|=
WS_VISIBLE
;
wndPtr
->
dwStyle
|=
WS_VISIBLE
;
if
(
((
X11DRV_WND_DATA
*
)
wndPtr
->
pDriverData
)
->
window
)
if
(
X11DRV_WND_GetXWindow
(
wndPtr
)
)
{
{
HWND32
focus
,
curr
;
HWND32
focus
,
curr
;
...
@@ -2371,8 +2374,7 @@ BOOL32 WINAPI SetWindowPos32( HWND32 hwnd, HWND32 hwndInsertAfter,
...
@@ -2371,8 +2374,7 @@ BOOL32 WINAPI SetWindowPos32( HWND32 hwnd, HWND32 hwndInsertAfter,
else
if
(
flags
&
SWP_HIDEWINDOW
)
else
if
(
flags
&
SWP_HIDEWINDOW
)
{
{
wndPtr
->
dwStyle
&=
~
WS_VISIBLE
;
wndPtr
->
dwStyle
&=
~
WS_VISIBLE
;
if
(
X11DRV_WND_GetXWindow
(
wndPtr
))
if
(((
X11DRV_WND_DATA
*
)
wndPtr
->
pDriverData
)
->
window
)
{
{
wndPtr
->
pDriver
->
pSetWindowPos
(
wndPtr
,
&
winpos
,
uFlags
&
SMC_SETXPOS
);
wndPtr
->
pDriver
->
pSetWindowPos
(
wndPtr
,
&
winpos
,
uFlags
&
SMC_SETXPOS
);
if
(
uFlags
&
SMC_SETXPOS
)
if
(
uFlags
&
SMC_SETXPOS
)
...
@@ -2402,7 +2404,7 @@ BOOL32 WINAPI SetWindowPos32( HWND32 hwnd, HWND32 hwndInsertAfter,
...
@@ -2402,7 +2404,7 @@ BOOL32 WINAPI SetWindowPos32( HWND32 hwnd, HWND32 hwndInsertAfter,
/* Repaint the window */
/* Repaint the window */
if
(
((
X11DRV_WND_DATA
*
)
wndPtr
->
pDriverData
)
->
window
)
if
(
X11DRV_WND_GetXWindow
(
wndPtr
)
)
EVENT_Synchronize
();
/* Wait for all expose events */
EVENT_Synchronize
();
/* Wait for all expose events */
if
(
!
GetCapture32
())
if
(
!
GetCapture32
())
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment