Exemplo n.º 1
0
void GUIXGetWindowColours( gui_window * wnd, gui_colour_set * colours )
{
    int i;

    for( i = 0; i < wnd->num_attrs; i++ ) {
        colours[i].fore = GetColour( GETFG( wnd->colours[i] ) );
        colours[i].back = GetColour( GETBG( wnd->colours[i] ) );
    }
}
Exemplo n.º 2
0
/*
 * vga_set_textattr:
 * @vga: VGAtext object
 * @textattr: VGA text attribute byte
 *
 * Set the VGAText's graphics context to use the text attribute given using
 * the current VGA palette.  May not actually result in a call to the
 * graphics server, since redundant calls may be optimized out.
 */
static void
vga_set_textattr(VGAText *vga, guchar textattr)
{
	guchar fg, bg;
	
	/* 
	 * Blink logic for text attributes
	 * -----------------------------------
	 * 
	 * has no blink bit: normal (fg = fg, bg = bg)
	 * has blink bit, icecolor: high intensity bg (bg = hi(bg))
	 * has blink bit, no icecolor, blink_state off: fg = bg [hide]
	 * has blink bit, no icecolor, blink_state on: normal (fg = fg)
	 */ 
	if (!GETBLINK(textattr))
	{
		fg = GETFG(textattr);
		bg = GETBG(textattr);
	}
	else if (vga->pvt->icecolor)
	{	/* High intensity background / iCEColor */
		fg = GETFG(textattr);
		bg = BRIGHT(GETBG(textattr));
	}
	else if (vga->pvt->blink_state)
	{	/* Blinking, but in on state so it appears normal */
		fg = GETFG(textattr);
		bg = GETBG(textattr);

		if (vga->pvt->blink_timeout_id == -1)
			vga_start_blink_timer(vga);
	}
	else
	{	/* Hide, blink off state */
		fg = GETBG(textattr);
		bg = GETBG(textattr);

		if (vga->pvt->blink_timeout_id == -1)
			vga_start_blink_timer(vga);
	}

	if (vga->pvt->fg != fg)
	{
#ifdef USE_DEPRECATED_GDK
		gdk_gc_set_rgb_fg_color(vga->pvt->gc,
			vga_palette_get_color(vga->pvt->pal, fg));
#else
		/* Nothing we can really do like this */
#endif
		vga->pvt->fg = fg;
	}
	if (vga->pvt->bg != bg)
	{
#ifdef USE_DEPRECATED_GDK
		gdk_gc_set_rgb_bg_color(vga->pvt->gc,
			vga_palette_get_color(vga->pvt->pal, bg));
#else
#endif
		vga->pvt->bg = bg;
	}
}
Exemplo n.º 3
0
gui_colour GUIGetFore( ATTR attr )
{
    return( GETFG( attr ) );
}