Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nx-libs
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dimbor
nx-libs
Commits
f8a1f79b
Commit
f8a1f79b
authored
Jul 25, 2019
by
Ulrich Sibiller
Committed by
Mike Gabriel
Sep 29, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Colormap.c: scope improvements
parent
8f609404
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
19 deletions
+9
-19
Colormap.c
nx-X11/programs/Xserver/hw/nxagent/Colormap.c
+9
-19
No files found.
nx-X11/programs/Xserver/hw/nxagent/Colormap.c
View file @
f8a1f79b
...
@@ -187,9 +187,7 @@ static int nxagentCountInstalledColormapWindows(WindowPtr pWin, void * ptr)
...
@@ -187,9 +187,7 @@ static int nxagentCountInstalledColormapWindows(WindowPtr pWin, void * ptr)
{
{
nxagentInstalledColormapWindows
*
icws
=
(
nxagentInstalledColormapWindows
*
)
ptr
;
nxagentInstalledColormapWindows
*
icws
=
(
nxagentInstalledColormapWindows
*
)
ptr
;
int
i
;
for
(
int
i
=
0
;
i
<
icws
->
numCmapIDs
;
i
++
)
for
(
i
=
0
;
i
<
icws
->
numCmapIDs
;
i
++
)
if
(
SEARCH_PREDICATE
)
{
if
(
SEARCH_PREDICATE
)
{
icws
->
numWindows
++
;
icws
->
numWindows
++
;
return
WT_DONTWALKCHILDREN
;
return
WT_DONTWALKCHILDREN
;
...
@@ -201,9 +199,8 @@ static int nxagentCountInstalledColormapWindows(WindowPtr pWin, void * ptr)
...
@@ -201,9 +199,8 @@ static int nxagentCountInstalledColormapWindows(WindowPtr pWin, void * ptr)
static
int
nxagentGetInstalledColormapWindows
(
WindowPtr
pWin
,
void
*
ptr
)
static
int
nxagentGetInstalledColormapWindows
(
WindowPtr
pWin
,
void
*
ptr
)
{
{
nxagentInstalledColormapWindows
*
icws
=
(
nxagentInstalledColormapWindows
*
)
ptr
;
nxagentInstalledColormapWindows
*
icws
=
(
nxagentInstalledColormapWindows
*
)
ptr
;
int
i
;
for
(
i
=
0
;
i
<
icws
->
numCmapIDs
;
i
++
)
for
(
i
nt
i
=
0
;
i
<
icws
->
numCmapIDs
;
i
++
)
if
(
SEARCH_PREDICATE
)
{
if
(
SEARCH_PREDICATE
)
{
icws
->
windows
[
icws
->
index
++
]
=
nxagentWindow
(
pWin
);
icws
->
windows
[
icws
->
index
++
]
=
nxagentWindow
(
pWin
);
return
WT_DONTWALKCHILDREN
;
return
WT_DONTWALKCHILDREN
;
...
@@ -262,10 +259,9 @@ void nxagentSetInstalledColormapWindows(ScreenPtr pScreen)
...
@@ -262,10 +259,9 @@ void nxagentSetInstalledColormapWindows(ScreenPtr pScreen)
#ifdef _XSERVER64
#ifdef _XSERVER64
{
{
int
i
;
Window64
*
windows
=
(
Window64
*
)
malloc
(
numWindows
*
sizeof
(
Window64
));
Window64
*
windows
=
(
Window64
*
)
malloc
(
numWindows
*
sizeof
(
Window64
));
for
(
i
=
0
;
i
<
numWindows
;
++
i
)
for
(
i
nt
i
=
0
;
i
<
numWindows
;
++
i
)
windows
[
i
]
=
icws
.
windows
[
i
];
windows
[
i
]
=
icws
.
windows
[
i
];
XSetWMColormapWindows
(
nxagentDisplay
,
nxagentDefaultWindows
[
pScreen
->
myNum
],
XSetWMColormapWindows
(
nxagentDisplay
,
nxagentDefaultWindows
[
pScreen
->
myNum
],
windows
,
numWindows
);
windows
,
numWindows
);
...
@@ -347,17 +343,14 @@ void nxagentSetScreenSaverColormapWindow(ScreenPtr pScreen)
...
@@ -347,17 +343,14 @@ void nxagentSetScreenSaverColormapWindow(ScreenPtr pScreen)
void
nxagentDirectInstallColormaps
(
ScreenPtr
pScreen
)
void
nxagentDirectInstallColormaps
(
ScreenPtr
pScreen
)
{
{
int
i
,
n
;
Colormap
pCmapIDs
[
MAXCMAPS
];
Colormap
pCmapIDs
[
MAXCMAPS
];
if
(
!
nxagentDoDirectColormaps
)
return
;
if
(
!
nxagentDoDirectColormaps
)
return
;
n
=
(
*
pScreen
->
ListInstalledColormaps
)(
pScreen
,
pCmapIDs
);
int
n
=
(
*
pScreen
->
ListInstalledColormaps
)(
pScreen
,
pCmapIDs
);
for
(
i
=
0
;
i
<
n
;
i
++
)
{
ColormapPtr
pCmap
;
pCmap
=
(
ColormapPtr
)
LookupIDByType
(
pCmapIDs
[
i
],
RT_COLORMAP
);
for
(
int
i
=
0
;
i
<
n
;
i
++
)
{
ColormapPtr
pCmap
=
(
ColormapPtr
)
LookupIDByType
(
pCmapIDs
[
i
],
RT_COLORMAP
);
if
(
pCmap
)
if
(
pCmap
)
XInstallColormap
(
nxagentDisplay
,
nxagentColormap
(
pCmap
));
XInstallColormap
(
nxagentDisplay
,
nxagentColormap
(
pCmap
));
}
}
...
@@ -365,14 +358,13 @@ void nxagentDirectInstallColormaps(ScreenPtr pScreen)
...
@@ -365,14 +358,13 @@ void nxagentDirectInstallColormaps(ScreenPtr pScreen)
void
nxagentDirectUninstallColormaps
(
ScreenPtr
pScreen
)
void
nxagentDirectUninstallColormaps
(
ScreenPtr
pScreen
)
{
{
int
i
,
n
;
Colormap
pCmapIDs
[
MAXCMAPS
];
Colormap
pCmapIDs
[
MAXCMAPS
];
if
(
!
nxagentDoDirectColormaps
)
return
;
if
(
!
nxagentDoDirectColormaps
)
return
;
n
=
(
*
pScreen
->
ListInstalledColormaps
)(
pScreen
,
pCmapIDs
);
int
n
=
(
*
pScreen
->
ListInstalledColormaps
)(
pScreen
,
pCmapIDs
);
for
(
i
=
0
;
i
<
n
;
i
++
)
{
for
(
i
nt
i
=
0
;
i
<
n
;
i
++
)
{
ColormapPtr
pCmap
;
ColormapPtr
pCmap
;
pCmap
=
(
ColormapPtr
)
LookupIDByType
(
pCmapIDs
[
i
],
RT_COLORMAP
);
pCmap
=
(
ColormapPtr
)
LookupIDByType
(
pCmapIDs
[
i
],
RT_COLORMAP
);
...
@@ -429,7 +421,6 @@ int nxagentListInstalledColormaps(ScreenPtr pScreen, Colormap *pCmapIds)
...
@@ -429,7 +421,6 @@ int nxagentListInstalledColormaps(ScreenPtr pScreen, Colormap *pCmapIds)
if
(
nxagentInstalledDefaultColormap
)
if
(
nxagentInstalledDefaultColormap
)
{
{
*
pCmapIds
=
InstalledMaps
[
pScreen
->
myNum
]
->
mid
;
*
pCmapIds
=
InstalledMaps
[
pScreen
->
myNum
]
->
mid
;
return
1
;
return
1
;
}
}
else
else
...
@@ -443,10 +434,9 @@ void nxagentStoreColors(ColormapPtr pCmap, int nColors, xColorItem *pColors)
...
@@ -443,10 +434,9 @@ void nxagentStoreColors(ColormapPtr pCmap, int nColors, xColorItem *pColors)
if
(
pCmap
->
pVisual
->
class
&
DynamicClass
)
if
(
pCmap
->
pVisual
->
class
&
DynamicClass
)
#ifdef _XSERVER64
#ifdef _XSERVER64
{
{
int
i
;
XColor
*
pColors64
=
(
XColor
*
)
malloc
(
nColors
*
sizeof
(
XColor
)
);
XColor
*
pColors64
=
(
XColor
*
)
malloc
(
nColors
*
sizeof
(
XColor
)
);
for
(
i
=
0
;
i
<
nColors
;
++
i
)
for
(
i
nt
i
=
0
;
i
<
nColors
;
++
i
)
{
{
pColors64
[
i
].
pixel
=
pColors
[
i
].
pixel
;
pColors64
[
i
].
pixel
=
pColors
[
i
].
pixel
;
pColors64
[
i
].
red
=
pColors
[
i
].
red
;
pColors64
[
i
].
red
=
pColors
[
i
].
red
;
...
...
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