12 #error MODULE_... is not known
43 #define AWAR_RANGE_OVERLAY "tmp/GCS/range/overlay" // global toggle (used for all gc-managers!)
44 #define AWAR_COLOR_GROUPS_PREFIX "colorGroups" // [Note: before arb-7.0 the prefix was "color_groups"]
45 #define AWAR_COLOR_GROUPS_USE AWAR_COLOR_GROUPS_PREFIX "/use" // int : whether to use the colors in display or not
47 #define ATPL_GCMAN_LOCAL "GCS/%s" // awar prefix for awars local to gc-manager
48 #define ATPL_GC_LOCAL ATPL_GCMAN_LOCAL "/MANAGE_GCS/%s" // awar prefix for awars local to a single gc
50 #define ALL_FONTS_ID "all_fonts"
67 static SmartCharPtr awar_name;
71 inline const char*
gc_awarname(
const char *tpl,
const char *gcman_id,
const string& colname) {
74 inline const char*
gcman_awarname(
const char* gcman_id,
const char *localpart) {
105 return for_edit4 ? rgb_e4 :
rgb_nt;
112 {
"red",
"D50000",
"FFDCDC" },
113 {
"cyan",
"00ffff",
"CFFFFF" },
114 {
"green",
"00FF77",
"B1FFD6" },
115 {
"purple",
"c700c7",
"F1BFF1" },
116 {
"blue",
"0000ff",
"D7D7FF" },
117 {
"orange",
"FFCE5B",
"FFEAB9" },
118 {
"dark_red",
"AB2323",
"DCB8B8" },
119 {
"petrol",
"008888",
"8BBBBB" },
120 {
"dark_green",
"008800",
"97CB97" },
121 {
"dark_purple",
"880088",
"B177B1" },
122 {
"dark_blue",
"000088",
"9898E2" },
123 {
"olive",
"888800",
"C8D98F" },
146 #define RANGE_INDEX_BITS 4
147 #define RANGE_INDEX_MASK ((1<<RANGE_INDEX_BITS)-1)
180 fixed_width_font(
false),
192 bool parse_char(
char c) {
194 case '#': fixed_width_font =
true;
break;
195 case '+': same_line =
true;
break;
196 case '-': has_font =
false;
break;
197 default :
return false;
203 if (same_line && has_font) same_line =
false;
207 const char *
parse_decl(
const char *decl,
const char *id_prefix) {
210 while (decl[offset]) {
211 if (!parse_char(decl[offset]))
break;
218 const char *split = strchr(decl,
'$');
221 colorlabel =
string(decl, split-decl);
222 default_color = split+1;
226 default_color =
"black";
271 const string&
get_id()
const {
return id; }
290 const char *gc_base_name;
294 int first_colorgroup_idx;
299 typedef std::vector<gc_desc> gc_container;
300 typedef std::vector<gc_range> gc_range_container;
303 gc_range_container color_ranges;
304 unsigned active_range_number;
306 GcChangedCallback changed_cb;
308 mutable bool suppress_changed_cb;
309 mutable GcChange did_suppress_change;
312 #if defined(ASSERTION_USED)
313 bool valid_idx(
int idx)
const {
return idx>=0 && idx<
int(GCs.size()); }
314 bool valid_gc(
int gc)
const {
316 return gc>=GC_BACKGROUND && gc < drag_gc_offset;
324 static void ignore_change_cb(
GcChange) {}
326 void allocate_gc(
int gc)
const;
328 void update_gc_color_internal(
int gc,
const char *color)
const;
329 void update_range_colors(
const gc_desc& gcd)
const;
330 void update_range_font(
int fname,
int fsize)
const;
342 : gc_base_name(name),
344 drag_gc_offset(drag_gc_offset_),
345 first_colorgroup_idx(NO_INDEX),
347 colorindex_base(colorindex_base_),
348 active_range_number(-1),
349 changed_cb(makeGcChangedCallback(ignore_change_cb)),
350 suppress_changed_cb(
false),
351 did_suppress_change(GC_NOTHING_CHANGED)
364 int size()
const {
return GCs.size(); }
372 void add_gc (
const char *gc_description,
int& gc,
gc_type type,
const char *id_prefix =
NULp);
374 void reserve_gcs (
const char *gc_description,
int& gc);
388 if (suppress_changed_cb) {
392 #if defined(DEBUG) && 0
393 fprintf(stderr,
"[changed_cb] @ %zu\n", clock());
395 changed_cb(whatChanged);
400 aw_assert(suppress != suppress_changed_cb);
402 suppress_changed_cb = suppress;
404 did_suppress_change = GC_NOTHING_CHANGED;
406 else if (did_suppress_change>GC_NOTHING_CHANGED) {
434 static bool avoid_recursion =
false;
435 if (avoid_recursion)
return;
438 const gc_desc& gcd0 = GCs[idx];
445 int fname = awar_fontname->
read_int();
446 int fsize = awar_fontsize->
read_int();
451 device->
set_font(gcd0.
gc, fname, fsize, &found_font_size);
454 bool autocorrect_fontsize = (found_font_size != fsize) && (found_font_size != -1);
455 if (autocorrect_fontsize) {
456 awar_fontsize->
write_int(found_font_size);
457 fsize = found_font_size;
461 for (
int i = idx+1; i<
int(GCs.size()); ++i) {
465 update_range_font(fname, fsize);
492 for (gc_container::const_iterator g = GCs.begin(); g != GCs.end(); ++g) {
509 void AW_gc_manager::update_gc_color_internal(
int gc,
const char *color)
const {
513 if (gc == GC_BACKGROUND && colorIdx ==
AW_DATA_BG) {
517 for (
int i = 1; i<
size(); ++i) {
522 colorIdx = colorindex(g);
528 colorIdx = colorindex(g);
534 if (gc == GC_BACKGROUND) gc = 0;
564 float factor = i/float(AW_RANGE_COLORS-1);
573 for (
int part = 0; part<color_count; ++part) {
580 for (
int i = i1; i<i2; ++i) {
582 float factor = o/float(i2-i1-1);
601 float fact1 = i1/float(AW_PLANAR_COLORS-1);
605 float fact2 = i2/float(AW_PLANAR_COLORS-1);
627 float fact1 = i1/float(AW_SPATIAL_COLORS-1);
631 float fact2 = i2/float(AW_SPATIAL_COLORS-1);
635 float fact3 = i3/float(AW_SPATIAL_COLORS-1);
648 void AW_gc_manager::update_range_colors(
const gc_desc& gcd)
const {
649 int defined_ranges = color_ranges.size();
652 if (range_idx<defined_ranges) {
653 const gc_range& gcr = color_ranges[range_idx];
657 void AW_gc_manager::update_range_font(
int fname,
int fsize)
const {
663 device->
set_font(gc+drag_gc_offset, fname, fsize,
NULp);
674 update_range_colors(gcd);
677 update_gc_color_internal(gcd.
gc, color);
687 static bool warned =
false;
689 AW_advice(
"Color group names are used at various places of the interface.\n"
690 "To activate the changed names everywhere, you have to\n"
691 "save properties and restart the program.",
698 AW_awar *awar_colorgroupname = awr->
awar(awarname);
699 char *content = awar_colorgroupname->
read_string();
700 size_t len = strlen(content);
704 aw_message(
"the colorgroup name was too long and has been truncated.");
730 const char *comma = strchr(gc_description+1,
',');
731 if (!comma) error =
"',' expected";
733 string range_name(gc_description+1, comma-gc_description-1);
734 const char *colon = strchr(comma+1,
':');
735 if (!colon) error =
"':' expected";
738 string range_type(comma+1, colon-comma-1);
750 gc_range range(range_name, rtype, color_ranges.size(), GCs.size());
752 const char *color_start = colon+1;
753 comma = strchr(color_start,
',');
755 range.add_color(
string(color_start, comma-color_start),
this);
756 color_start = comma+1;
757 comma = strchr(color_start,
',');
759 range.add_color(
string(color_start),
this);
761 color_ranges.push_back(range);
767 GBK_terminatef(
"Failed to parse color range specification '%s'\n(Reason: %s)", gc_description, error);
776 if (wanted_range_number != active_range_number) {
777 aw_assert(wanted_range_number<color_ranges.size());
779 active_range_number = wanted_range_number;
780 const gc_range& active_range = color_ranges[active_range_number];
789 int last_gc = gc + AW_RANGE_COLORS-1;
790 while (gc<=last_gc) allocate_gc(gc++);
796 unsigned wanted_range_number = 0;
797 for (gc_range_container::const_iterator r = color_ranges.begin(); r != color_ranges.end(); ++r) {
800 aw_assert(wanted_range_number<color_ranges.size());
804 ++wanted_range_number;
808 const gc_range& range = color_ranges[active_range_number];
810 return range.
get_id().c_str();
815 for (gc_range_container::const_iterator r = color_ranges.begin(); r != color_ranges.end(); ++r) {
831 int amount = atoi(gc_description+1);
837 void AW_gc_manager::allocate_gc(
int gc)
const {
842 int gc_drag = gc + drag_gc_offset;
850 aw_assert(!strchr(
"*!&", gc_description[0]));
853 GCs.push_back(
gc_desc(gc, type));
855 int idx =
int(GCs.size()-1);
858 first_colorgroup_idx = idx;
864 allocate_gc(gc + is_background);
870 #if defined(ASSERTION_USED)
872 const string& lastId = gcd.
key;
873 for (
int i = 0; i<idx; ++i) {
880 #if !defined(ARB_OPENGL)
885 if (default_color[0] ==
'{') {
888 const char *close_brace = strchr(default_color+1,
'}');
890 char *referenced_colorlabel =
ARB_strpartdup(default_color+1, close_brace-1);
894 for (gc_container::iterator g = GCs.begin(); g != GCs.end(); ++g) {
895 if (strcmp(g->colorlabel.c_str(), referenced_colorlabel) == 0) {
903 free(referenced_colorlabel);
911 if (!is_background) {
933 for (
int idx = 0; idx<
int(GCs.size()); ++idx) {
951 for (gc_container::const_iterator g = GCs.begin(); g != GCs.end(); ++g) {
952 if (g->has_font && !g->fixed_width_font)
return true;
964 while (*color_group_gc_default) {
970 const char *gc_base_name,
974 const GcChangedCallback& changecb,
975 const char *default_background_color,
1017 #if defined(ASSERTION_USED)
1018 int base_drag_given = base_drag;
1027 char background[50];
1028 sprintf(background,
"-background$%s", default_background_color);
1032 va_start(parg, default_background_color);
1034 bool defined_color_groups =
false;
1037 while ( (
id = va_arg(parg,
char*)) ) {
1042 if (strcmp(
id,
"&color_groups") == 0) {
1044 if (!defined_color_groups) {
1046 defined_color_groups =
true;
1060 AW_gc_manager::use_color_groups = awar_useGroups->
read_int();
1072 #if defined(ASSERTION_USED)
1073 if (strcmp(gc_base_name,
"ARB_PARSIMONY") == 0) {
1076 aw_assert(gc == (base_drag_given-AW_RANGE_COLORS));
1102 const char *
id = id0;
1107 id = va_arg(parg,
const char*);
1117 aw_assert(!AW_gc_manager::color_group_defaults);
1119 bool for_edit4 =
false;
1121 if (strcmp(for_program,
"arb_edit4") == 0) {
1124 #if defined(ASSERTION_USED)
1126 aw_assert(strcmp(for_program,
"arb_ntree") == 0);
1133 const char SEP =
'\1';
1137 if (!(i&1)) printBuffer.
put(
'+');
1138 printBuffer.
put(
'-');
1140 printBuffer.
put(
'$');
1141 printBuffer.
put(
'#');
1142 printBuffer.
cat(color_group_def[i].rgbValue(for_edit4));
1143 printBuffer.
put(SEP);
1150 char *alldefs = printBuffer.
release();
1154 static const char *cg_def[AW_COLOR_GROUPS+1];
1156 cg_def[i] = singleDefs[i];
1160 AW_gc_manager::color_group_defaults = cg_def;
1204 for (
int idx = 0; idx<
int(GCs.size()); ++idx) {
1205 const gc_desc& gcd = GCs[idx];
1215 const char *type_info =
NULp;
1232 int color_group_no = idx-first_colorgroup_idx+1;
1234 sprintf(buf,
"%2i:", color_group_no);
1259 static GroupWindowRegistry existing_window;
1260 GroupWindowRegistry::iterator found = existing_window.find(gcmgr);
1261 AW_window_simple *aws = found == existing_window.end() ?
NULp : found->second;
1264 aws =
new AW_window_simple;
1266 aws->init(aww->
get_root(),
"COLOR_GROUP_DEF2",
"Define color groups");
1269 aws->auto_space(1, 1);
1272 aws->create_button(
"CLOSE",
"CLOSE",
"C");
1274 aws->create_button(
"HELP",
"HELP",
"H");
1277 aws->label_length(20);
1278 aws->label(
"Enable color groups:");
1285 existing_window[gcmgr] = aws;
1292 static GroupWindowRegistry existing_window;
1293 GroupWindowRegistry::iterator found = existing_window.find(gcmgr);
1294 AW_window_simple *aws = found == existing_window.end() ?
NULp : found->second;
1297 aws =
new AW_window_simple;
1299 aws->init(aww->
get_root(),
"COLOR_RANGE_EDIT",
"Edit color ranges");
1302 aws->auto_space(5, 5);
1305 aws->create_button(
"CLOSE",
"CLOSE",
"C");
1307 aws->create_button(
"HELP",
"HELP",
"H");
1310 aws->label(
"Overlay active range");
1317 existing_window[gcmgr] = aws;
1328 AW_window_simple *aws =
new AW_window_simple;
1330 aws->init(aw_root, wid, windowname);
1333 aws->auto_space(2, 2);
1336 aws->create_button(
"CLOSE",
"CLOSE",
"C");
1338 aws->create_button(
"HELP",
"HELP",
"H");
1344 allFont_fake_desc.
colorlabel =
"<all fonts>";
1349 aws->label_length(STD_LABEL_LEN);
1350 aws->label(
"All fonts:");
1351 aws->button_length(COLOR_BUTTON_LEN);
1352 aws->create_button(
"select_all_fonts",
"Select",
"s");
1357 bool groups_or_range =
false;
1360 aws->create_autosize_button(
"EDIT_COLOR_GROUP",
"Edit color groups",
"E");
1361 groups_or_range =
true;
1365 aws->create_autosize_button(
"EDIT_COLOR_RANGE",
"Edit color ranges",
"r");
1366 groups_or_range =
true;
1368 if (groups_or_range) aws->at_newline();
1393 if (AW_gc_manager::show_range_overlay) {
1394 Vector size(xsize, ysize);
1397 int gc = first_range_gc +
y*AW_PLANAR_COLORS+x;
1398 Vector toCorner(x*xsize,
y*ysize);
1429 #if defined(UNIT_TESTS)
1434 AW_gc_manager::use_color_groups =
true;
1462 AW_hsv(
float hue,
float saturation,
float value) : H(hue), S(saturation), V(value) {
1481 if (max == R) { H *= 0 + (G-B)/(max-min); }
1482 else if (max == G) { H *= 2 + (B-R)/(max-min); }
1483 else { H *= 4 + (R-
G)/(max-min); }
1488 S = max ? (max-
min)/max : 0;
1493 #else // !defined(Cxx11)
1502 float q = V*(1-S*f);
1503 float t = V*(1-S*(1-f));
1517 float h()
const {
return H; }
1518 float s()
const {
return S; }
1519 float v()
const {
return V; }
1530 void TEST_rgb_hsv_conversion() {
1533 const int tested[] = {
1539 998, 999, 1000, 1001, 1002,
1540 32766, 32767, 32768, 32769, 32770,
1541 39998, 39999, 40000, 40001, 40002,
1542 65531, 65532, 65533, 65534, 65535
1545 for (
unsigned i = 0; i<
ARRAY_ELEMS(tested); ++i) {
1547 for (
unsigned j = 0; j<
ARRAY_ELEMS(tested); ++j) {
1549 for (
unsigned k = 0; k<
ARRAY_ELEMS(tested); ++k) {
1566 const int MAXDIFF = 1;
1567 const int MAXDIFFSUM = 2;
1578 for (
unsigned i = 0; i<
ARRAY_ELEMS(tested); ++i) {
1579 int h = tested[i]*320/65535;
1580 for (
unsigned j = 0; j<
ARRAY_ELEMS(tested); ++j) {
1581 float s = tested[j]/65535.0;
1582 for (
unsigned k = 0; k<
ARRAY_ELEMS(tested); ++k) {
1583 float v = tested[k]/65535.0;
1593 const int MAXDIFF = 1;
1594 const int MAXDIFFSUM = 2;
1621 #endif // UNIT_TESTS
1629 #define AWAR_SELECTOR_COLOR_LABEL "tmp/aw/color_label"
1631 #define AWAR_CV_R "tmp/aw/color_r" // rgb..
1632 #define AWAR_CV_G "tmp/aw/color_g"
1633 #define AWAR_CV_B "tmp/aw/color_b"
1634 #define AWAR_CV_H "tmp/aw/color_h" // hsv..
1635 #define AWAR_CV_S "tmp/aw/color_s"
1636 #define AWAR_CV_V "tmp/aw/color_v"
1643 color_value_change_was_ignored =
false;
1667 if (ignore_color_value_change) {
1668 color_value_change_was_ignored =
true;
1678 if (h>=360.0) h -= 360;
1704 static const char *colorValueAwars[] = {
1710 for (
int cv = 0; cv<6; ++cv) {
1718 static AW_window_simple *aws =
NULp;
1722 aws =
new AW_window_simple;
1723 aws->init(awr,
"COLORS",
"Select color");
1729 aws->auto_space(3, 3);
1731 aws->create_button(
"CLOSE",
"CLOSE",
"C");
1733 aws->button_length(20);
1738 aws->get_at_position(&x2, &y2);
1750 const int INPUTFIELD_WIDTH = 12;
1751 const int SCALERLENGTH = 320;
1753 for (
int row = 0; row<3; ++row) {
1754 aws->at(x1, y1+(row+1)*(y2-y1));
1755 const ColorValue *vc = &colorValue[row*2];
1756 aws->label(vc->label);
1757 aws->create_input_field_with_scaler(vc->awar, INPUTFIELD_WIDTH, SCALERLENGTH,
AW_SCALER_LINEAR);
1759 aws->label(vc->label);
1760 aws->create_input_field_with_scaler(vc->awar, INPUTFIELD_WIDTH, SCALERLENGTH,
AW_SCALER_LINEAR);
1763 aws->button_length(1);
1766 const float SATVAL_INCREMENT = 0.2;
1767 const int HUE_INCREMENT = 10;
1768 const int COLORS_PER_ROW = 360/HUE_INCREMENT;
1770 for (
int v = 5; v>=2; --v) {
1771 float val = v*SATVAL_INCREMENT;
1773 for (
int s = rev ? 2 : 5; rev ? s<=5 : s>=2; s = rev ? s+1 : s-1) {
1774 float sat = s*SATVAL_INCREMENT;
1775 for (
int hue = 0; hue<360; hue += HUE_INCREMENT) {
1777 aws->callback(makeWindowCallback(
aw_set_color, strdup(color_name)));
1778 aws->create_button(color_name,
"",
NULp, color_name);
1784 for (
int p = 0; p<COLORS_PER_ROW; ++p) {
1785 float grey = (1.0 * p) / (COLORS_PER_ROW-1);
1788 aws->callback(makeWindowCallback(
aw_set_color, strdup(color_name)));
1789 aws->create_button(color_name,
"=",
NULp, color_name);
1796 freedup(current_color_awarname, awar_name);
1804 #define AWAR_SELECTOR_FONT_LABEL "tmp/aw/font_label"
1805 #define AWAR_SELECTOR_FONT_NAME "tmp/aw/font_name"
1806 #define AWAR_SELECTOR_FONT_SIZE "tmp/aw/font_size"
1817 static AW_window_simple *aw_fontChoose[2] = {
NULp,
NULp };
1821 AW_window_simple*& aws = aw_fontChoose[fixed_width_only];
1822 AW_window_simple*& awo = aw_fontChoose[!fixed_width_only];
1827 aws =
new AW_window_simple;
1828 aws->init(awr,
"FONT", fixed_width_only ?
"Select fixed width font" :
"Select font");
1830 aws->auto_space(10, 10);
1833 aws->create_button(
"CLOSE",
"CLOSE",
"C");
1835 aws->button_length(20);
1839 aws->label(
"Font:");
1842 int fonts_inserted = 0;
1843 for (
int order = 1; order>=0; order--) {
1844 for (
int font_nr = 0; ; font_nr++) {
1850 fprintf(stderr,
"[Font detection: tried=%i, found=%i]\n", font_nr, fonts_inserted);
1854 if (found !=
bool(order))
continue;
1857 aws->insert_option(font_string,
NULp, font_nr);
1861 if (!fonts_inserted) aws->insert_option(
"No suitable fonts detected",
NULp, 0);
1862 aws->insert_default_option(
"<no font selected>",
NULp,
NO_FONT);
1863 aws->update_option_menu();
1868 aws->label(
"Size:");
1879 if (awo) awo->hide();
1887 aw_message(
"Sorry, to activate new colors:\n"
1888 " save properties\n"
1889 " and restart application");
1907 aws->
insert_option(
"helvetica-bold-12",
"9",
"helvetica-bold-12");
1909 aws->
insert_option(
"helvetica-bold-13",
"9",
"helvetica-bold-13");
1921 AW_window_simple *aws =
new AW_window_simple;
1922 const int tabstop = 400;
1923 aws->init(root,
"PROPS_FRAME",
"WINDOW_PROPERTIES");
1926 aws->button_length(20);
1929 aws->auto_space(10, 10);
1932 aws->create_button(
"CLOSE",
"CLOSE",
"C");
1935 aws->create_button(
"HELP",
"HELP",
"H");
1941 aws->create_input_field(
"window/font", 12);
1945 aws->button_length(10);
1948 aws->create_input_field(
"window/background", 12);
1954 aws->create_input_field(
"window/foreground", 12);
1960 aws->create_input_field(
"window/color_1", 12);
1966 aws->create_input_field(
"window/color_2", 12);
1973 aws->create_input_field(
"window/color_3", 12);
static bool ignore_color_value_change
#define AWAR_COLOR_GROUPS_PREFIX
GB_ERROR GB_check_key(const char *key) __ATTR__USERESULT
void insert_option(AW_label choice_label, const char *mnemonic, const char *var_value, const char *name_of_color=NULp)
AW_window * AW_create_gc_window_named(AW_root *aw_root, AW_gc_manager *gcman, const char *wid, const char *windowname)
bool font_has_fixed_width(AW_font aw_font_nr)
void add_gc(const char *gc_description, int &gc, gc_type type, const char *id_prefix=NULp)
void reserve_gcs(const char *gc_description, int &gc)
static void gc_color_changed_cb(AW_root *, AW_gc_manager *mgr, int idx)
bool has_variable_width_font() const
void put(const char *elem)
void button_length(int length)
#define TEST_EXPECT_SIMILAR(expr, want, epsilon)
#define AWAR_SELECTOR_FONT_LABEL
const char * fontsize_awarname(const char *gcman_id, const string &colname)
const char * awarname_active_range() const
#define implicated(hypothesis, conclusion)
return string(buffer, length)
void insert_menu_topic(const char *id, const char *name, const char *mnemonic, const char *help_text_, AW_active mask, const WindowCallback &wcb)
static void aw_set_rgb_sliders(AW_root *awr, const AW_rgb_normalized &col)
bool AW_color_groups_active()
void init_color_ranges(int &gc)
const char * defaultColorgroupName(int color_group)
void set_line_attributes(int gc, short width, AW_linestyle style)
static void colorslider_changed_cb(AW_root *awr, bool hsv_changed)
void set_function(int gc, AW_function function)
void establish_default(int gc)
bool belongs_to_range() const
void AW_popup_gc_color_range_window(AW_window *aww, AW_gc_manager *gcmgr)
AW_rgb_normalized get_color(int idx, const AW_gc_manager *gcman) const
void AW_reactivate_all_advices(AW_window *)
reactivates all advices which were disabled by the user
static char * current_color_awarname
const char * AW_get_font_specification(AW_font font_nr, bool &found)
GB_ERROR save_properties(const char *filename=NULp) __ATTR__USERESULT
void AW_forget_all_window_geometry(AW_window *aww)
const char * fontinfo_awarname(const char *gcman_id, const string &colname)
static void AW_preset_create_color_button(AW_window *aws, const char *awar_name, const char *label)
AW_awar * set_minmax(float min, float max)
static void gc_fontOrSize_changed_cb(AW_root *, AW_gc_manager *mgr, int idx)
static void aw_create_font_chooser_window(AW_window *aww, const char *gc_base_name, const struct gc_desc *gcd)
const string & get_id() const
void add_color(const string &colordef, AW_gc_manager *gcman)
const char * GBS_global_string(const char *templat,...)
bool has_color_range() const
void AW_advice(const char *message, AW_Advice_Type type, const char *title, const char *corresponding_help)
Show a message box with an advice for the user.
int get_range_index() const
int AW_font_2_xfig(AW_font font_nr)
void GBK_terminatef(const char *templat,...)
void AW_POPDOWN(AW_window *window)
void AW_insert_common_property_menu_entries(AW_window_menu_modes *awmm)
static void range_overlay_changed_cb(AW_root *awr, AW_gc_manager *gcmgr)
char * GBS_string_2_key(const char *str)
void cat(const char *from)
AW_hsv(float hue, float saturation, float value)
const char * AW_getActiveColorRangeID(AW_gc_manager *gcman, int *dimension)
char * ARB_strpartdup(const char *start, const char *end)
void AW_activateColorRange(AW_gc_manager *gcman, const char *id)
#define AWAR_COLOR_GROUPS_USE
void create_gc_buttons(AW_window *aww, gc_type for_gc_type)
const gc_desc & get_gc_desc(int idx) const
void add_color_groups(int &gc)
const string & get_name() const
static void color_group_name_changed_cb(AW_root *awr)
gc_range(const string &name_, gc_range_type type_, int index_, int gc_index_)
const char * rgbValue(bool for_edit4)
AW_gc_manager * AW_manage_GC(AW_window *aww, const char *gc_base_name, AW_device *device, int base_drag, AW_GCM_AREA area, const GcChangedCallback &changecb, const char *default_background_color,...)
#define ARRAY_ELEMS(array)
void update_option_menu()
void aw_set_color(AW_root *awr, const char *color_name)
static void AW_popup_gc_color_groups_window(AW_window *aww, AW_gc_manager *gcmgr)
AW_awar * add_callback(const RootCallback &cb)
const char * ascii() const
const char * AW_get_color_groups_active_awarname()
static HelixNrInfo * start
const char * default_colorgroup_name(int color_group)
GB_ERROR GB_check_hkey(const char *key) __ATTR__USERESULT
const char * read_char_pntr() const
static void create_font_button(AW_window *aws, const char *gc_base_name, const gc_desc &gcd)
static AW_root * SINGLETON
int AW_get_drag_gc(AW_gc_manager *gcman)
static const int COLOR_BUTTON_LEN
WindowCallback makeHelpCallback(const char *helpfile)
#define TEST_EXPECT(cond)
void update_all_fonts(bool sizeChanged) const
void set_font(int gc, AW_font fontnr, int size, int *found_size)
#define AWAR_SELECTOR_COLOR_LABEL
std::map< AW_gc_manager *, AW_window_simple * > GroupWindowRegistry
void set_foreground_color(int gc, AW_color_idx color)
static void active_range_changed_cb(AW_root *awr, AW_gc_manager *gcman)
static const char * default_color(int cset, int elem)
int get_color_index() const
const char * awarname(const char *awarname_template, int idx)
void set_changed_cb(const GcChangedCallback &ccb)
static bool color_groups_initialized()
AW_awar * awar_float(const char *var_name, float default_value=0.0, AW_default default_file=AW_ROOT_DEFAULT)
void AW_save_properties(AW_window *aw)
static void all_fontsOrSizes_changed_cb(AW_root *, const AW_gc_manager *mgr, bool sizeChanged)
void fake_AW_init_color_groups()
#define AWAR_SELECTOR_FONT_NAME
static void aw_set_sliders_from_color(AW_root *awr)
AW_window * AW_create_gc_window(AW_root *aw_root, AW_gc_manager *gcman)
AW_rgb_normalized rgb() const
const char * parse_decl(const char *decl, const char *id_prefix)
static void error(const char *msg)
static void aw_create_colorslider_awars(AW_root *awr)
static bool color_value_change_was_ignored
const char * fontname_awarname(const char *gcman_id, const string &colname)
void add_gc_range(const char *gc_description)
AW_window * AW_preset_window(AW_root *root)
void label(const char *label)
int build_range_gc_number(int range_idx, int color_idx)
AW_hsv(const AW_rgb16 &col)
static void add_common_property_menu_entries(AW_window *aw)
static const char ** color_group_defaults
gc_desc(int gc_, gc_type type_)
void AW_copy_GC_colors(AW_root *aw_root, const char *source_gcman, const char *dest_gcman, const char *id0,...)
char * read_string() const
static bool show_range_overlay
const char * get_current_color(int idx) const
#define AW_COLOR_GROUP_NAME_LEN
const char * gcman_specific_awarname(const char *tpl, const char *gcman_id, const char *localpart)
AW_awar * awar(const char *awar)
void AW_reactivate_all_questions(AW_window *)
void getColorRangeNames(int dimension, ConstStrArray &ids, ConstStrArray &names) const
string name2ID(const char *name)
void trigger_changed_cb(GcChange whatChanged) const
void insert_default_option(AW_label choice_label, const char *mnemonic, const char *var_value, const char *name_of_color=NULp)
#define AWAR_SELECTOR_FONT_SIZE
char * AW_get_color_group_name(AW_root *awr, int color_group)
void delay_changed_callbacks(bool suppress) const
static const int STD_LABEL_LEN
static ColorGroupDef color_group_def[AW_COLOR_GROUPS+1]
int get_dimension() const
void create_input_field(const char *awar_name, int columns=0)
gc_range_type get_type() const
const char * colorgroupname_awarname(int color_group)
AW_awar * awar_int(const char *var_name, long default_value=0, AW_default default_file=AW_ROOT_DEFAULT)
void AW_displayColorRange(AW_device *device, int first_range_gc, AW::Position start, AW_pos xsize, AW_pos ysize)
void activateColorRange(const char *id)
#define IF_ASSERTION_USED(x)
void AW_getColorRangeNames(const AW_gc_manager *gcman, int dimension, ConstStrArray &ids, ConstStrArray &names)
void update_gc_color(int idx) const
static void aw_create_color_chooser_window(AW_window *aww, const char *awar_name, const char *color_description)
const char * getActiveColorRangeID(int *dimension) const
bool is_color_group() const
bool has_color_groups() const
static const int FONT_BUTTON_LEN
AW_gc_manager(const char *name, AW_device *device_, int drag_gc_offset_, AW_window *aww_, int colorindex_base_)
AW_awar * map(const char *awarn)
void init_all_fonts() const
static void aw_message_reload(AW_root *)
static void color_group_use_changed_cb(AW_root *awr, AW_gc_manager *gcmgr)
const char * get_base_name() const
STATIC_ASSERT(AW_PLANAR_COLORS *AW_PLANAR_COLORS==AW_RANGE_COLORS)
void aw_message(const char *msg)
AW_option_menu_struct * create_option_menu(const char *awar_name)
void AW_save_specific_properties(AW_window *aw, const char *filename)
void active_range_changed_cb(AW_root *awr)
static bool use_color_groups
int first_range_gc() const
static void aw_create_font_chooser_awars(AW_root *awr)
GB_ERROR write_string(const char *aw_string)
#define AWAR_RANGE_OVERLAY
void update_range_gc_color(int idx, const char *color) const
static void create_color_button(AW_window *aws, const char *awar_name, const char *color_description)
void AW_init_color_group_defaults(const char *for_program)
void update_gc_font(int idx) const
void callback(const WindowCallback &cb)
bool box(int gc, AW::FillStyle filled, const AW::Rectangle &rect, AW_bitset filteri=AW_ALL_DEVICES_SCALED)
AW_awar * awar_string(const char *var_name, const char *default_value="", AW_default default_file=AW_ROOT_DEFAULT)
GB_ERROR write_float(float aw_float)
AW_hsv(const AW_rgb_normalized &col)
const char * gc_awarname(const char *tpl, const char *gcman_id, const string &colname)
#define AW_SPATIAL_COLORS
void label_length(int length)
void GBT_splitNdestroy_string(ConstStrArray &names, char *&namelist, const char *separator, SplitMode mode)
void update_colors(const AW_gc_manager *gcman) const
static void AW_preset_create_font_chooser(AW_window *aws, const char *awar, const char *label, bool message_reload)
#define TEST_EXPECT_EQUAL(expr, want)
GB_ERROR write_int(long aw_int)
AW_color_idx alloc_named_data_color(int colnum, const char *colorname)
const char * AW_get_font_shortname(AW_font font_nr)
const char * gcman_awarname(const char *gcman_id, const char *localpart)
size_t get_position() const
char * GBS_global_string_copy(const char *templat,...)
void create_button(const char *macro_name, AW_label label, const char *mnemonic=NULp, const char *color=NULp)
#define AW_COLOR_GROUP_PREFIX
int AW_getFirstRangeGC(AW_gc_manager *gcman)
const char * color_awarname(const char *gcman_id, const string &colname)
CONSTEXPR_INLINE bool valid_color_group(int color_group)
GB_write_int const char s