| 38 | defaultHiliteState = HiliteNormalMap; |
| 39 | |
| 40 | void |
| 41 | getpos_sethilite( |
| 42 | void (*gp_hilitef)(boolean), |
| 43 | boolean (*gp_getvalidf)(coordxy, coordxy)) |
| 44 | { |
| 45 | boolean (*old_getvalid)(coordxy, coordxy) = getpos_getvalid; |
| 46 | uint32 old_map_frame_color = gw.wsettings.map_frame_color; |
| 47 | struct selectionvar *sel = selection_new(); |
| 48 | |
| 49 | defaultHiliteState = iflags.bgcolors ? HiliteBackground : HiliteNormalMap; |
| 50 | if (gp_getvalidf != old_getvalid) |
| 51 | getpos_hilite_state = defaultHiliteState; |
| 52 | |
| 53 | getpos_getvalids_selection(sel, getpos_getvalid); |
| 54 | getpos_hilitefunc = gp_hilitef; |
| 55 | getpos_getvalid = gp_getvalidf; |
| 56 | getpos_getvalids_selection(sel, getpos_getvalid); |
| 57 | gw.wsettings.map_frame_color = (getpos_hilite_state == HiliteBackground) |
| 58 | ? HI_ZAP : NO_COLOR; |
| 59 | |
| 60 | if (getpos_getvalid != old_getvalid |
| 61 | || gw.wsettings.map_frame_color != old_map_frame_color) |
| 62 | selection_force_newsyms(sel); |
| 63 | selection_free(sel, TRUE); |
| 64 | } |
| 65 | |
| 66 | /* cycle 'getpos_hilite_state' to its next state; |
| 67 | when 'bgcolors' is Off, it will alternate between not showing valid |
no test coverage detected