diff options
Diffstat (limited to 'console-client')
-rw-r--r-- | console-client/Makefile | 13 | ||||
-rw-r--r-- | console-client/current-vcs.c | 14 | ||||
-rw-r--r-- | console-client/vga-dynafont.c | 56 | ||||
-rw-r--r-- | console-client/vga.c | 4 |
4 files changed, 45 insertions, 42 deletions
diff --git a/console-client/Makefile b/console-client/Makefile index bf1335b0..22a492a9 100644 --- a/console-client/Makefile +++ b/console-client/Makefile @@ -1,6 +1,6 @@ # # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2004, -# 2005, 2008 Free Software Foundation, Inc. +# 2005, 2008, 2010 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as @@ -22,8 +22,7 @@ makemode := utilities targets = console CONSOLE_SRCS = console.c timer.c driver.c trans.c VGA_SO_SRCS = bdf.c vga-dynafont.c vga-dynacolor.c vga-support.c vga.c -#PC_KBD_SO_SRCS = pc-kbd.c kdioctlServer.o kbd-repeat.c -PC_KBD_SO_SRCS = pc-kbd.c kdioctlServer.c kbd-repeat.c +PC_KBD_SO_SRCS = pc-kbd.c kbd-repeat.c PC_MOUSE_SO_SRCS = pc-mouse.c GENERIC_SPEAKER_SO_SRCS = generic-speaker.c CURRENT_VCS_SO_SRCS = current-vcs.c @@ -35,9 +34,10 @@ SRCS = $(CONSOLE_SRCS) \ $(GENERIC_SPEAKER_SO_SRCS) $(CURRENT_VCS_SO_SRCS) $(NCURSESW_SO_SRCS) LCLHDRS = timer.h driver.h display.h input.h bell.h \ unicode.h bdf.h mach-inputdev.h \ - vga-dynafont.h vga-dynacolor.h vga-hw.h vga.h + vga-dynafont.h vga-dynacolor.h vga-hw.h vga-support.h \ + trans.h -OBJS = $(SRCS:.c=.o) +OBJS = $(SRCS:.c=.o) kdioctlServer.o HURDLIBS = cons threads ports netfs fshelp iohelp ihash shouldbeinlibc LDLIBS = -ldl module-dir = $(libdir)/hurd/console @@ -60,7 +60,8 @@ modules = vga pc_kbd generic_speaker pc_mouse current_vcs vga-CPPFLAGS = -DDEFAULT_VGA_FONT_DIR=\"${datadir}/hurd/\" vga.so.$(hurd-version): $(patsubst %.c,%_pic.o,$(VGA_SO_SRCS)) -pc_kbd.so.$(hurd-version): $(patsubst %.c,%_pic.o,$(PC_KBD_SO_SRCS)) +pc_kbd.so.$(hurd-version): $(patsubst %.c,%_pic.o,$(PC_KBD_SO_SRCS)) \ + kdioctlServer_pic.o pc_mouse.so.$(hurd-version): $(patsubst %.c,%_pic.o,$(PC_MOUSE_SO_SRCS)) generic_speaker.so.$(hurd-version): $(patsubst %.c,%_pic.o,$(GENERIC_SPEAKER_SO_SRCS)) current_vcs.so.$(hurd-version): $(patsubst %.c,%_pic.o,$(CURRENT_VCS_SO_SRCS)) diff --git a/console-client/current-vcs.c b/console-client/current-vcs.c index a86c6708..1b63e0ba 100644 --- a/console-client/current-vcs.c +++ b/console-client/current-vcs.c @@ -167,7 +167,7 @@ static struct argp argp = {options, parse_opt, 0, doc}; /* Initialize the current VCS driver. */ static error_t -vcs_repeat_init (void **handle, int no_exit, int argc, char *argv[], int *next) +current_vcs_init (void **handle, int no_exit, int argc, char *argv[], int *next) { error_t err; int pos = 1; @@ -184,7 +184,7 @@ vcs_repeat_init (void **handle, int no_exit, int argc, char *argv[], int *next) } static error_t -vcs_repeat_start (void *handle) +current_vcs_start (void *handle) { error_t err; @@ -206,7 +206,7 @@ vcs_repeat_start (void *handle) } static error_t -vcs_repeat_fini (void *handle, int force) +current_vcs_fini (void *handle, int force) { console_unregister_consnode (vcs_node); console_destroy_consnode (vcs_node); @@ -214,10 +214,10 @@ vcs_repeat_fini (void *handle, int force) } -struct driver_ops driver_vcs_repeat_ops = +struct driver_ops driver_current_vcs_ops = { - vcs_repeat_init, - vcs_repeat_start, - vcs_repeat_fini + current_vcs_init, + current_vcs_start, + current_vcs_fini }; diff --git a/console-client/vga-dynafont.c b/console-client/vga-dynafont.c index 0cce5176..3e0ec3ff 100644 --- a/console-client/vga-dynafont.c +++ b/console-client/vga-dynafont.c @@ -1,5 +1,5 @@ /* vga-dynafont.c - Dynamic font handling for VGA cards. - Copyright (C) 2002 Free Software Foundation, Inc. + Copyright (C) 2002, 2010 Free Software Foundation, Inc. Written by Marcus Brinkmann. This file is part of the GNU Hurd. @@ -60,9 +60,9 @@ struct mapped_character /* Remember the character this glyph belongs to, so the glyph can be reloaded when the font is changed. This is actually a wchar_t with some text attributes mixed into the high bits. */ -#define WCHAR_BOLD ((wchar_t) 0x40000000) -#define WCHAR_ITALIC ((wchar_t) 0x20000000) -#define WCHAR_MASK ((wchar_t) 0x001fffff) +#define WCHAR_BOLD ((wchar_t) 0x20000000) +#define WCHAR_ITALIC ((wchar_t) 0x10000000) +#define WCHAR_MASK CONS_WCHAR_MASK wchar_t character; /* Used by libihash for fast removal of elements. */ @@ -541,14 +541,13 @@ dynafont_new (bdf_font_t font, bdf_font_t font_italic, bdf_font_t font_bold, glyph = bdf_find_glyph (df->font, -1, UNICODE_REPLACEMENT_CHARACTER); if (glyph) { - /* XXX Take glyph size into account. */ - for (int i = 0; i < ((df->font->bbox.height > 32) - ? 32 : df->font->bbox.height); i++) + for (int i = 0; i < ((glyph->bbox.height > 32) + ? 32 : glyph->bbox.height); i++) df->vga_font[FONT_INDEX_UNKNOWN][i] - = glyph->bitmap[i * ((df->font->bbox.width + 7) / 8)]; - if (df->font->bbox.height < 32) + = glyph->bitmap[i * ((glyph->bbox.width + 7) / 8)]; + if (glyph->bbox.height < 32) memset (((char *) df->vga_font[FONT_INDEX_UNKNOWN]) - + df->font->bbox.height, 0, 32 - df->font->bbox.height); + + glyph->bbox.height, 0, 32 - glyph->bbox.height); /* Update the hash table. */ hurd_ihash_add (&df->charmap, UNICODE_REPLACEMENT_CHARACTER, chr); @@ -780,9 +779,9 @@ dynafont_lookup_internal (dynafont_t df, bdf_font_t font, || (!lgc && !df->vga_font_free_indices)) return 0; - glyph = bdf_find_glyph (font, (int) wide_chr, 0); + glyph = bdf_find_glyph (font, (int) (wide_chr & ~CONS_WCHAR_CONTINUED), 0); if (!glyph) - glyph = bdf_find_glyph (font, -1, (int) wide_chr); + glyph = bdf_find_glyph (font, -1, (int) (wide_chr & ~CONS_WCHAR_CONTINUED)); if (!glyph) return 0; @@ -847,14 +846,17 @@ dynafont_lookup_internal (dynafont_t df, bdf_font_t font, chr->refs = 1; chr->character = (wide_chr | attr); - /* XXX Should look at glyph bbox. */ - for (int i = 0; i < ((font->bbox.height > 32) - ? 32 : font->bbox.height); i++) - df->vga_font[pos][i] - = glyph->bitmap[i * ((font->bbox.width + 7) / 8)]; - if (font->bbox.height < 32) - memset (((char *) df->vga_font[pos]) - + font->bbox.height, 0, 32 - font->bbox.height); + /* Copy the glyph bitmap, taking into account double-width charcters. */ + { + int height = (glyph->bbox.height > 32) ? 32 : glyph->bbox.height; + int bwidth = (glyph->bbox.width + 7) / 8; + int ofs = (bwidth >= 2) && (wide_chr & CONS_WCHAR_CONTINUED); + + for (int i = 0; i < height; i++) + df->vga_font[pos][i] = glyph->bitmap[i * bwidth + ofs]; + if (height < 32) + memset (&df->vga_font[pos][height], 0, 32 - height); + } if (active_dynafont == df) vga_write_font_buffer (0, pos, df->vga_font[pos], @@ -958,7 +960,7 @@ dynafont_activate (dynafont_t df) display problems for the user if we don't also program the video mode timings. The standard font height for 80x25 is 16. */ vga_set_font_height (height); - vga_set_font_width (df->font->bbox.width <= 8 ? 8 : 9); + vga_set_font_width (df->font->bbox.width % 8 ? 9 : 8); active_dynafont = df; dynafont_set_cursor (df, df->cursor_standout); @@ -1027,13 +1029,13 @@ dynafont_change_font (dynafont_t df, bdf_font_t font) else { /* XXX Take font size and glyph size into account. */ - for (int j = 0; j < ((df->font->bbox.height > 32) - ? 32 : df->font->bbox.height); j++) + for (int j = 0; j < ((glyph->bbox.height > 32) + ? 32 : glyph->bbox.height); j++) df->vga_font[i][j] - = glyph->bitmap[j * ((df->font->bbox.width + 7) / 8)]; - if (df->font->bbox.height < 32) - memset (((char *) df->vga_font[i]) + df->font->bbox.height, - 0, 32 - df->font->bbox.height); + = glyph->bitmap[j * ((glyph->bbox.width + 7) / 8)]; + if (glyph->bbox.height < 32) + memset (((char *) df->vga_font[i]) + glyph->bbox.height, + 0, 32 - glyph->bbox.height); } } } diff --git a/console-client/vga.c b/console-client/vga.c index 3cc2135a..4693c664 100644 --- a/console-client/vga.c +++ b/console-client/vga.c @@ -244,11 +244,11 @@ parse_opt (int key, char *arg, struct argp_state *state) break; case 'm': - vga_display_max_glyphs = 1; + vga_display_max_glyphs = 0; break; case 'g': - vga_display_max_glyphs = 0; + vga_display_max_glyphs = 1; break; case ARGP_KEY_END: |