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
70e192b9
Commit
70e192b9
authored
Jun 02, 2002
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed CURSORICON_IconToCursor now that we support color cursors.
parent
36ed03e2
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
18 additions
and
124 deletions
+18
-124
mouse.c
dlls/x11drv/mouse.c
+13
-1
winpos.c
dlls/x11drv/winpos.c
+2
-4
cursoricon.h
include/cursoricon.h
+0
-3
cursoricon.c
windows/cursoricon.c
+0
-96
win.c
windows/win.c
+3
-20
No files found.
dlls/x11drv/mouse.c
View file @
70e192b9
...
...
@@ -348,6 +348,8 @@ Cursor X11DRV_GetCursor( Display *display, CURSORICONINFO *ptr )
if
(
pixmapBits
&&
pixmapMask
&&
pixmapMaskInv
)
{
POINT
hotspot
;
/* We have to do some magic here, as cursors are not fully
* compatible between Windows and X11. Under X11, there
* are only 3 possible color cursor: black, white and
...
...
@@ -393,8 +395,18 @@ Cursor X11DRV_GetCursor( Display *display, CURSORICONINFO *ptr )
XCopyArea
(
display
,
pixmapMaskInv
,
pixmapBits
,
gc
,
0
,
0
,
ptr
->
nWidth
,
ptr
->
nHeight
,
1
,
1
);
XSetFunction
(
display
,
gc
,
GXcopy
);
/* Make sure hotspot is valid */
hotspot
.
x
=
ptr
->
ptHotSpot
.
x
;
hotspot
.
y
=
ptr
->
ptHotSpot
.
y
;
if
(
hotspot
.
x
<
0
||
hotspot
.
x
>=
ptr
->
nWidth
||
hotspot
.
y
<
0
||
hotspot
.
y
>=
ptr
->
nHeight
)
{
hotspot
.
x
=
ptr
->
nWidth
/
2
;
hotspot
.
y
=
ptr
->
nHeight
/
2
;
}
cursor
=
XCreatePixmapCursor
(
display
,
pixmapBits
,
pixmapMask
,
&
fg
,
&
bg
,
ptr
->
ptHotSpot
.
x
,
ptr
->
ptHotS
pot
.
y
);
&
fg
,
&
bg
,
hotspot
.
x
,
hots
pot
.
y
);
}
/* Now free everything */
...
...
dlls/x11drv/winpos.c
View file @
70e192b9
...
...
@@ -1877,9 +1877,8 @@ void X11DRV_SysCommandSizeMove( HWND hwnd, WPARAM wParam )
if
(
iconic
)
/* create a cursor for dragging */
{
HICON
hIcon
=
GetClassLongA
(
hwnd
,
GCL_HICON
);
if
(
!
hIcon
)
hIcon
=
(
HICON
)
SendMessageA
(
hwnd
,
WM_QUERYDRAGICON
,
0
,
0L
);
if
(
hIcon
)
hDragCursor
=
CURSORICON_IconToCursor
(
hIcon
,
TRUE
);
hDragCursor
=
GetClassLongA
(
hwnd
,
GCL_HICON
);
if
(
!
hDragCursor
)
hDragCursor
=
(
HCURSOR
)
SendMessageA
(
hwnd
,
WM_QUERYDRAGICON
,
0
,
0L
);
if
(
!
hDragCursor
)
iconic
=
FALSE
;
}
...
...
@@ -2005,7 +2004,6 @@ void X11DRV_SysCommandSizeMove( HWND hwnd, WPARAM wParam )
ShowCursor
(
FALSE
);
SetCursor
(
hOldCursor
);
}
DestroyCursor
(
hDragCursor
);
}
else
if
(
moved
&&
!
DragFullWindows
)
draw_moving_frame
(
hdc
,
&
sizingRect
,
thickframe
);
...
...
include/cursoricon.h
View file @
70e192b9
...
...
@@ -84,9 +84,6 @@ typedef struct
#define CID_WIN32 0x0004
#define CID_NONSHARED 0x0008
extern
HCURSOR16
CURSORICON_IconToCursor
(
HICON16
hIcon
,
BOOL
bSemiTransparent
);
extern
HGLOBAL
CURSORICON_Load
(
HINSTANCE
hInstance
,
LPCWSTR
name
,
int
width
,
int
height
,
int
colors
,
BOOL
fCursor
,
UINT
loadflags
);
...
...
windows/cursoricon.c
View file @
70e192b9
...
...
@@ -51,7 +51,6 @@
#include "wine/winbase16.h"
#include "wine/winuser16.h"
#include "wine/exception.h"
#include "palette.h"
#include "bitmap.h"
#include "cursoricon.h"
#include "module.h"
...
...
@@ -955,101 +954,6 @@ HGLOBAL CURSORICON_ExtCopy(HGLOBAL Handle, UINT nType,
return
hNew
;
}
/***********************************************************************
* CURSORICON_IconToCursor
*
* Converts bitmap to mono and truncates if icon is too large (should
* probably do StretchBlt() instead).
*/
HCURSOR16
CURSORICON_IconToCursor
(
HICON16
hIcon
,
BOOL
bSemiTransparent
)
{
HCURSOR16
hRet
=
0
;
CURSORICONINFO
*
pIcon
=
NULL
;
if
(
hIcon
)
if
(
!
(
pIcon
=
(
CURSORICONINFO
*
)
GlobalLock16
(
hIcon
)))
return
FALSE
;
if
(
pIcon
->
bPlanes
*
pIcon
->
bBitsPerPixel
==
1
)
{
hRet
=
CURSORICON_Copy
(
0
,
hIcon
);
pIcon
=
GlobalLock16
(
hRet
);
pIcon
->
ptHotSpot
.
x
=
pIcon
->
ptHotSpot
.
y
=
15
;
GlobalUnlock16
(
hRet
);
}
else
{
BYTE
pAndBits
[
128
];
BYTE
pXorBits
[
128
];
int
maxx
,
maxy
,
ix
,
iy
,
bpp
=
pIcon
->
bBitsPerPixel
;
BYTE
*
psPtr
,
*
pxbPtr
=
pXorBits
;
unsigned
xor_width
,
and_width
,
val_base
=
0xffffffff
>>
(
32
-
bpp
);
BYTE
*
pbc
=
NULL
;
CURSORICONINFO
cI
;
TRACE_
(
icon
)(
"[%04x] %ix%i %ibpp (bogus %ibps)
\n
"
,
hIcon
,
pIcon
->
nWidth
,
pIcon
->
nHeight
,
pIcon
->
bBitsPerPixel
,
pIcon
->
nWidthBytes
);
xor_width
=
BITMAP_GetWidthBytes
(
pIcon
->
nWidth
,
bpp
);
and_width
=
BITMAP_GetWidthBytes
(
pIcon
->
nWidth
,
1
);
psPtr
=
(
BYTE
*
)(
pIcon
+
1
)
+
pIcon
->
nHeight
*
and_width
;
memset
(
pXorBits
,
0
,
128
);
cI
.
bBitsPerPixel
=
1
;
cI
.
bPlanes
=
1
;
cI
.
ptHotSpot
.
x
=
cI
.
ptHotSpot
.
y
=
15
;
cI
.
nWidth
=
32
;
cI
.
nHeight
=
32
;
cI
.
nWidthBytes
=
4
;
/* 32x1bpp */
maxx
=
(
pIcon
->
nWidth
>
32
)
?
32
:
pIcon
->
nWidth
;
maxy
=
(
pIcon
->
nHeight
>
32
)
?
32
:
pIcon
->
nHeight
;
for
(
iy
=
0
;
iy
<
maxy
;
iy
++
)
{
unsigned
shift
=
iy
%
2
;
memcpy
(
pAndBits
+
iy
*
4
,
(
BYTE
*
)(
pIcon
+
1
)
+
iy
*
and_width
,
(
and_width
>
4
)
?
4
:
and_width
);
for
(
ix
=
0
;
ix
<
maxx
;
ix
++
)
{
if
(
bSemiTransparent
&&
((
ix
+
shift
)
%
2
)
)
{
/* set AND bit, XOR bit stays 0 */
pbc
=
pAndBits
+
iy
*
4
+
ix
/
8
;
*
pbc
|=
0x80
>>
(
ix
%
8
);
}
else
{
/* keep AND bit, set XOR bit */
unsigned
*
psc
=
(
unsigned
*
)(
psPtr
+
(
ix
*
bpp
)
/
8
);
unsigned
val
=
((
*
psc
)
>>
(
ix
*
bpp
)
%
8
)
&
val_base
;
if
(
PALETTE_Driver
&&
!
PALETTE_Driver
->
pIsDark
(
val
))
{
pbc
=
pxbPtr
+
ix
/
8
;
*
pbc
|=
0x80
>>
(
ix
%
8
);
}
}
}
psPtr
+=
xor_width
;
pxbPtr
+=
4
;
}
hRet
=
CreateCursorIconIndirect16
(
0
,
&
cI
,
pAndBits
,
pXorBits
);
if
(
!
hRet
)
/* fall back on default drag cursor */
hRet
=
CURSORICON_Copy
(
0
,
CURSORICON_Load
(
0
,
MAKEINTRESOURCEW
(
OCR_DRAGOBJECT
),
GetSystemMetrics
(
SM_CXCURSOR
),
GetSystemMetrics
(
SM_CYCURSOR
),
1
,
TRUE
,
0
)
);
}
return
hRet
;
}
/***********************************************************************
* LoadCursor (USER.173)
...
...
windows/win.c
View file @
70e192b9
...
...
@@ -3223,7 +3223,7 @@ DWORD WINAPI DragObject16( HWND16 hwndScope, HWND16 hWnd, UINT16 wObj,
MSG
msg
;
LPDRAGINFO16
lpDragInfo
;
SEGPTR
spDragInfo
;
HCURSOR16
h
DragCursor
=
0
,
h
OldCursor
=
0
,
hBummer
=
0
;
HCURSOR16
hOldCursor
=
0
,
hBummer
=
0
;
HGLOBAL16
hDragInfo
=
GlobalAlloc16
(
GMEM_SHARE
|
GMEM_ZEROINIT
,
2
*
sizeof
(
DRAGINFO16
));
HCURSOR16
hCurrentCursor
=
0
;
HWND16
hCurrentWnd
=
0
;
...
...
@@ -3239,19 +3239,7 @@ DWORD WINAPI DragObject16( HWND16 hwndScope, HWND16 hWnd, UINT16 wObj,
return
0L
;
}
if
(
hCursor
)
{
if
(
!
(
hDragCursor
=
CURSORICON_IconToCursor
(
hCursor
,
FALSE
))
)
{
GlobalFree16
(
hDragInfo
);
return
0L
;
}
if
(
hDragCursor
==
hCursor
)
hDragCursor
=
0
;
else
hCursor
=
hDragCursor
;
hOldCursor
=
SetCursor
(
hDragCursor
);
}
if
(
hCursor
)
hOldCursor
=
SetCursor
(
hCursor
);
lpDragInfo
->
hWnd
=
hWnd
;
lpDragInfo
->
hScope
=
0
;
...
...
@@ -3308,11 +3296,7 @@ DWORD WINAPI DragObject16( HWND16 hwndScope, HWND16 hWnd, UINT16 wObj,
ReleaseCapture
();
ShowCursor
(
FALSE
);
if
(
hCursor
)
{
SetCursor
(
hOldCursor
);
if
(
hDragCursor
)
DestroyCursor
(
hDragCursor
);
}
if
(
hCursor
)
SetCursor
(
hOldCursor
);
if
(
hCurrentCursor
!=
hBummer
)
msg
.
lParam
=
SendMessage16
(
lpDragInfo
->
hScope
,
WM_DROPOBJECT
,
...
...
@@ -3395,4 +3379,3 @@ BOOL WINAPI GetWindowInfo( HWND hwnd, PWINDOWINFO pwi)
WIN_ReleasePtr
(
wndInfo
);
return
TRUE
;
}
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