Index: layer.h =================================================================== --- layer.h (revision 21672) +++ layer.h (revision 21673) @@ -110,6 +110,7 @@ #include "globalconst.h" #include "global_typedefs.h" #include "attrib.h" +#include "color.h" #include "obj_common.h" #include "obj_arc_list.h" #include "obj_line_list.h" @@ -135,7 +136,7 @@ struct { /* A real board layer */ pcb_layergrp_id_t grp; /* the group this layer is in (cross-reference) */ pcb_bool vis; /* visible flag */ - char *color; /* strdup'd */ + pcb_color_t color; /* copied */ int no_drc; /* whether to ignore the layer when checking the design rules */ const char *cookie; /* for UI layers: registration cookie; NULL for unused UI layers */ pcb_xform_t xform; /* layer specified rendering transformation */ @@ -179,7 +180,7 @@ typedef struct { const char *name, *abbrev; - char * const *force_color; + pcb_color_t const *force_color; const char *select_name; int vis_offs, sel_offs; } pcb_menu_layers_t; @@ -278,16 +279,18 @@ const char *pcb_layer_name(pcb_data_t *data, pcb_layer_id_t id); /* Return the default color for a new layer from the config */ -const char *pcb_layer_default_color(int idx, pcb_layer_type_t lyt); +const pcb_color_t *pcb_layer_default_color(int idx, pcb_layer_type_t lyt); /* Rename/recolor an existing layer by idx */ int pcb_layer_rename(pcb_data_t *data, pcb_layer_id_t layer, const char *lname); int pcb_layer_recolor(pcb_data_t *data, pcb_layer_id_t layer, const char *lcolor); -/* changes the name/color of a layer; string has to be allocated by the caller (pcb_strdup) */ +/* changes the color of a layer; string has to be allocated by the caller (pcb_strdup) */ int pcb_layer_rename_(pcb_layer_t *Layer, char *Name); -int pcb_layer_recolor_(pcb_layer_t *Layer, char *color); +/* Low level layer color change, parsed color must be available */ +int pcb_layer_recolor_(pcb_layer_t *Layer, const pcb_color_t *color); + /* index is 0..PCB_MAX_LAYER-1. If old_index is -1, a new layer is inserted at that index. If new_index is -1, the specified layer is deleted. Returns non-zero on error, zero if OK. */