Esempio n. 1
0
static void
render_glyph(int32 x, int32 y, uint8 glyph, uint8 attr)
{
	// we're ASCII only
	if (glyph > 127)
		glyph = 127;

	if (sConsole.depth >= 8) {
		uint8* base = (uint8*)(sConsole.frame_buffer
			+ sConsole.bytes_per_row * y * CHAR_HEIGHT
			+ x * CHAR_WIDTH * sConsole.bytes_per_pixel);
		uint8* color = get_palette_entry(foreground_color(attr));
		uint8* backgroundColor = get_palette_entry(background_color(attr));

		for (y = 0; y < CHAR_HEIGHT; y++) {
			uint8 bits = FONT[CHAR_HEIGHT * glyph + y];
			for (x = 0; x < CHAR_WIDTH; x++) {
				for (int32 i = 0; i < sConsole.bytes_per_pixel; i++) {
					if (bits & 1)
						base[x * sConsole.bytes_per_pixel + i] = color[i];
					else {
						base[x * sConsole.bytes_per_pixel + i]
							= backgroundColor[i];
					}
				}
				bits >>= 1;
			}

			base += sConsole.bytes_per_row;
		}
	} else {
Esempio n. 2
0
void OSDPretty::Load() {
  QSettings s;
  s.beginGroup(kSettingsGroup);

  foreground_color_ = QColor(s.value("foreground_color", 0).toInt());
  background_color_ = QColor(s.value("background_color", kPresetBlue).toInt());
  background_opacity_ = s.value("background_opacity", 0.85).toDouble();
  popup_display_ = s.value("popup_display", -1).toInt();
  popup_pos_ = s.value("popup_pos", QPoint(0, 0)).toPoint();
  font_.fromString(s.value("font", "Verdana,9,-1,5,50,0,0,0,0,0").toString());
  disable_duration_ = s.value("disable_duration", false).toBool();

  set_font(font());
  set_foreground_color(foreground_color());
}
Esempio n. 3
0
struct html_editor::action_type
html_editor::m_action_definitions[] = {
#define QN QT_TR_NOOP
#define NA QWebPage::NoWebAction

  // {name, shortcut, icon, WebAction
  {QN("Bold"), QN("Ctrl+B"), "icon-bold.png", SLOT(bold()), NA }
  ,{QN("Italic"), QN("Ctrl+I"), "icon-italic.png", SLOT(italic()), NA }
  ,{QN("Underline"), QN("Ctrl+U"), "icon-underline.png", SLOT(underline()), NA }
  ,{QN("Strike through"), QN("Ctrl+S"), "icon-strikethrough.png", SLOT(strikethrough()) , NA}
  ,{QN("Superscript"), NULL, "icon-superscript.png", SLOT(superscript()), NA }
  ,{QN("Subscript"), NULL, "icon-subscript.png", SLOT(subscript()), NA }

  // separator before 6
  ,{QN("Set foreground color"), NULL, "icon-foreground-color.png", SLOT(foreground_color()), NA }
  ,{QN("Set background color"), NULL, "icon-background-color.png", SLOT(background_color()), NA }
  ,{QN("Insert image"), NULL, "icon-image.png", SLOT(insert_image()), NA }
  ,{QN("Insert link"), NULL, "icon-link.png", SLOT(insert_link()), NA }
  ,{QN("Insert horizontal rule"), NULL, "icon-hr.png", SLOT(insert_hr()), NA }
  ,{QN("Insert unordered list"), NULL, "icon-bullet-list.png", SLOT(insert_unordered_list()), NA }
  ,{QN("Insert ordered list"), NULL, "icon-ordered-list.png", SLOT(insert_ordered_list()), NA }
  ,{QN("Remove format"), NULL, "icon-eraser.png", SLOT(remove_format()), NA }
  ,{QN("Cut"), NULL, "icon-cut.png", NULL, QWebPage::Cut }
  ,{QN("Copy"), NULL, "icon-copy.png", NULL, QWebPage::Copy }
  ,{QN("Paste"), NULL, "icon-paste.png", NULL, QWebPage::Paste }
  ,{QN("Undo"), QN("Ctrl+Z"), "icon-undo.png", NULL, QWebPage::Undo }
  ,{QN("Redo"), NULL, "icon-redo.png", NULL, QWebPage::Redo }
  ,{QN("Align left"), NULL, "icon-align-left.png", SLOT(align_left()), NA }
  ,{QN("Justify"), NULL, "icon-justify.png", SLOT(justify()), NA }
  ,{QN("Align right"), NULL, "icon-align-right.png", SLOT(align_right()), NA }