summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXColor.c
diff options
context:
space:
mode:
authordas <das>2006-03-24 14:58:00 (GMT)
committerdas <das>2006-03-24 14:58:00 (GMT)
commit870bc114d9c7780cfe7af2f8f430c232602db6c8 (patch)
tree08e05421fec5d0674503f27d0f1901dea3ffec28 /macosx/tkMacOSXColor.c
parent489d54fcecc142a1feb7d87c793d721875294291 (diff)
downloadtk-870bc114d9c7780cfe7af2f8f430c232602db6c8.zip
tk-870bc114d9c7780cfe7af2f8f430c232602db6c8.tar.gz
tk-870bc114d9c7780cfe7af2f8f430c232602db6c8.tar.bz2
* generic/tkTextDisp.c: moved #ifdef MAC_OSX_TK code added by
* macosx/tkMacOSXColor.c: Patch #638966 into platform specific * macosx/tkMacOSXInt.h: files. * macosx/tkMacOSX.h: cleaned up & rationalized order of * macosx/tkMacOSXBitmap.c: #includes of tk and carbon headers. * macosx/tkMacOSXButton.c: * macosx/tkMacOSXCarbonEvents.c: * macosx/tkMacOSXClipboard.c: * macosx/tkMacOSXColor.c: * macosx/tkMacOSXConfig.c: * macosx/tkMacOSXCursor.c: * macosx/tkMacOSXDialog.c: * macosx/tkMacOSXDraw.c: * macosx/tkMacOSXEmbed.c: * macosx/tkMacOSXEntry.c: * macosx/tkMacOSXEvent.c: * macosx/tkMacOSXEvent.h: * macosx/tkMacOSXFont.h: * macosx/tkMacOSXHLEvents.c: * macosx/tkMacOSXInit.c: * macosx/tkMacOSXInt.h: * macosx/tkMacOSXKeyEvent.c: * macosx/tkMacOSXKeyboard.c: * macosx/tkMacOSXMenu.c: * macosx/tkMacOSXMenubutton.c: * macosx/tkMacOSXMenus.c: * macosx/tkMacOSXMouseEvent.c: * macosx/tkMacOSXRegion.c: * macosx/tkMacOSXScale.c: * macosx/tkMacOSXScrlbr.c: * macosx/tkMacOSXSend.c: * macosx/tkMacOSXSubwindows.c: * macosx/tkMacOSXWindowEvent.c: * macosx/tkMacOSXWm.c: * macosx/tkMacOSXWm.h: * macosx/tkMacOSXXStubs.c:
Diffstat (limited to 'macosx/tkMacOSXColor.c')
-rw-r--r--macosx/tkMacOSXColor.c34
1 files changed, 31 insertions, 3 deletions
diff --git a/macosx/tkMacOSXColor.c b/macosx/tkMacOSXColor.c
index fb4017c..78d80e1 100644
--- a/macosx/tkMacOSXColor.c
+++ b/macosx/tkMacOSXColor.c
@@ -12,12 +12,11 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkMacOSXColor.c,v 1.3 2003/07/03 18:47:03 wolfsuit Exp $
+ * RCS: @(#) $Id: tkMacOSXColor.c,v 1.4 2006/03/24 14:58:01 das Exp $
*/
-#include <tkColor.h>
#include "tkMacOSXInt.h"
-#include <Carbon/Carbon.h>
+#include "tkColor.h"
/*
* Default Auxillary Control Record for all controls. This is cached once
@@ -104,6 +103,35 @@ TkSetMacColor(
/*
*----------------------------------------------------------------------
*
+ * TkMacOSXCompareColors --
+ *
+ * On Mac, color codes may specify symbolic values like "highlight
+ * foreground", but we really need the actual values to compare.
+ * Maybe see also: "TIP #154: Add Named Colors to Tk".
+ *
+ * Results:
+ * Returns true if both colors are the same, false otherwise.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+TkMacOSXCompareColors(
+ unsigned long c1,
+ unsigned long c2)
+{
+ RGBColor col1, col2;
+ return TkSetMacColor(c1,&col1) &&
+ TkSetMacColor(c1,&col2) &&
+ !memcmp(&col1,&col2,sizeof(col1));
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
* Stub functions --
*
* These functions are just stubs for functions that either