summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--unix/x0vncserver/x0vncserver.cxx14
1 files changed, 14 insertions, 0 deletions
diff --git a/unix/x0vncserver/x0vncserver.cxx b/unix/x0vncserver/x0vncserver.cxx
index f2067fba..165441fe 100644
--- a/unix/x0vncserver/x0vncserver.cxx
+++ b/unix/x0vncserver/x0vncserver.cxx
@@ -269,6 +269,20 @@ public:
return Point(pb->width(), pb->height());
}
+ // -=- ColourMap callbacks
+ virtual void lookup(int index, int* r, int* g, int* b) {
+ XColor xc;
+ xc.pixel = index;
+ if (index < DisplayCells(dpy,DefaultScreen(dpy))) {
+ XQueryColor(dpy, DefaultColormap(dpy,DefaultScreen(dpy)), &xc);
+ } else {
+ xc.red = xc.green = xc.blue = 0;
+ }
+ *r = xc.red;
+ *g = xc.green;
+ *b = xc.blue;
+ }
+
// -=- TXGlobalEventHandler interface
virtual bool handleGlobalEvent(XEvent* ev) {