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
5cab46ee
Commit
5cab46ee
authored
May 02, 2002
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleaned up some inter-dll dependencies in palette management.
parent
7200ca98
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
39 additions
and
99 deletions
+39
-99
dc.c
dlls/ttydrv/dc.c
+0
-9
palette.c
dlls/ttydrv/palette.c
+0
-38
ttydrv.h
dlls/ttydrv/ttydrv.h
+0
-5
brush.c
graphics/x11drv/brush.c
+1
-1
palette.c
graphics/x11drv/palette.c
+30
-5
color.h
include/color.h
+0
-2
color.c
objects/color.c
+0
-29
palette.c
objects/palette.c
+7
-9
cursoricon.c
windows/cursoricon.c
+1
-1
No files found.
dlls/ttydrv/dc.c
View file @
5cab46ee
...
...
@@ -31,13 +31,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(ttydrv);
/**********************************************************************/
PALETTE_DRIVER
TTYDRV_PALETTE_Driver
=
{
TTYDRV_PALETTE_SetMapping
,
TTYDRV_PALETTE_UpdateMapping
,
TTYDRV_PALETTE_IsDark
};
const
DC_FUNCTIONS
*
TTYDRV_DC_Funcs
=
NULL
;
/* hack */
/**********************************************************************
...
...
@@ -45,8 +38,6 @@ const DC_FUNCTIONS *TTYDRV_DC_Funcs = NULL; /* hack */
*/
BOOL
TTYDRV_GDI_Initialize
(
void
)
{
PALETTE_Driver
=
&
TTYDRV_PALETTE_Driver
;
return
TTYDRV_PALETTE_Initialize
();
}
...
...
dlls/ttydrv/palette.c
View file @
5cab46ee
...
...
@@ -33,10 +33,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(ttydrv);
/**********************************************************************/
extern
PALETTEENTRY
*
COLOR_sysPal
;
extern
int
COLOR_gapStart
;
extern
int
COLOR_gapEnd
;
extern
int
COLOR_gapFilled
;
extern
int
COLOR_max
;
static
int
palette_size
=
256
;
/* FIXME */
...
...
@@ -83,39 +79,5 @@ BOOL TTYDRV_PALETTE_Initialize(void)
}
}
COLOR_gapStart
=
NB_RESERVED_COLORS
/
2
;
COLOR_gapEnd
=
NB_RESERVED_COLORS
/
2
;
return
TRUE
;
}
/***********************************************************************
* TTYDRV_PALETTE_SetMapping
*/
int
TTYDRV_PALETTE_SetMapping
(
PALETTEOBJ
*
palPtr
,
UINT
uStart
,
UINT
uNum
,
BOOL
mapOnly
)
{
FIXME
(
"(%p, %u, %u, %d): stub
\n
"
,
palPtr
,
uStart
,
uNum
,
mapOnly
);
return
0
;
}
/***********************************************************************
* TTYDRV_PALETTE_UpdateMapping
*/
int
TTYDRV_PALETTE_UpdateMapping
(
PALETTEOBJ
*
palPtr
)
{
TRACE
(
"(%p)
\n
"
,
palPtr
);
return
0
;
}
/***********************************************************************
* TTYDRV_PALETTE_IsDark
*/
int
TTYDRV_PALETTE_IsDark
(
int
pixel
)
{
FIXME
(
"(%d): stub
\n
"
,
pixel
);
return
0
;
}
dlls/ttydrv/ttydrv.h
View file @
5cab46ee
...
...
@@ -113,12 +113,7 @@ INT TTYDRV_DC_SetDIBitsToDevice(TTYDRV_PDEVICE *physDev, INT xDest, INT yDest, D
/* TTY GDI palette driver */
extern
struct
tagPALETTE_DRIVER
TTYDRV_PALETTE_Driver
;
extern
BOOL
TTYDRV_PALETTE_Initialize
(
void
);
extern
int
TTYDRV_PALETTE_SetMapping
(
struct
tagPALETTEOBJ
*
palPtr
,
UINT
uStart
,
UINT
uNum
,
BOOL
mapOnly
);
extern
int
TTYDRV_PALETTE_UpdateMapping
(
struct
tagPALETTEOBJ
*
palPtr
);
extern
BOOL
TTYDRV_PALETTE_IsDark
(
int
pixel
);
/**************************************************************************
* TTY USER driver
...
...
graphics/x11drv/brush.c
View file @
5cab46ee
...
...
@@ -158,7 +158,7 @@ static void BRUSH_SelectSolidBrush( X11DRV_PDEVICE *physDev, COLORREF color )
{
DC
*
dc
=
physDev
->
dc
;
if
((
dc
->
bitsPerPixel
>
1
)
&&
(
screen_depth
<=
8
)
&&
!
COLOR_IsSolid
(
color
))
if
((
dc
->
bitsPerPixel
>
1
)
&&
(
screen_depth
<=
8
)
&&
!
X11DRV_IsSolidColor
(
color
))
{
/* Dithered brush */
physDev
->
brush
.
pixmap
=
BRUSH_DitherColor
(
dc
,
color
);
...
...
graphics/x11drv/palette.c
View file @
5cab46ee
...
...
@@ -53,12 +53,12 @@ WINE_DEFAULT_DEBUG_CHANNEL(palette);
*/
extern
PALETTEENTRY
*
COLOR_sysPal
;
extern
int
COLOR_gapStart
;
extern
int
COLOR_gapEnd
;
extern
int
COLOR_gapFilled
;
extern
int
COLOR_max
;
extern
const
PALETTEENTRY
COLOR_sysPalTemplate
[
NB_RESERVED_COLORS
];
extern
const
PALETTEENTRY
COLOR_sysPalTemplate
[
NB_RESERVED_COLORS
];
static
int
COLOR_gapStart
=
256
;
static
int
COLOR_gapEnd
=
-
1
;
static
int
COLOR_gapFilled
=
0
;
static
int
COLOR_max
=
256
;
Colormap
X11DRV_PALETTE_PaletteXColormap
=
0
;
UINT16
X11DRV_PALETTE_PaletteFlags
=
0
;
...
...
@@ -714,6 +714,31 @@ static void X11DRV_PALETTE_FillDefaultColors(void)
/***********************************************************************
* X11DRV_IsSolidColor
*
* Check whether 'color' can be represented with a solid color.
*/
BOOL
X11DRV_IsSolidColor
(
COLORREF
color
)
{
int
i
;
const
PALETTEENTRY
*
pEntry
=
COLOR_sysPal
;
if
(
color
&
0xff000000
)
return
TRUE
;
/* indexed color */
if
(
!
color
||
(
color
==
0xffffff
))
return
TRUE
;
/* black or white */
for
(
i
=
0
;
i
<
256
;
i
++
,
pEntry
++
)
{
if
(
i
<
COLOR_gapStart
||
i
>
COLOR_gapEnd
)
if
((
GetRValue
(
color
)
==
pEntry
->
peRed
)
&&
(
GetGValue
(
color
)
==
pEntry
->
peGreen
)
&&
(
GetBValue
(
color
)
==
pEntry
->
peBlue
))
return
TRUE
;
}
return
FALSE
;
}
/***********************************************************************
* X11DRV_PALETTE_ToLogical
*
* Return RGB color for given X pixel.
...
...
include/color.h
View file @
5cab46ee
...
...
@@ -28,8 +28,6 @@
#define PC_SYS_RESERVED 0x40
/* system palentry is not to be mapped to */
#define PC_SYS_MAPPED 0x10
/* logical palentry is a direct alias for system palentry */
extern
BOOL
COLOR_IsSolid
(
COLORREF
color
);
extern
COLORREF
COLOR_GetSystemPaletteEntry
(
UINT
);
extern
const
PALETTEENTRY
*
COLOR_GetSystemPaletteTemplate
(
void
);
...
...
objects/color.c
View file @
5cab46ee
...
...
@@ -37,11 +37,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(palette);
PALETTEENTRY
*
COLOR_sysPal
=
NULL
;
/* current system palette */
int
COLOR_gapStart
=
256
;
int
COLOR_gapEnd
=
-
1
;
int
COLOR_gapFilled
=
0
;
int
COLOR_max
=
256
;
const
PALETTEENTRY
COLOR_sysPalTemplate
[
NB_RESERVED_COLORS
]
=
{
/* first 10 entries in the system palette */
...
...
@@ -93,30 +88,6 @@ COLORREF COLOR_GetSystemPaletteEntry(UINT i)
}
/***********************************************************************
* COLOR_IsSolid
*
* Check whether 'color' can be represented with a solid color.
*/
BOOL
COLOR_IsSolid
(
COLORREF
color
)
{
int
i
;
const
PALETTEENTRY
*
pEntry
=
COLOR_sysPal
;
if
(
color
&
0xff000000
)
return
TRUE
;
/* indexed color */
if
(
!
color
||
(
color
==
0xffffff
))
return
TRUE
;
/* black or white */
for
(
i
=
0
;
i
<
256
;
i
++
,
pEntry
++
)
{
if
(
i
<
COLOR_gapStart
||
i
>
COLOR_gapEnd
)
if
((
GetRValue
(
color
)
==
pEntry
->
peRed
)
&&
(
GetGValue
(
color
)
==
pEntry
->
peGreen
)
&&
(
GetBValue
(
color
)
==
pEntry
->
peBlue
))
return
TRUE
;
}
return
FALSE
;
}
/***********************************************************************
* COLOR_PaletteLookupPixel
*/
int
COLOR_PaletteLookupPixel
(
PALETTEENTRY
*
palPalEntry
,
int
size
,
...
...
objects/palette.c
View file @
5cab46ee
...
...
@@ -466,9 +466,8 @@ BOOL WINAPI AnimatePalette(
UINT
u
;
for
(
u
=
0
;
u
<
NumEntries
;
u
++
)
palPtr
->
logpalette
.
palPalEntry
[
u
+
StartIndex
]
=
PaletteColors
[
u
];
PALETTE_Driver
->
pSetMapping
(
palPtr
,
StartIndex
,
NumEntries
,
hPal
!=
hPrimaryPalette
);
if
(
PALETTE_Driver
)
PALETTE_Driver
->
pSetMapping
(
palPtr
,
StartIndex
,
NumEntries
,
hPal
!=
hPrimaryPalette
);
GDI_ReleaseObj
(
hPal
);
return
TRUE
;
}
...
...
@@ -746,11 +745,10 @@ UINT16 WINAPI GDIRealizePalette16( HDC16 hdc )
FIXME
(
"invalid selected palette %04x
\n
"
,
dc
->
hPalette
);
return
0
;
}
realized
=
PALETTE_Driver
->
pSetMapping
(
palPtr
,
0
,
palPtr
->
logpalette
.
palNumEntries
,
(
dc
->
hPalette
!=
hPrimaryPalette
)
||
(
dc
->
hPalette
==
GetStockObject
(
DEFAULT_PALETTE
)));
if
(
PALETTE_Driver
)
realized
=
PALETTE_Driver
->
pSetMapping
(
palPtr
,
0
,
palPtr
->
logpalette
.
palNumEntries
,
(
dc
->
hPalette
!=
hPrimaryPalette
)
||
(
dc
->
hPalette
==
GetStockObject
(
DEFAULT_PALETTE
)));
hLastRealizedPalette
=
dc
->
hPalette
;
GDI_ReleaseObj
(
dc
->
hPalette
);
}
...
...
@@ -782,7 +780,7 @@ UINT16 WINAPI RealizeDefaultPalette16( HDC16 hdc )
if
(
palPtr
)
{
/* lookup is needed to account for SetSystemPaletteUse() stuff */
ret
=
PALETTE_Driver
->
pUpdateMapping
(
palPtr
);
if
(
PALETTE_Driver
)
ret
=
PALETTE_Driver
->
pUpdateMapping
(
palPtr
);
GDI_ReleaseObj
(
GetStockObject
(
DEFAULT_PALETTE
)
);
}
}
...
...
windows/cursoricon.c
View file @
5cab46ee
...
...
@@ -1027,7 +1027,7 @@ HCURSOR16 CURSORICON_IconToCursor(HICON16 hIcon, BOOL bSemiTransparent)
unsigned
*
psc
=
(
unsigned
*
)(
psPtr
+
(
ix
*
bpp
)
/
8
);
unsigned
val
=
((
*
psc
)
>>
(
ix
*
bpp
)
%
8
)
&
val_base
;
if
(
!
PALETTE_Driver
->
pIsDark
(
val
))
if
(
PALETTE_Driver
&&
!
PALETTE_Driver
->
pIsDark
(
val
))
{
pbc
=
pxbPtr
+
ix
/
8
;
*
pbc
|=
0x80
>>
(
ix
%
8
);
...
...
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