This is an automatic generated email to let you know that the following patch were queued at the http://git.linuxtv.org/xawtv3.git tree:
Subject: Remove the legacy xfs connection for FB Author: Mauro Carvalho Chehab <[email protected]> Date: Wed Feb 2 20:56:04 2011 -0200 Modern X11 configurations don't listen to port 7100 anymore. So, this code will fail. Signed-off-by: Mauro Carvalho Chehab <[email protected]> Makefile.in | 2 +- console/fbtv.c | 7 -- console/fs.c | 214 -------------------------------------------------------- 3 files changed, 1 insertions(+), 222 deletions(-) --- http://git.linuxtv.org/xawtv3.git?a=commitdiff;h=9673593e19886d2ca65ff7a5abb990c039673eee diff --git a/Makefile.in b/Makefile.in index c7e0b01..fc8d920 100644 --- a/Makefile.in +++ b/Makefile.in @@ -34,7 +34,7 @@ X11_FLAGS := @X_CFLAGS@ @XFT_FLAGS@ -I/usr/include/X11/fonts LIB_FLAGS := -I. -I./vbistuff -I./x11 \ -I$(srcdir)/jwz -I$(srcdir)/common -I$(srcdir)/console \ -I$(srcdir)/x11 -I$(srcdir)/structs \ - -I$(srcdir)/libng -Llibng -LlibFS + -I$(srcdir)/libng -Llibng # various libraries ATHENA_LIBS := @X_LIBS@ @XFT_LIBS@ @LIBS@ @ATHENA@ diff --git a/console/fbtv.c b/console/fbtv.c index 9b3201d..015abd6 100644 --- a/console/fbtv.c +++ b/console/fbtv.c @@ -60,9 +60,6 @@ static char *fontfile = NULL; static char *mode = NULL; static char *joydev = NULL; static struct fs_font *f; -#ifndef X_DISPLAY_MISSING -static char *x11_font = "10x20"; -#endif static unsigned short red[256], green[256], blue[256]; static struct fb_cmap cmap = { 0, 256, red, green, blue }; @@ -328,10 +325,6 @@ text_init(char *font) if (NULL == f) f = fs_consolefont(font ? fonts : NULL); -#ifndef X_DISPLAY_MISSING - if (NULL == f && 0 == fs_connect(NULL)) - f = fs_open(font ? font : x11_font); -#endif if (NULL == f) { fprintf(stderr,"no font available\n"); exit(1); diff --git a/console/fs.c b/console/fs.c index 4f129e0..534a131 100644 --- a/console/fs.c +++ b/console/fs.c @@ -42,9 +42,6 @@ static const unsigned fs_masktab[] = { /* ------------------------------------------------------------------ */ -#ifndef X_DISPLAY_MISSING -static FSServer *svr; -#endif static unsigned int bpp,black,white; static void (*setpixel)(void *ptr, unsigned int color); @@ -185,124 +182,11 @@ void fs_render_tty(FSXCharInfo *charInfo, unsigned char *data) /* ------------------------------------------------------------------ */ -#ifndef X_DISPLAY_MISSING -/* connect to font server */ -int fs_connect(char *servername) -{ - if (NULL == servername) - servername = getenv("FONTSERVER"); - if (NULL == servername) - servername = "unix/:7100"; - svr = FSOpenServer(servername); - if (NULL == svr) { - if (NULL == FSServerName(servername)) { - fprintf(stderr, "no font server defined\n"); - } else { - fprintf(stderr, "unable to open server \"%s\"\n", - FSServerName(servername)); - } - return -1; - } - return 0; -} - -/* load font from font server */ -struct fs_font* fs_open(char *pattern) -{ - int nnames = 1; - int available,high,low,encoding,bpr; - char **fonts; - unsigned char *glyph; - Font dummy; - FSBitmapFormat format; - FSXCharInfo *charInfo; - struct fs_font *f = NULL; - - if (NULL == svr) { - fprintf(stderr,"fs: not connected\n"); - return NULL; - } - - fonts = FSListFonts(svr, pattern, nnames, &available); - if (0 == available) { - fprintf(stderr,"fs: font not available [%s]\n",pattern); - goto out; - } - fprintf(stderr,"using x11 font \"%s\"\n",fonts[0]); - - f = malloc(sizeof(*f)); - memset(f,0,sizeof(*f)); - f->font = FSOpenBitmapFont(svr, 0, 0, fonts[0], &dummy); - FSFreeFontNames(fonts); - if (0 == f->font) - goto out; - - FSQueryXInfo(svr,f->font,&f->fontHeader, &f->propInfo, - &f->propOffsets, &f->propData); - format = BYTE_ORDER | BIT_ORDER | SCANLINE_UNIT | SCANLINE_PAD | EXTENTS; - FSQueryXExtents16(svr, f->font, True, (FSChar2b *) 0, 0, &f->extents); - FSQueryXBitmaps16(svr, f->font, format, True, (FSChar2b *) 0, 0, - &f->offsets, &f->glyphs); - - f->maxenc = (f->fontHeader.char_range.max_char.high+1) << 8; - f->width = f->fontHeader.max_bounds.right - f->fontHeader.min_bounds.left; - f->height = f->fontHeader.max_bounds.ascent + f->fontHeader.max_bounds.descent; - f->eindex = malloc(f->maxenc * sizeof(FSXCharInfo*)); - f->gindex = malloc(f->maxenc * sizeof(unsigned char*)); - memset(f->eindex,0,f->maxenc * sizeof(FSXCharInfo*)); - memset(f->gindex,0,f->maxenc * sizeof(unsigned char*)); - - glyph = f->glyphs; - charInfo = f->extents; - for (high = f->fontHeader.char_range.min_char.high; - high <= f->fontHeader.char_range.max_char.high; - high++) { - for (low = f->fontHeader.char_range.min_char.low; - low <= f->fontHeader.char_range.max_char.low; - low++) { - bpr = GLWIDTHBYTESPADDED((charInfo->right - charInfo->left), - SCANLINE_PAD_BYTES); - encoding = (high<<8) + low; -#ifdef TTY - fprintf(stdout,"e=0x%x | w=%d l=%d r=%d | a=%d d=%d\n", - encoding,charInfo->width,charInfo->left, - charInfo->right,charInfo->ascent,charInfo->descent); -#endif - if ((charInfo->width != 0) || (charInfo->right != charInfo->left)) { - f->gindex[encoding] = glyph; - f->eindex[encoding] = charInfo; -#ifdef TTY - fs_render_tty(f->eindex[encoding], - f->gindex[encoding]); -#endif - } - glyph += (charInfo->descent + charInfo->ascent) * bpr; - charInfo++; - } - } - return f; - - out: - if (f) - fs_free(f); - return NULL; -} -#endif void fs_free(struct fs_font *f) { if (f->gindex) free(f->gindex); -#if 0 - if (f->extents) - FSFree((char *) f->extents); - if (f->offsets) - FSFree((char *) f->offsets); - if (f->propOffsets) - FSFree((char *) (f->propOffsets)); - if (f->propData) - FSFree((char *) (f->propData)); -#endif #if 0 /* FIXME */ if (f->glyphs) FSFree((char *) f->glyphs); @@ -402,101 +286,3 @@ struct fs_font* fs_consolefont(char **filename) } -#ifdef TESTING -/* ------------------------------------------------------------------ */ -/* for testing */ - -int debug; - -/* list fonts */ -int fs_ls(char *pattern) -{ - int nnames = 16; - int available,i; - char **fonts; - - if (NULL == svr) { - fprintf(stderr,"fs: not connected\n"); - return -1; - } - - fonts = FSListFonts(svr, pattern, nnames, &available); - while (nnames <= available) { - nnames *= 2; - FSFreeFontNames(fonts); - fonts = FSListFonts(svr, pattern, nnames, &available); - } - for (i = 0; i < available; i++) { - fprintf(stderr,"%s\n",fonts[i]); - } - FSFreeFontNames(fonts); - return 0; -} - -void dump_charset(struct fs_font *f) -{ - unsigned char *pos; - int c,x,y; - - x = 0, y = 0; - for (c = 0; c < f->maxenc; c++) { - if (NULL == f->eindex[c]) - continue; - pos = fb_mem+fb_mem_offset; - pos += fb_fix.line_length * (y+f->height-f->eindex[c]->ascent); - pos += x*bpp; - fs_render_fb(pos,fb_fix.line_length,f->eindex[c],f->gindex[c]); - x += f->eindex[c]->right-f->eindex[c]->left+1; - if (x > fb_var.xres - f->width) { - x = 0; - y += f->height+1; - } - if (y > fb_var.yres - f->height) - break; - } -} - -int main(int argc, char *argv[]) -{ - struct fs_font *f = NULL; - unsigned char dummy[42]; - int fd; - - if (argc < 2) { - fprintf(stderr,"missing arg\n"); - exit(1); - } - - /* try font server */ - if (-1 != fs_connect(NULL)) { - fs_ls(argv[1]); - f = fs_open(argv[1]); - if (NULL == f) - fprintf(stderr,"no such font\n"); - } - - /* try console font */ - if (NULL == f) - f = fs_consolefont(NULL); - if (NULL == f) - exit(1); - -#ifdef TTY - exit(1); -#endif - - fd = fb_init(NULL, NULL, 0); - fb_cleanup_fork(); - fb_switch_init(); - fs_init_fb(); - - if (argc < 3) { - dump_charset(f); - } else { - fs_puts(f,0,0,argv[2]); - } - fgets(dummy,42,stdin); - - return 0; -} -#endif _______________________________________________ linuxtv-commits mailing list [email protected] http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits
