MCPcopy Create free account
hub / github.com/danoon2/Boxedwine / x11_QueryColor

Function x11_QueryColor

source/x11/x11common.cpp:1371–1393  ·  view source on GitHub ↗

int XQueryColor(Display* display, Colormap colormap, XColor* def_in_out)

Source from the content-addressed store, hash-verified

1369
1370// int XQueryColor(Display* display, Colormap colormap, XColor* def_in_out)
1371static void x11_QueryColor(CPU* cpu) {
1372 KMemory* memory = cpu->memory;
1373 XServer* server = XServer::getServer();
1374 XColorMapPtr colorMap = server->getColorMap(ARG2);
1375
1376 if (!colorMap) {
1377 EAX = BadColor;
1378 return;
1379 }
1380 U32 colorAddress = ARG3;
1381
1382 U32 index = memory->readd(colorAddress);
1383 if (index >= MAX_COLORMAP_SIZE) {
1384 EAX = BadValue;
1385 return;
1386 }
1387 XColorMapColor& c = colorMap->colors[index];
1388 memory->writew(colorAddress + 4, (U16)(c.r << 8));
1389 memory->writew(colorAddress + 6, (U16)(c.g << 8));
1390 memory->writew(colorAddress + 8, (U16)(c.b << 8));
1391
1392 EAX = Success;
1393}
1394
1395// Status XAllocColor(Display* display, Colormap colormap, XColor* screen_in_out)
1396static void x11_AllocColor(CPU* cpu) {

Callers

nothing calls this directly

Calls 3

getColorMapMethod · 0.80
readdMethod · 0.45
writewMethod · 0.45

Tested by

no test coverage detected