diff options
| author | Dana Jansens <danakj@orodu.net> | 2003-01-13 08:48:03 +0000 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2003-01-13 08:48:03 +0000 |
| commit | c97915f445017d36667a6ad32767fa41d14d23b1 (patch) | |
| tree | 66ea465799a6b00ef1361a44774d4610ca6ca814 /otk/color.cc | |
| parent | 9e77a88d269bfafb78e56a646bfacebdd6ff4c5a (diff) | |
un-static otk::Display. add an operator* to it. make a global ob::display var.
Diffstat (limited to 'otk/color.cc')
| -rw-r--r-- | otk/color.cc | 17 |
1 files changed, 8 insertions, 9 deletions
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); } |
