diff --git a/os/oscolor.c b/dix/color.c similarity index 99% rename from os/oscolor.c rename to dix/color.c index 996d684d8..8252e2e88 100644 --- a/os/oscolor.c +++ b/dix/color.c @@ -50,10 +50,8 @@ SOFTWARE. #include -#include "os/osdep.h" - -#include "dix.h" -#include "os.h" +#include "dix/dix_priv.h" +#include "include/dix.h" typedef struct _builtinColor { unsigned char red; @@ -849,11 +847,12 @@ static const BuiltinColor BuiltinColors[] = { }; Bool -OsLookupColor(int screen, - char *name, - unsigned int len, - unsigned short *pred, - unsigned short *pgreen, unsigned short *pblue) +dixLookupBuiltinColor(int screen, + char *name, + unsigned int len, + unsigned short *pred, + unsigned short *pgreen, + unsigned short *pblue) { int low = 0; int high = ARRAY_SIZE(BuiltinColors) - 1; diff --git a/dix/dispatch.c b/dix/dispatch.c index fc0470501..fb301ea0b 100644 --- a/dix/dispatch.c +++ b/dix/dispatch.c @@ -110,7 +110,6 @@ Equipment Corporation. #include "dix/registry_priv.h" #include "dix/screenint_priv.h" #include "os/auth.h" -#include "os/osdep.h" #include "windowstr.h" #include "dixfontstr.h" @@ -2655,7 +2654,7 @@ ProcAllocNamedColor(ClientPtr client) .sequenceNumber = client->sequence, .length = 0 }; - if (OsLookupColor + if (dixLookupBuiltinColor (pcmp->pScreen->myNum, (char *) &stuff[1], stuff->nbytes, &ancr.exactRed, &ancr.exactGreen, &ancr.exactBlue)) { ancr.screenRed = ancr.exactRed; @@ -2872,8 +2871,12 @@ ProcStoreNamedColor(ClientPtr client) if (rc == Success) { xColorItem def; - if (OsLookupColor(pcmp->pScreen->myNum, (char *) &stuff[1], - stuff->nbytes, &def.red, &def.green, &def.blue)) { + if (dixLookupBuiltinColor(pcmp->pScreen->myNum, + (char *) &stuff[1], + stuff->nbytes, + &def.red, + &def.green, + &def.blue)) { def.flags = stuff->flags; def.pixel = stuff->pixel; return StoreColors(pcmp, 1, &def, client); @@ -2947,9 +2950,12 @@ ProcLookupColor(ClientPtr client) if (rc == Success) { CARD16 exactRed, exactGreen, exactBlue; - if (OsLookupColor - (pcmp->pScreen->myNum, (char *) &stuff[1], stuff->nbytes, - &exactRed, &exactGreen, &exactBlue)) { + if (dixLookupBuiltinColor(pcmp->pScreen->myNum, + (char *) &stuff[1], + stuff->nbytes, + &exactRed, + &exactGreen, + &exactBlue)) { xLookupColorReply lcr = { .type = X_Reply, .sequenceNumber = client->sequence, diff --git a/dix/dix_priv.h b/dix/dix_priv.h index 43eb0c706..f189cf50a 100644 --- a/dix/dix_priv.h +++ b/dix/dix_priv.h @@ -5,6 +5,8 @@ #ifndef _XSERVER_DIX_PRIV_H #define _XSERVER_DIX_PRIV_H +#include + /* This file holds global DIX settings to be used inside the Xserver, * 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 @@ -38,4 +40,12 @@ void ProcessWorkQueueZombies(void); 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 */ diff --git a/dix/meson.build b/dix/meson.build index fbbcf8646..0b5cfbf8f 100644 --- a/dix/meson.build +++ b/dix/meson.build @@ -1,6 +1,7 @@ srcs_dix = [ 'atom.c', 'colormap.c', + 'color.c', 'cursor.c', 'devices.c', 'dispatch.c', diff --git a/os/meson.build b/os/meson.build index 2f40a7525..84acc0924 100644 --- a/os/meson.build +++ b/os/meson.build @@ -10,7 +10,6 @@ srcs_os = [ 'inputthread.c', 'io.c', 'mitauth.c', - 'oscolor.c', 'osinit.c', 'ospoll.c', 'string.c', diff --git a/os/osdep.h b/os/osdep.h index fbe320c71..b6120eef2 100644 --- a/os/osdep.h +++ b/os/osdep.h @@ -166,14 +166,6 @@ void AutoResetServer(int sig); /* clone fd so it gets out of our select mask */ 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, depending on whether multithreading is used */ int xthread_sigmask(int how, const sigset_t *set, sigset_t *oldest);