diff options
author | stanton <stanton> | 1999-04-16 01:51:06 (GMT) |
---|---|---|
committer | stanton <stanton> | 1999-04-16 01:51:06 (GMT) |
commit | 03656f44f81469f459031fa3a4a7b09c8bc77712 (patch) | |
tree | 31378e81bd58f8c726fc552d6b30cbf3ca07497b /mac/tkMacColor.c | |
parent | 404fc236f34304df53b7e44bc7971d786b87d453 (diff) | |
download | tk-03656f44f81469f459031fa3a4a7b09c8bc77712.zip tk-03656f44f81469f459031fa3a4a7b09c8bc77712.tar.gz tk-03656f44f81469f459031fa3a4a7b09c8bc77712.tar.bz2 |
* Merged 8.1 branch into the main trunk
Diffstat (limited to 'mac/tkMacColor.c')
-rw-r--r-- | mac/tkMacColor.c | 127 |
1 files changed, 58 insertions, 69 deletions
diff --git a/mac/tkMacColor.c b/mac/tkMacColor.c index 856ebe5..1b7e948 100644 --- a/mac/tkMacColor.c +++ b/mac/tkMacColor.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkMacColor.c,v 1.4 1999/04/16 01:25:54 stanton Exp $ + * RCS: @(#) $Id: tkMacColor.c,v 1.5 1999/04/16 01:51:30 stanton Exp $ */ #include <tkColor.h> @@ -88,7 +88,8 @@ TkSetMacColor( case MENU_BACKGROUND_PIXEL: case MENU_DISABLED_PIXEL: case MENU_TEXT_PIXEL: - return GetMenuPartColor((pixel >> 24), macColor); + GetMenuPartColor((pixel >> 24), macColor); + return true; case APPEARANCE_PIXEL: return false; case PIXEL_MAGIC: @@ -430,75 +431,63 @@ GetMenuPartColor( RGBColor backColor, foreColor; GDHandle maxDevice; Rect globalRect; - MCEntryPtr mcEntryPtr; + MCEntryPtr mcEntryPtr = GetMCEntry(0, 0); - /* Under Appearance, we don't want to set any menu colors when we - are asked for the standard menu colors. So we return false (which - means don't use this color... */ - - if (TkMacHaveAppearance()) { - macColor->red = 0xFFFF; - macColor->green = 0; - macColor->blue = 0; - return false; - } else { - mcEntryPtr = GetMCEntry(0, 0); - switch (pixel) { - case MENU_ACTIVE_PIXEL: - if (mcEntryPtr == NULL) { - macColor->red = macColor->blue = macColor->green = 0; - } else { - *macColor = mcEntryPtr->mctRGB3; - } - return true; - case MENU_ACTIVE_TEXT_PIXEL: - if (mcEntryPtr == NULL) { - macColor->red = macColor->blue = macColor->green = 0xFFFF; - } else { - *macColor = mcEntryPtr->mctRGB2; - } - return true; - case MENU_BACKGROUND_PIXEL: - if (mcEntryPtr == NULL) { - macColor->red = macColor->blue = macColor->green = 0xFFFF; - } else { - *macColor = mcEntryPtr->mctRGB2; - } - return true; - case MENU_DISABLED_PIXEL: - if (mcEntryPtr == NULL) { - backColor.red = backColor.blue = backColor.green = 0xFFFF; - foreColor.red = foreColor.blue = foreColor.green = 0x0000; - } else { - backColor = mcEntryPtr->mctRGB2; - foreColor = mcEntryPtr->mctRGB3; - } - SetRect(&globalRect, SHRT_MIN, SHRT_MIN, SHRT_MAX, SHRT_MAX); - maxDevice = GetMaxDevice(&globalRect); - if (GetGray(maxDevice, &backColor, &foreColor)) { - *macColor = foreColor; - } else { + switch (pixel) { + case MENU_ACTIVE_PIXEL: + if (mcEntryPtr == NULL) { + macColor->red = macColor->blue = macColor->green = 0; + } else { + *macColor = mcEntryPtr->mctRGB3; + } + return 1; + case MENU_ACTIVE_TEXT_PIXEL: + if (mcEntryPtr == NULL) { + macColor->red = macColor->blue = macColor->green = 0xFFFF; + } else { + *macColor = mcEntryPtr->mctRGB2; + } + return 1; + case MENU_BACKGROUND_PIXEL: + if (mcEntryPtr == NULL) { + macColor->red = macColor->blue = macColor->green = 0xFFFF; + } else { + *macColor = mcEntryPtr->mctRGB2; + } + return 1; + case MENU_DISABLED_PIXEL: + if (mcEntryPtr == NULL) { + backColor.red = backColor.blue = backColor.green = 0xFFFF; + foreColor.red = foreColor.blue = foreColor.green = 0x0000; + } else { + backColor = mcEntryPtr->mctRGB2; + foreColor = mcEntryPtr->mctRGB3; + } + SetRect(&globalRect, SHRT_MIN, SHRT_MIN, SHRT_MAX, SHRT_MAX); + maxDevice = GetMaxDevice(&globalRect); + if (GetGray(maxDevice, &backColor, &foreColor)) { + *macColor = foreColor; + } else { - /* - * Pointer may have been moved by GetMaxDevice or GetGray. - */ + /* + * Pointer may have been moved by GetMaxDevice or GetGray. + */ - mcEntryPtr = GetMCEntry(0,0); - if (mcEntryPtr == NULL) { - macColor->red = macColor->green = macColor->blue = 0x7777; - } else { - *macColor = mcEntryPtr->mctRGB2; - } - } - return true; - case MENU_TEXT_PIXEL: - if (mcEntryPtr == NULL) { - macColor->red = macColor->green = macColor->blue = 0; - } else { - *macColor = mcEntryPtr->mctRGB3; - } - return true; - } - return false; + mcEntryPtr = GetMCEntry(0,0); + if (mcEntryPtr == NULL) { + macColor->red = macColor->green = macColor->blue = 0x7777; + } else { + *macColor = mcEntryPtr->mctRGB2; + } + } + return 1; + case MENU_TEXT_PIXEL: + if (mcEntryPtr == NULL) { + macColor->red = macColor->green = macColor->blue = 0; + } else { + *macColor = mcEntryPtr->mctRGB3; + } + return 1; } + return 0; } |