os: move over osLookupColor to dix
This function is only used by DIX and not os-specific at all. So move it over to DIX and give it a more fitting name. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net> Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1373>
This commit is contained in:
parent
6cb599f59c
commit
1999785fa9
|
@ -50,10 +50,8 @@ SOFTWARE.
|
||||||
|
|
||||||
#include <X11/keysym.h>
|
#include <X11/keysym.h>
|
||||||
|
|
||||||
#include "os/osdep.h"
|
#include "dix/dix_priv.h"
|
||||||
|
#include "include/dix.h"
|
||||||
#include "dix.h"
|
|
||||||
#include "os.h"
|
|
||||||
|
|
||||||
typedef struct _builtinColor {
|
typedef struct _builtinColor {
|
||||||
unsigned char red;
|
unsigned char red;
|
||||||
|
@ -849,11 +847,12 @@ static const BuiltinColor BuiltinColors[] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
Bool
|
Bool
|
||||||
OsLookupColor(int screen,
|
dixLookupBuiltinColor(int screen,
|
||||||
char *name,
|
char *name,
|
||||||
unsigned int len,
|
unsigned int len,
|
||||||
unsigned short *pred,
|
unsigned short *pred,
|
||||||
unsigned short *pgreen, unsigned short *pblue)
|
unsigned short *pgreen,
|
||||||
|
unsigned short *pblue)
|
||||||
{
|
{
|
||||||
int low = 0;
|
int low = 0;
|
||||||
int high = ARRAY_SIZE(BuiltinColors) - 1;
|
int high = ARRAY_SIZE(BuiltinColors) - 1;
|
|
@ -110,7 +110,6 @@ Equipment Corporation.
|
||||||
#include "dix/registry_priv.h"
|
#include "dix/registry_priv.h"
|
||||||
#include "dix/screenint_priv.h"
|
#include "dix/screenint_priv.h"
|
||||||
#include "os/auth.h"
|
#include "os/auth.h"
|
||||||
#include "os/osdep.h"
|
|
||||||
|
|
||||||
#include "windowstr.h"
|
#include "windowstr.h"
|
||||||
#include "dixfontstr.h"
|
#include "dixfontstr.h"
|
||||||
|
@ -2655,7 +2654,7 @@ ProcAllocNamedColor(ClientPtr client)
|
||||||
.sequenceNumber = client->sequence,
|
.sequenceNumber = client->sequence,
|
||||||
.length = 0
|
.length = 0
|
||||||
};
|
};
|
||||||
if (OsLookupColor
|
if (dixLookupBuiltinColor
|
||||||
(pcmp->pScreen->myNum, (char *) &stuff[1], stuff->nbytes,
|
(pcmp->pScreen->myNum, (char *) &stuff[1], stuff->nbytes,
|
||||||
&ancr.exactRed, &ancr.exactGreen, &ancr.exactBlue)) {
|
&ancr.exactRed, &ancr.exactGreen, &ancr.exactBlue)) {
|
||||||
ancr.screenRed = ancr.exactRed;
|
ancr.screenRed = ancr.exactRed;
|
||||||
|
@ -2872,8 +2871,12 @@ ProcStoreNamedColor(ClientPtr client)
|
||||||
if (rc == Success) {
|
if (rc == Success) {
|
||||||
xColorItem def;
|
xColorItem def;
|
||||||
|
|
||||||
if (OsLookupColor(pcmp->pScreen->myNum, (char *) &stuff[1],
|
if (dixLookupBuiltinColor(pcmp->pScreen->myNum,
|
||||||
stuff->nbytes, &def.red, &def.green, &def.blue)) {
|
(char *) &stuff[1],
|
||||||
|
stuff->nbytes,
|
||||||
|
&def.red,
|
||||||
|
&def.green,
|
||||||
|
&def.blue)) {
|
||||||
def.flags = stuff->flags;
|
def.flags = stuff->flags;
|
||||||
def.pixel = stuff->pixel;
|
def.pixel = stuff->pixel;
|
||||||
return StoreColors(pcmp, 1, &def, client);
|
return StoreColors(pcmp, 1, &def, client);
|
||||||
|
@ -2947,9 +2950,12 @@ ProcLookupColor(ClientPtr client)
|
||||||
if (rc == Success) {
|
if (rc == Success) {
|
||||||
CARD16 exactRed, exactGreen, exactBlue;
|
CARD16 exactRed, exactGreen, exactBlue;
|
||||||
|
|
||||||
if (OsLookupColor
|
if (dixLookupBuiltinColor(pcmp->pScreen->myNum,
|
||||||
(pcmp->pScreen->myNum, (char *) &stuff[1], stuff->nbytes,
|
(char *) &stuff[1],
|
||||||
&exactRed, &exactGreen, &exactBlue)) {
|
stuff->nbytes,
|
||||||
|
&exactRed,
|
||||||
|
&exactGreen,
|
||||||
|
&exactBlue)) {
|
||||||
xLookupColorReply lcr = {
|
xLookupColorReply lcr = {
|
||||||
.type = X_Reply,
|
.type = X_Reply,
|
||||||
.sequenceNumber = client->sequence,
|
.sequenceNumber = client->sequence,
|
||||||
|
|
|
@ -5,6 +5,8 @@
|
||||||
#ifndef _XSERVER_DIX_PRIV_H
|
#ifndef _XSERVER_DIX_PRIV_H
|
||||||
#define _XSERVER_DIX_PRIV_H
|
#define _XSERVER_DIX_PRIV_H
|
||||||
|
|
||||||
|
#include <X11/Xdefs.h>
|
||||||
|
|
||||||
/* This file holds global DIX settings to be used inside the Xserver,
|
/* This file holds global DIX settings to be used inside the Xserver,
|
||||||
* but NOT supposed to be accessed directly by external server modules like
|
* but NOT supposed to be accessed directly by external server modules like
|
||||||
* drivers or extension modules. Thus the definitions here are not part of the
|
* drivers or extension modules. Thus the definitions here are not part of the
|
||||||
|
@ -38,4 +40,12 @@ void ProcessWorkQueueZombies(void);
|
||||||
|
|
||||||
void CloseDownClient(ClientPtr client);
|
void CloseDownClient(ClientPtr client);
|
||||||
|
|
||||||
|
/* lookup builtin color by name */
|
||||||
|
Bool dixLookupBuiltinColor(int screen,
|
||||||
|
char *name,
|
||||||
|
unsigned len,
|
||||||
|
unsigned short *pred,
|
||||||
|
unsigned short *pgreen,
|
||||||
|
unsigned short *pblue);
|
||||||
|
|
||||||
#endif /* _XSERVER_DIX_PRIV_H */
|
#endif /* _XSERVER_DIX_PRIV_H */
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
srcs_dix = [
|
srcs_dix = [
|
||||||
'atom.c',
|
'atom.c',
|
||||||
'colormap.c',
|
'colormap.c',
|
||||||
|
'color.c',
|
||||||
'cursor.c',
|
'cursor.c',
|
||||||
'devices.c',
|
'devices.c',
|
||||||
'dispatch.c',
|
'dispatch.c',
|
||||||
|
|
|
@ -10,7 +10,6 @@ srcs_os = [
|
||||||
'inputthread.c',
|
'inputthread.c',
|
||||||
'io.c',
|
'io.c',
|
||||||
'mitauth.c',
|
'mitauth.c',
|
||||||
'oscolor.c',
|
|
||||||
'osinit.c',
|
'osinit.c',
|
||||||
'ospoll.c',
|
'ospoll.c',
|
||||||
'string.c',
|
'string.c',
|
||||||
|
|
|
@ -166,14 +166,6 @@ void AutoResetServer(int sig);
|
||||||
/* clone fd so it gets out of our select mask */
|
/* clone fd so it gets out of our select mask */
|
||||||
int os_move_fd(int fd);
|
int os_move_fd(int fd);
|
||||||
|
|
||||||
/* lookup builtin color by name */
|
|
||||||
Bool OsLookupColor(int screen,
|
|
||||||
char *name,
|
|
||||||
unsigned len,
|
|
||||||
unsigned short *pred,
|
|
||||||
unsigned short *pgreen,
|
|
||||||
unsigned short *pblue);
|
|
||||||
|
|
||||||
/* set signal mask - either on current thread or whole process,
|
/* set signal mask - either on current thread or whole process,
|
||||||
depending on whether multithreading is used */
|
depending on whether multithreading is used */
|
||||||
int xthread_sigmask(int how, const sigset_t *set, sigset_t *oldest);
|
int xthread_sigmask(int how, const sigset_t *set, sigset_t *oldest);
|
||||||
|
|
Loading…
Reference in New Issue