From 4a07a5215a4cbc6359e94b9e20c767874be170bc Mon Sep 17 00:00:00 2001 From: ellson Date: Thu, 25 Sep 2008 15:51:34 +0000 Subject: [PATCH] indicate default color in output from inkpot_print_names() --- lib/inkpot/inkpot_scheme.c | 8 +++++--- lib/inkpot/inkpot_structs.h | 10 ++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/inkpot/inkpot_scheme.c b/lib/inkpot/inkpot_scheme.c index 67765eae8..38e7d15e7 100644 --- a/lib/inkpot/inkpot_scheme.c +++ b/lib/inkpot/inkpot_scheme.c @@ -460,7 +460,7 @@ inkpot_status_t inkpot_print_schemes( inkpot_t *inkpot, FILE *out ) for (i = 0; i < SZT_SCHEMES_NAME; i++) { found = 0; if ((1<scheme_bits) { - fprintf (out, "%s", &TAB_STRINGS[TAB_SCHEMES_NAME[i].string_idx]); + fprintf (out, "%s (in)", &TAB_STRINGS[TAB_SCHEMES_NAME[i].string_idx]); if (i == inkpot->default_scheme_name_idx) fprintf (out, " (default)"); found++; @@ -477,7 +477,7 @@ inkpot_status_t inkpot_print_schemes( inkpot_t *inkpot, FILE *out ) } found = 0; if (inkpot->scheme_index) { - fprintf (out, "%s (indexed)", &TAB_STRINGS[inkpot->scheme_index->string_idx]); + fprintf (out, "%s (indexed) (in)", &TAB_STRINGS[inkpot->scheme_index->string_idx]); found++; } if (inkpot->out_scheme_index) { @@ -532,7 +532,7 @@ inkpot_status_t inkpot_print_names( inkpot_t *inkpot, FILE *out ) IDX_IXVALUES k, first, last; IDX_VALUES v; - fprintf(out, "names:\n"); + fprintf(out, "names (in):\n"); inkpot_scheme_bits = inkpot->scheme_bits; if (inkpot_scheme_bits) { for (i = 0; i < SZT_NAMES; i++) { @@ -543,6 +543,8 @@ inkpot_status_t inkpot_print_names( inkpot_t *inkpot, FILE *out ) inkpot_print_scheme_names(inkpot, scheme_bits, out); fprintf(out, " "); inkpot_print_rgba(TAB_VALUES[name->value_idx].rgba, out); + if (name->value_idx == inkpot->default_value_idx) + fprintf(out, " (default)"); fprintf(out, "\n"); } } diff --git a/lib/inkpot/inkpot_structs.h b/lib/inkpot/inkpot_structs.h index 2fda491a5..48cfbdb5b 100644 --- a/lib/inkpot/inkpot_structs.h +++ b/lib/inkpot/inkpot_structs.h @@ -108,8 +108,7 @@ typedef struct inkpot_noname_value_s { /* Numeric color values used by the remai struct inkpot_s { /* The Ink Pot */ BIT_SCHEMES_NAME - scheme_bits, /* One bit per inkpot_scheme_name_t, - *max 32 schemes */ + scheme_bits, /* One bit per inkpot_scheme_name_t */ out_scheme_bit; /* One scheme only for output. */ IDX_SCHEMES_NAME @@ -122,13 +121,12 @@ struct inkpot_s { /* The Ink Pot */ value_idx; /* The current color value. */ inkpot_scheme_index_t - *scheme_index, /* Pointer to the indexed color scheme, - or NULL. (Only 1 at a time) */ + *scheme_index, /* Pointer to the indexed color scheme, or NULL. */ *out_scheme_index; /* Indexed output scheme, or NULL */ inkpot_name_t - *name, /* The most recently resolved color name. */ - *out_name; /* The most recently translated color name. */ + *name, /* The current color name, or NULL. */ + *out_name; /* The current translated color name, or NULL. */ }; #endif /* INKPOT_STRUCTS_H */ -- 2.40.0