f->output_method = output_haiku;
f->output_data.haiku = xzalloc (sizeof *f->output_data.haiku);
f->output_data.haiku->wait_for_event_type = -1;
+ f->output_data.haiku->relief_background = -1;
fset_icon_name (f, gui_display_get_arg (dpyinfo, parms, Qicon_name,
"iconName", "Title",
f->output_method = output_haiku;
f->output_data.haiku = xzalloc (sizeof *f->output_data.haiku);
f->output_data.haiku->wait_for_event_type = -1;
+ f->output_data.haiku->relief_background = -1;
f->tooltip = true;
fset_icon_name (f, Qnil);
struct face *face = s->face;
double h, cs, l;
uint32_t rgbin;
+ struct haiku_output *di;
- prepare_face_for_display (s->f, s->face);
rgbin = (face->use_box_color_for_shadows_p
? face->box_color : face->background);
+ di = FRAME_OUTPUT_DATA (s->f);
if (s->hl == DRAW_CURSOR)
rgbin = FRAME_CURSOR_COLOR (s->f).pixel;
- rgb_color_hsl (rgbin, &h, &cs, &l);
- hsl_color_rgb (h, cs, fmin (1.0, fmax (0.2, l) * 0.6), rgbout_b);
- hsl_color_rgb (h, cs, fmin (1.0, fmax (0.2, l) * 1.2), rgbout_w);
+ if (di->relief_background != rgbin)
+ {
+ di->relief_background = rgbin & 0xffffffff;
+
+ rgb_color_hsl (rgbin, &h, &cs, &l);
+ hsl_color_rgb (h, cs, fmin (1.0, fmax (0.2, l) * 0.6),
+ &di->black_relief_pixel);
+ hsl_color_rgb (h, cs, fmin (1.0, fmax (0.2, l) * 1.2),
+ &di->white_relief_pixel);
+ }
+
+ *rgbout_w = di->white_relief_pixel;
+ *rgbout_b = di->black_relief_pixel;
}
static void
/* The type of any event that's being waited for. */
int wait_for_event_type;
+
+ /* The "dark" color of the current relief. */
+ uint32_t black_relief_pixel;
+
+ /* The "light" color of the current relief. */
+ uint32_t white_relief_pixel;
+
+ /* The background for which the relief colors above were computed.
+ They are changed only when a different background is involved.
+ -1 means no color has been computed. */
+ long relief_background;
};
struct x_output