From c97915f445017d36667a6ad32767fa41d14d23b1 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Mon, 13 Jan 2003 08:48:03 +0000 Subject: un-static otk::Display. add an operator* to it. make a global ob::display var. --- otk/color.cc | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'otk/color.cc') diff --git a/otk/color.cc b/otk/color.cc index d8c8f1d1..a05336e5 100644 --- a/otk/color.cc +++ b/otk/color.cc @@ -74,8 +74,8 @@ void Color::parseColorName(void) { } if (scrn == ~(0u)) - scrn = DefaultScreen(Display::display); - Colormap colormap = Display::screenInfo(scrn)->colormap(); + scrn = DefaultScreen(**display); + Colormap colormap = display->screenInfo(scrn)->colormap(); // get rgb values from colorname XColor xcol; @@ -84,7 +84,7 @@ void Color::parseColorName(void) { xcol.blue = 0; xcol.pixel = 0; - if (! XParseColor(Display::display, colormap, + if (! XParseColor(**display, colormap, colorname.c_str(), &xcol)) { fprintf(stderr, "Color::allocate: color parse error: \"%s\"\n", colorname.c_str()); @@ -97,8 +97,8 @@ void Color::parseColorName(void) { void Color::allocate(void) { - if (scrn == ~(0u)) scrn = DefaultScreen(Display::display); - Colormap colormap = Display::screenInfo(scrn)->colormap(); + if (scrn == ~(0u)) scrn = DefaultScreen(**display); + Colormap colormap = display->screenInfo(scrn)->colormap(); if (! isValid()) { if (colorname.empty()) { @@ -127,7 +127,7 @@ void Color::allocate(void) { xcol.blue = b | b << 8; xcol.pixel = 0; - if (! XAllocColor(Display::display, colormap, &xcol)) { + if (! XAllocColor(**display, colormap, &xcol)) { fprintf(stderr, "Color::allocate: color alloc error: rgb:%x/%x/%x\n", r, g, b); xcol.pixel = 0; @@ -187,7 +187,7 @@ void Color::doCacheCleanup(void) { int i; unsigned count; - for (i = 0; i < ScreenCount(Display::display); i++) { + for (i = 0; i < ScreenCount(**display); i++) { count = 0; it = colorcache.begin(); @@ -204,8 +204,7 @@ void Color::doCacheCleanup(void) { } if (count > 0) - XFreeColors(Display::display, - Display::screenInfo(i)->colormap(), + XFreeColors(**display, display->screenInfo(i)->colormap(), pixels, count, 0); } -- cgit v1.2.3