summaryrefslogtreecommitdiffstats
path: root/unix/tkUnixColor.c
diff options
context:
space:
mode:
Diffstat (limited to 'unix/tkUnixColor.c')
-rw-r--r--[-rwxr-xr-x]unix/tkUnixColor.c58
1 files changed, 29 insertions, 29 deletions
diff --git a/unix/tkUnixColor.c b/unix/tkUnixColor.c
index 205056b..9474c95 100755..100644
--- a/unix/tkUnixColor.c
+++ b/unix/tkUnixColor.c
@@ -10,7 +10,8 @@
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
-#include <tkColor.h>
+#include "tkInt.h"
+#include "tkColor.h"
/*
* If a colormap fills up, attempts to allocate new colors from that colormap
@@ -42,10 +43,10 @@ struct TkStressedCmap {
* Forward declarations for functions defined in this file:
*/
-static void DeleteStressedCmap _ANSI_ARGS_((Display *display,
- Colormap colormap));
-static void FindClosestColor _ANSI_ARGS_((Tk_Window tkwin,
- XColor *desiredColorPtr, XColor *actualColorPtr));
+static void DeleteStressedCmap(Display *display,
+ Colormap colormap);
+static void FindClosestColor(Tk_Window tkwin,
+ XColor *desiredColorPtr, XColor *actualColorPtr);
/*
*----------------------------------------------------------------------
@@ -65,8 +66,8 @@ static void FindClosestColor _ANSI_ARGS_((Tk_Window tkwin,
*/
void
-TkpFreeColor(tkColPtr)
- TkColor *tkColPtr; /* Color to be released. Must have been
+TkpFreeColor(
+ TkColor *tkColPtr) /* Color to be released. Must have been
* allocated by TkpGetColor or
* TkpGetColorByValue. */
{
@@ -90,7 +91,7 @@ TkpFreeColor(tkColPtr)
Tk_ErrorHandler handler;
handler = Tk_CreateErrorHandler(DisplayOfScreen(screen),
- -1, -1, -1, (Tk_ErrorProc *) NULL, (ClientData) NULL);
+ -1, -1, -1, NULL, NULL);
XFreeColors(DisplayOfScreen(screen), tkColPtr->colormap,
&tkColPtr->color.pixel, 1, 0L);
Tk_DeleteErrorHandler(handler);
@@ -116,9 +117,9 @@ TkpFreeColor(tkColPtr)
*/
TkColor *
-TkpGetColor(tkwin, name)
- Tk_Window tkwin; /* Window in which color will be used. */
- Tk_Uid name; /* Name of color to allocated (in form
+TkpGetColor(
+ Tk_Window tkwin, /* Window in which color will be used. */
+ Tk_Uid name) /* Name of color to allocated (in form
* suitable for passing to XParseColor). */
{
Display *display = Tk_Display(tkwin);
@@ -161,14 +162,14 @@ TkpGetColor(tkwin, name)
*/
if (XLookupColor(display, colormap, name, &color, &screen) == 0) {
- return (TkColor *) NULL;
+ return NULL;
}
FindClosestColor(tkwin, &screen, &color);
}
} else {
gotWebColor:
if (TkParseColor(display, colormap, name, &color) == 0) {
- return (TkColor *) NULL;
+ return NULL;
}
if (XAllocColor(display, colormap, &color) != 0) {
DeleteStressedCmap(display, colormap);
@@ -205,9 +206,9 @@ TkpGetColor(tkwin, name)
*/
TkColor *
-TkpGetColorByValue(tkwin, colorPtr)
- Tk_Window tkwin; /* Window in which color will be used. */
- XColor *colorPtr; /* Red, green, and blue fields indicate
+TkpGetColorByValue(
+ Tk_Window tkwin, /* Window in which color will be used. */
+ XColor *colorPtr) /* Red, green, and blue fields indicate
* desired color. */
{
Display *display = Tk_Display(tkwin);
@@ -248,13 +249,12 @@ TkpGetColorByValue(tkwin, colorPtr)
*/
static void
-FindClosestColor(tkwin, desiredColorPtr, actualColorPtr)
- Tk_Window tkwin; /* Window where color will be used. */
- XColor *desiredColorPtr; /* RGB values of color that was
- * wanted (but unavailable). */
- XColor *actualColorPtr; /* Structure to fill in with RGB and
- * pixel for closest available
- * color. */
+FindClosestColor(
+ Tk_Window tkwin, /* Window where color will be used. */
+ XColor *desiredColorPtr, /* RGB values of color that was wanted (but
+ * unavailable). */
+ XColor *actualColorPtr) /* Structure to fill in with RGB and pixel for
+ * closest available color. */
{
TkStressedCmap *stressPtr;
double tmp, distance, closestDistance;
@@ -376,10 +376,10 @@ FindClosestColor(tkwin, desiredColorPtr, actualColorPtr)
*/
static void
-DeleteStressedCmap(display, colormap)
- Display *display; /* Xlib's handle for the display containing
+DeleteStressedCmap(
+ Display *display, /* Xlib's handle for the display containing
* the colormap. */
- Colormap colormap; /* Colormap to flush. */
+ Colormap colormap) /* Colormap to flush. */
{
TkStressedCmap *prevPtr, *stressPtr;
TkDisplay *dispPtr = TkGetDisplay(display);
@@ -417,10 +417,10 @@ DeleteStressedCmap(display, colormap)
*/
int
-TkpCmapStressed(tkwin, colormap)
- Tk_Window tkwin; /* Window that identifies the display
+TkpCmapStressed(
+ Tk_Window tkwin, /* Window that identifies the display
* containing the colormap. */
- Colormap colormap; /* Colormap to check for stress. */
+ Colormap colormap) /* Colormap to check for stress. */
{
TkStressedCmap *stressPtr;