]> granicus.if.org Git - graphviz/commitdiff
drop all the stuff default color. its a renderer issue
authorellson <devnull@localhost>
Sat, 27 Sep 2008 14:39:55 +0000 (14:39 +0000)
committerellson <devnull@localhost>
Sat, 27 Sep 2008 14:39:55 +0000 (14:39 +0000)
lib/inkpot/inkpot.h
lib/inkpot/inkpot_scheme.c
lib/inkpot/inkpot_structs.h
lib/inkpot/inkpot_tables.h
lib/inkpot/test.c

index 3de0e16e5029526ef26c51523fac2466e582ca70..7fe80fe41fd866b7ddf010c3755ffa1392682f96 100644 (file)
@@ -47,7 +47,6 @@ extern inkpot_status_t inkpot_schemes       ( inkpot_t *inkpot, const char *sche
 extern inkpot_status_t inkpot_translate       ( inkpot_t *inkpot, const char *scheme );
 
 extern inkpot_status_t inkpot_set            ( inkpot_t *inkpot, const char *color );
-extern inkpot_status_t inkpot_set_default     ( inkpot_t *inkpot );
 extern inkpot_status_t inkpot_set_rgba       ( inkpot_t *inkpot, double rgba[4] );
 extern inkpot_status_t inkpot_set_hsva       ( inkpot_t *inkpot, double hsva[4] );
 
index f017d2e7eadeb63ca8960a064aa66c8bd082532d..7619bd372a67b7ea64fd56e186a6e061782dbc6a 100644 (file)
@@ -141,10 +141,6 @@ static inkpot_status_t inkpot_scheme ( inkpot_t *inkpot, const char *scheme )
     inkpot_scheme_name = inkpot_find_scheme_name(scheme);
     if (inkpot_scheme_name) {
         idx = inkpot_scheme_name - TAB_SCHEMES_NAME;
-        if (! inkpot->scheme_bits) {
-            inkpot->default_scheme_name_idx = idx; /* first scheme is default */
-            inkpot->default_value_idx = TAB_NAMES[inkpot_scheme_name->default_name_idx].value_idx;
-        }
         inkpot->scheme_bits |= 1 << idx;
         return ((inkpot->status = INKPOT_SUCCESS));
     }
@@ -152,14 +148,8 @@ static inkpot_status_t inkpot_scheme ( inkpot_t *inkpot, const char *scheme )
     inkpot_scheme_index = inkpot_find_scheme_index(scheme);
     if (! inkpot_scheme_index)
         return ((inkpot->status = INKPOT_SCHEME_UNKNOWN));
-    if (inkpot->scheme_index != inkpot_scheme_index) {
+    if (inkpot->scheme_index != inkpot_scheme_index)
         inkpot->scheme_index = inkpot_scheme_index;
-       if (! inkpot->scheme_bits ) {
-           /* Set a default color from an index scheme only if no
-            * named schemes are currently active */
-           inkpot->default_value_idx = TAB_IXVALUES[inkpot_scheme_index->first_value_idx];
-       }
-    }
     return ((inkpot->status = INKPOT_SUCCESS));
 }
  
@@ -371,11 +361,6 @@ static inkpot_status_t inkpot_set_index ( inkpot_t *inkpot, int index )
     return inkpot_set_out_value(inkpot, value_idx);
 }
 
-inkpot_status_t inkpot_set_default( inkpot_t *inkpot )
-{
-    return inkpot_set_out_value(inkpot, inkpot->default_value_idx);
-}
-
 static int inkpot_rgba_cmpf ( const void *key, const void *base)
 {
     RGBA rgba_key = *(RGBA*)key;
@@ -661,8 +646,6 @@ inkpot_status_t inkpot_debug_schemes( inkpot_t *inkpot )
         if ((1<<i) & inkpot->scheme_bits) {
             errputs(inkpot, &TAB_STRINGS[TAB_SCHEMES_NAME[i].string_idx]);
             errputs(inkpot, " (in)");
-            if (i == inkpot->default_scheme_name_idx) 
-                errputs(inkpot, " (default)");
            found++;
         }
         if ((1<<i) & inkpot->out_scheme_bit) {
@@ -744,8 +727,6 @@ static inkpot_status_t inkpot_debug_names_schemes( inkpot_t *inkpot, MSK_SCHEMES
                inkpot_debug_scheme_names(inkpot, scheme_bits);
                errputs(inkpot, " ");
                inkpot_debug_rgba(inkpot, TAB_VALUES[name->value_idx].rgba);
-               if (name->value_idx == inkpot->default_value_idx)
-                   errputs(inkpot, " (default)");
                errputs(inkpot, "\n");
             }
         }
index 69305469fa270f3cc1d8b7c777e917d98d380442..60c1507288f48228f60c7e1b8d02a3880865cef9 100644 (file)
 typedef struct inkpot_scheme_name_s {
        IDX_STRINGS
             string_idx;        /* The scheme name in TAB_STRINGS.  (e.g. "x11") */
-
-       IDX_NAMES
-           default_name_idx;   /* The index of the name of the default color
-                                * for this scheme. (Each scheme can have
-                                * a different default.  The default must
-                                * be a member of the scheme */
 } inkpot_scheme_name_t;
 
 typedef struct inkpot_scheme_index_s { 
@@ -38,9 +32,6 @@ typedef struct inkpot_scheme_index_s {
                                 * first_value_idx of the next
                                 * inkpot_scheme_index_t in TAB_SCHEMES_INDEX
                                 * or by SZT_SCHEMES_INDEX */
-                               
-                               /* (The default value for indexed schemes is
-                                * always the color indexed by "0" */
 } inkpot_scheme_index_t;
 
 typedef struct inkpot_name_s { /* Color_name used by one or more
@@ -120,13 +111,7 @@ struct inkpot_s {          /* The Ink Pot */
            scheme_bits,        /* One bit per inkpot_scheme_name_t */
            out_scheme_bit;     /* One scheme only for output. */
 
-       IDX_SCHEMES_NAME
-           default_scheme_name_idx; /* The index of the scheme which provides
-                                * the default color. It was the first
-                                * scheme added. */
-
        IDX_VALUES
-           default_value_idx,  /* The default color */
            value_idx;          /* The current color */
 
        IDX_IXVALUES
index b70d90ddff127ac4b430f1a2147e46a8c3f45ec5..935c840cc1697b14ddd279ffbb732f7805565a19 100644 (file)
@@ -53,9 +53,9 @@ const char TAB_STRINGS[] = {
 #define SZT_STRINGS sizeof(TAB_STRINGS)/sizeof(TAB_STRINGS[0])
 
 inkpot_scheme_name_t TAB_SCHEMES_NAME[] = { /* schemes of named colors */
-       {  0, 1, },  /* french */
-       {  7, 0, },  /* svg */
-       { 11, 0, },  /* x11 */
+       {  0, },  /* french */
+       {  7, },  /* svg */
+       { 11, },  /* x11 */
 };
 #define SZT_SCHEMES_NAME (sizeof(TAB_SCHEMES_NAME)/sizeof(TAB_SCHEMES_NAME[0]))
 
index be65c313f2942fbbcfc2ade9d2f482c275fb8ca0..4ae92d75ca7b3af4c4fcde8dfbcdf509e9ad39c5 100644 (file)
@@ -64,8 +64,7 @@ int main (int argc, char *argv[])
         }
     }
 
-#if 0
-
+#if 1
     inkpot_debug_schemes(inkpot);
     
     inkpot_debug_names(inkpot);
@@ -73,16 +72,12 @@ int main (int argc, char *argv[])
     inkpot_debug_out_names(inkpot);
 
     inkpot_debug_values(inkpot);
-
 #endif
 
     fprintf(stdout, "%s ", color); /* ' ' after %s so it doesn't crash on NULL */
     rc = inkpot_set(inkpot, color);
-    if (rc == INKPOT_COLOR_UNKNOWN) {
+    if (rc == INKPOT_COLOR_UNKNOWN)
         fprintf(stdout, "(unknown)");
-       rc = inkpot_set_default(inkpot);
-       assert (rc == INKPOT_SUCCESS);
-    }
     fprintf(stdout, "\n text: ");
 
     rc = inkpot_write(inkpot);