RemoteHWInterface: Add mechanism to retrieve the system palette.

This isn't used by the Haiku client as the palette is hardcoded.
This commit is contained in:
Michael Lotz
2017-11-21 22:18:17 +01:00
parent 4d9d6d7ee3
commit 778469156a
2 changed files with 23 additions and 0 deletions
@@ -15,6 +15,8 @@
#include "NetSender.h"
#include "StreamingRingBuffer.h"
#include "SystemPalette.h"
#include <Autolock.h>
#include <NetEndpoint.h>
@@ -273,6 +275,25 @@ RemoteHWInterface::_EventThread()
_FillDisplayModeTiming(fClientMode);
_NotifyScreenChanged();
break;
}
case RP_GET_SYSTEM_PALETTE:
{
RemoteMessage reply(NULL, fSendBuffer);
reply.Start(RP_GET_SYSTEM_PALETTE_RESULT);
const color_map *map = SystemColorMap();
uint32 count = (uint32)B_COUNT_OF(map->color_list);
reply.Add(count);
for (size_t i = 0; i < count; i++) {
const rgb_color &color = map->color_list[i];
reply.Add(color.red);
reply.Add(color.green);
reply.Add(color.blue);
reply.Add(color.alpha);
}
break;
}
@@ -39,6 +39,8 @@ enum {
RP_INIT_CONNECTION = 1,
RP_UPDATE_DISPLAY_MODE,
RP_CLOSE_CONNECTION,
RP_GET_SYSTEM_PALETTE,
RP_GET_SYSTEM_PALETTE_RESULT,
RP_CREATE_STATE = 20,
RP_DELETE_STATE,