Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
a38d84d8
Commit
a38d84d8
authored
Nov 30, 1998
by
Huw D M Davies
Committed by
Alexandre Julliard
Nov 30, 1998
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
GetSystemPaletteEntries returns palette size if entries==NULL.
Use this instead of COLOR_GetSystemPaletteSize.
parent
1ff1f7d1
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
14 deletions
+30
-14
bitmap.c
objects/bitmap.c
+14
-10
cursoricon.c
objects/cursoricon.c
+15
-3
dib.c
objects/dib.c
+0
-1
palette.c
objects/palette.c
+1
-0
No files found.
objects/bitmap.c
View file @
a38d84d8
...
...
@@ -14,7 +14,6 @@
#include "global.h"
#include "sysmetrics.h"
#include "cursoricon.h"
#include "color.h"
#include "debug.h"
#include "x11drv.h"
...
...
@@ -464,15 +463,12 @@ HANDLE32 WINAPI LoadImage32W( HINSTANCE32 hinst, LPCWSTR name, UINT32 type,
{
if
(
HIWORD
(
name
))
{
TRACE
(
resource
,
"(0x%04x,%p,%d,%d,%d,0x%08x)
\n
"
,
hinst
,
name
,
type
,
desiredx
,
desiredy
,
loadflags
);
hinst
,
name
,
type
,
desiredx
,
desiredy
,
loadflags
);
}
else
{
TRACE
(
resource
,
"(0x%04x,%p,%d,%d,%d,0x%08x)
\n
"
,
hinst
,
name
,
type
,
desiredx
,
desiredy
,
loadflags
);
hinst
,
name
,
type
,
desiredx
,
desiredy
,
loadflags
);
}
if
(
loadflags
&
LR_DEFAULTSIZE
)
{
if
(
loadflags
&
LR_DEFAULTSIZE
)
{
if
(
type
==
IMAGE_ICON
)
{
if
(
!
desiredx
)
desiredx
=
SYSMETRICS_CXICON
;
if
(
!
desiredy
)
desiredy
=
SYSMETRICS_CYICON
;
...
...
@@ -485,12 +481,20 @@ HANDLE32 WINAPI LoadImage32W( HINSTANCE32 hinst, LPCWSTR name, UINT32 type,
switch
(
type
)
{
case
IMAGE_BITMAP
:
return
BITMAP_LoadBitmap32W
(
hinst
,
name
,
loadflags
);
case
IMAGE_ICON
:
{
HDC32
hdc
=
GetDC32
(
0
);
UINT32
palEnts
=
GetSystemPaletteEntries32
(
hdc
,
0
,
0
,
NULL
);
ReleaseDC32
(
0
,
hdc
);
return
CURSORICON_Load32
(
hinst
,
name
,
desiredx
,
desiredy
,
MIN
(
16
,
COLOR_GetSystemPaletteSize
()),
FALSE
,
loadflags
);
MIN
(
16
,
palEnts
),
FALSE
,
loadflags
);
}
case
IMAGE_CURSOR
:
return
CURSORICON_Load32
(
hinst
,
name
,
desiredx
,
desiredy
,
1
,
TRUE
,
loadflags
);
return
CURSORICON_Load32
(
hinst
,
name
,
desiredx
,
desiredy
,
1
,
TRUE
,
loadflags
);
}
return
0
;
}
...
...
objects/cursoricon.c
View file @
a38d84d8
...
...
@@ -833,6 +833,10 @@ HCURSOR16 WINAPI LoadCursor16( HINSTANCE16 hInstance, SEGPTR name )
*/
HICON16
WINAPI
LoadIcon16
(
HINSTANCE16
hInstance
,
SEGPTR
name
)
{
HDC32
hdc
=
GetDC32
(
0
);
UINT32
palEnts
=
GetSystemPaletteEntries32
(
hdc
,
0
,
0
,
NULL
);
ReleaseDC32
(
0
,
hdc
);
if
(
HIWORD
(
name
))
TRACE
(
icon
,
"%04x '%s'
\n
"
,
hInstance
,
(
char
*
)
PTR_SEG_TO_LIN
(
name
)
);
...
...
@@ -842,7 +846,7 @@ HICON16 WINAPI LoadIcon16( HINSTANCE16 hInstance, SEGPTR name )
return
CURSORICON_Load16
(
hInstance
,
name
,
SYSMETRICS_CXICON
,
SYSMETRICS_CYICON
,
MIN
(
16
,
COLOR_GetSystemPaletteSize
()
),
FALSE
,
0
);
MIN
(
16
,
palEnts
),
FALSE
,
0
);
}
...
...
@@ -1294,7 +1298,11 @@ INT16 WINAPI LookupIconIdFromDirectoryEx16( LPBYTE xdir, BOOL16 bIcon,
UINT16
retVal
=
0
;
if
(
dir
&&
!
dir
->
idReserved
&&
(
dir
->
idType
&
3
)
)
{
int
colors
=
(
cFlag
&
LR_MONOCHROME
)
?
2
:
COLOR_GetSystemPaletteSize
();
HDC32
hdc
=
GetDC32
(
0
);
UINT32
palEnts
=
GetSystemPaletteEntries32
(
hdc
,
0
,
0
,
NULL
);
int
colors
=
(
cFlag
&
LR_MONOCHROME
)
?
2
:
palEnts
;
ReleaseDC32
(
0
,
hdc
);
if
(
bIcon
)
{
ICONDIRENTRY
*
entry
;
...
...
@@ -1484,9 +1492,13 @@ HCURSOR32 WINAPI LoadCursorFromFile32A (LPCSTR name)
*/
HICON32
WINAPI
LoadIcon32W
(
HINSTANCE32
hInstance
,
LPCWSTR
name
)
{
HDC32
hdc
=
GetDC32
(
0
);
UINT32
palEnts
=
GetSystemPaletteEntries32
(
hdc
,
0
,
0
,
NULL
);
ReleaseDC32
(
0
,
hdc
);
return
CURSORICON_Load32
(
hInstance
,
name
,
SYSMETRICS_CXICON
,
SYSMETRICS_CYICON
,
MIN
(
16
,
COLOR_GetSystemPaletteSize
()
),
FALSE
,
0
);
MIN
(
16
,
palEnts
),
FALSE
,
0
);
}
/***********************************************************************
...
...
objects/dib.c
View file @
a38d84d8
...
...
@@ -11,7 +11,6 @@
#include "bitmap.h"
#include "callback.h"
#include "palette.h"
#include "color.h"
#include "global.h"
#include "debug.h"
#include "x11drv.h"
...
...
objects/palette.c
View file @
a38d84d8
...
...
@@ -421,6 +421,7 @@ UINT32 WINAPI GetSystemPaletteEntries32(
TRACE
(
palette
,
"hdc=%04x,start=%i,count=%i
\n
"
,
hdc
,
start
,
count
);
if
(
!
(
dc
=
(
DC
*
)
GDI_GetObjPtr
(
hdc
,
DC_MAGIC
)))
return
0
;
if
(
!
entries
)
return
COLOR_GetSystemPaletteSize
();
if
(
start
>=
dc
->
w
.
devCaps
->
sizePalette
)
{
GDI_HEAP_UNLOCK
(
hdc
);
...
...
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