color: Add enum value for the largest stock color.

Useful if we wish to keep a cache of patterns for the very common stock
colors...
This commit is contained in:
Chris Wilson 2010-01-22 16:11:48 +00:00
parent b7b65b5315
commit 9c98656fb1
2 changed files with 9 additions and 7 deletions

View file

@ -67,13 +67,14 @@ _cairo_stock_color (cairo_stock_t stock)
return &cairo_color_black;
case CAIRO_STOCK_TRANSPARENT:
return &cairo_color_transparent;
case CAIRO_STOCK_NUM_COLORS:
default:
ASSERT_NOT_REACHED;
/* If the user can get here somehow, give a color that indicates a
* problem. */
return &cairo_color_magenta;
}
ASSERT_NOT_REACHED;
/* If the user can get here somehow, give a color that indicates a
* problem. */
return &cairo_color_magenta;
}
void

View file

@ -306,7 +306,8 @@ typedef struct _cairo_format_masks {
typedef enum {
CAIRO_STOCK_WHITE,
CAIRO_STOCK_BLACK,
CAIRO_STOCK_TRANSPARENT
CAIRO_STOCK_TRANSPARENT,
CAIRO_STOCK_NUM_COLORS,
} cairo_stock_t;
typedef enum _cairo_image_transparency {