Date: Tue, 17 Jul 2012 23:25:39 GMT From: Brooks Davis <brooks@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 214532 for review Message-ID: <201207172325.q6HNPd5D076048@skunkworks.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://p4web.freebsd.org/@@214532?ac=10 Change 214532 by brooks@brooks_ecr_current on 2012/07/17 23:25:33 Move the busy_indicator() code and support files to the touch screen library. Add a new type of dialog box to facilitate a (not yet working) text viewer. Add png viewing support the the browser. Hide most browser output under a -v flag so it doesn't clutter up pictview's text console. Affected files ... .. //depot/projects/ctsrd/beribsd/src/ctsrd-lib/libde4tc/Makefile#4 edit .. //depot/projects/ctsrd/beribsd/src/ctsrd-lib/libde4tc/de4tc.c#9 edit .. //depot/projects/ctsrd/beribsd/src/ctsrd-lib/libde4tc/de4tc.h#9 edit .. //depot/projects/ctsrd/beribsd/src/ctsrd-lib/libde4tc/images/Makefile#1 add .. //depot/projects/ctsrd/beribsd/src/ctsrd-lib/libde4tc/images/busy0.png#1 branch .. //depot/projects/ctsrd/beribsd/src/ctsrd-lib/libde4tc/images/busy0.svg#1 branch .. //depot/projects/ctsrd/beribsd/src/ctsrd-lib/libde4tc/images/busy1.png#1 branch .. //depot/projects/ctsrd/beribsd/src/ctsrd-lib/libde4tc/images/busy1.svg#1 branch .. //depot/projects/ctsrd/beribsd/src/ctsrd/browser/browser.c#12 edit .. //depot/projects/ctsrd/beribsd/src/ctsrd/browser/images/Makefile#2 edit .. //depot/projects/ctsrd/beribsd/src/ctsrd/browser/images/browser.png#2 edit .. //depot/projects/ctsrd/beribsd/src/ctsrd/pictview/img/Makefile#3 edit .. //depot/projects/ctsrd/beribsd/src/ctsrd/pictview/img/busy0.png#2 delete .. //depot/projects/ctsrd/beribsd/src/ctsrd/pictview/img/busy0.svg#2 delete .. //depot/projects/ctsrd/beribsd/src/ctsrd/pictview/img/busy1.png#2 delete .. //depot/projects/ctsrd/beribsd/src/ctsrd/pictview/img/busy1.svg#2 delete .. //depot/projects/ctsrd/beribsd/src/ctsrd/pictview/pictview.c#10 edit Differences ... ==== //depot/projects/ctsrd/beribsd/src/ctsrd-lib/libde4tc/Makefile#4 (text+ko) ==== @@ -17,4 +17,6 @@ #WARNS?= 0 +SUBDIR= images + .include <bsd.lib.mk> ==== //depot/projects/ctsrd/beribsd/src/ctsrd-lib/libde4tc/de4tc.c#9 (text+ko) ==== @@ -152,7 +152,7 @@ struct tsstate* ts_poll(void) { - struct timespec stime = {0, 0.1}; + struct timespec stime = {0, 1000000}; static struct tsstate *sp; int init = 0; struct tsstate tmp_s; @@ -430,9 +430,22 @@ * PNG image loader *****************************************************************************/ -void +int read_png_file(const char* file_name, u_int32_t* imgbuf, int maxwidth, int maxheight) { + int fd, ret; + + fd = open(file_name, O_RDONLY); + if (fd < 0) + return(-1); + ret = read_png_fd(fd, imgbuf, maxwidth, maxheight); + /* read_png_fd() closes the file */ + return (ret); +} + +int +read_png_fd(int fd, u_int32_t* imgbuf, int maxwidth, int maxheight) +{ unsigned char header[8]; // 8 is the maximum size that can be checked size_t tmp; int x,y; @@ -448,23 +461,23 @@ int bppx; // bytes per pixel /* open file and test for it being a png */ - FILE *fp = fopen(file_name, "rb"); + FILE *fp = fdopen(fd, "rb"); if (!fp) - err(1,"fopen - failed to read from %s",file_name); + return (-1); tmp=fread(header, 1, 8, fp); if (png_sig_cmp(header, 0, 8)) - err(1,"file %s not PNG", file_name); + return (-1); png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); if (!png_ptr) - err(1,"png_create_read_struct failed"); + return (-1); info_ptr = png_create_info_struct(png_ptr); if (!info_ptr) - err(1,"png_create_info_struct failed"); + return (-1); if (setjmp(png_jmpbuf(png_ptr))) - err(1,"Error during init_io"); + return (-1); png_init_io(png_ptr, fp); png_set_sig_bytes(png_ptr, 8); @@ -476,20 +489,17 @@ colour_type = png_get_color_type(png_ptr, info_ptr); bit_depth = png_get_bit_depth(png_ptr, info_ptr); - //printf("image=%s, width=%1d, height=%1d, colour_type=%1d, bit_depth=%1d\n", - // file_name, width, height, colour_type, bit_depth); - if((colour_type != PNG_COLOR_TYPE_RGB) && (colour_type != 6)) - err(1,"colour type is not RGB - panic!"); + return (-1); if(bit_depth != 8) - err(1,"bit depth is not 8 - panic!"); + return (-1); number_of_passes = png_set_interlace_handling(png_ptr); png_read_update_info(png_ptr, info_ptr); /* read file */ if (setjmp(png_jmpbuf(png_ptr))) - err(1,"Error during read_image"); + return (-1); row_pointers = (png_bytep*) malloc(sizeof(png_bytep) * height); @@ -530,8 +540,37 @@ for(y=height; y<maxheight; y++) for(x=0; x<maxwidth; x++) imgbuf[x+y*maxwidth] = 0; + + return (0); } + +/***************************************************************************** + * Busy indicator for startup sequence, etc + *****************************************************************************/ + +static int busy_indicator_state = -1; +static u_int32_t* busy_indicator_imgs[2]; + +void +busy_indicator(void) +{ + int x0 = (fb_width-64)/2; + int y0 = (fb_height-64)/2; + + if(busy_indicator_state<0) { // initialisation phase + fb_fill(fb_colour(0,0,0)); + busy_indicator_imgs[0] = malloc(sizeof(u_int32_t) * 64 * 64); + busy_indicator_imgs[1] = malloc(sizeof(u_int32_t) * 64 * 64); + read_png_file("/usr/share/images/busy0.png", busy_indicator_imgs[0], 64, 64); + read_png_file("/usr/share/images/busy1.png", busy_indicator_imgs[1], 64, 64); + busy_indicator_state = 0; + } + busy_indicator_state = (busy_indicator_state+1) & 0x1; + fb_post_region(busy_indicator_imgs[busy_indicator_state], x0, y0, 64, 64); +} + + #define FBD_BORDER_LWIDTH 2 #define FBD_BORDER_SPACE 3 #define FBD_BORDER_WIDTH (FBD_BORDER_LWIDTH + FBD_BORDER_SPACE * 2) @@ -548,6 +587,8 @@ struct tsstate *ts; titlewidth = strlen(title) * fb_get_font_width() * 2; + if (titlewidth + FBD_BORDER_WIDTH * 2 > fb_width) + titlewidth = fb_width - FBD_BORDER_WIDTH * 2; titleheight = fb_get_font_height() * 2; textlines = 0; @@ -565,18 +606,17 @@ textlines++; textwidth = (linewidth > textwidth) ? linewidth : textwidth; textwidth *= fb_get_font_width() * 2; + if (textwidth + FBD_BORDER_WIDTH * 2 > fb_width) + textwidth = fb_width - FBD_BORDER_WIDTH * 2; textheight = fb_get_font_height() * 2; + if (textheight + FBD_BORDER_WIDTH * 2 + titleheight > fb_height) + textheight = fb_height - FBD_BORDER_WIDTH * 2 + titleheight; maxwidth = (textwidth > titlewidth) ? textwidth : titlewidth; - dwidth = FBD_BORDER_WIDTH + maxwidth + FBD_BORDER_WIDTH; - if (dwidth > fb_width) - errx(1, "text too wide"); dheight = FBD_BORDER_WIDTH + titleheight + FBD_BORDER_WIDTH + textheight * textlines + FBD_BORDER_WIDTH; - if (dheight > fb_height) - errx(1, "text too tall"); x0 = (fb_width - dwidth) / 2; y0 = (fb_height - dheight) / 2; @@ -657,6 +697,23 @@ return(FBDA_OK); } } + case FBDT_PINCH_OR_VSCROLL: + for (;;) { + ts = ts_poll(); + switch (ts->ts_gesture) { + case TSG2_ZOOM_OUT: + fb_post(bgimage); + return(FBDA_OK); + case TSG_NORTH: + case TSG2_NORTH: + fb_post(bgimage); + return(FBDA_DOWN); + case TSG_SOUTH: + case TSG2_SOUTH: + fb_post(bgimage); + return(FBDA_UP); + } + } default: err(1, "Unhandled dialog type"); } ==== //depot/projects/ctsrd/beribsd/src/ctsrd-lib/libde4tc/de4tc.h#9 (text+ko) ==== @@ -61,11 +61,14 @@ FBDA_CANCEL, FBDA_OK, FBDA_YES, - FBDA_NO + FBDA_NO, + FBDA_DOWN, + FBDA_UP } fb_dialog_action; typedef enum { FBDT_PINCH2CLOSE, + FBDT_PINCH_OR_VSCROLL, #ifdef NOTYET FBDT_OK, FBDT_OKCANCEL, @@ -116,7 +119,10 @@ void fb_fade2text(int textbg_alpha); void plot_line(int x1, int y1, int x2, int y2, unsigned int colour); -void read_png_file(const char* file_name, u_int32_t* imgbuf, int maxwidth, int maxheight); +int read_png_file(const char* file_name, u_int32_t* imgbuf, int maxwidth, int maxheight); +int read_png_fd(int fd, u_int32_t* imgbuf, int maxwidth, int maxheight); + +void busy_indicator(void); void fb_load_syscons_font(const char *type, const char *filename); int fb_get_font_height(void); ==== //depot/projects/ctsrd/beribsd/src/ctsrd/browser/browser.c#12 (text+ko) ==== @@ -182,16 +182,18 @@ static u_int32_t *icons; static magic_t magic; static int zombies_waiting = 0; +static int verbose = 0; static void usage(void) { - printf("usage: browser [-f] <dir> <tty>\n"); - printf(" browser [-f] -T <dir>\n"); + printf("usage: browser [-fv] <dir> <tty>\n"); + printf(" browser [-fv] -T <dir>\n"); printf("\n"); printf(" -f Fork and monitor a child instance\n"); printf(" -T Don't open a tty\n"); + printf(" -v Verbose mode\n"); exit(1); } @@ -286,7 +288,6 @@ err(1, "poll"); } if (zombies_waiting) { - printf("zombie!\n"); wait4(pid, &status, 0, NULL); if (WIFEXITED(status) && WEXITSTATUS(status) != 0) { warnx("child exited with %d", @@ -305,10 +306,8 @@ warn("child killed by signal %d", WTERMSIG(status)); } else { - printf("child exited cleanly, exiting\n"); exit(0); } - printf("child exited badly, restarting\n"); zombies_waiting = 0; close(pmaster); /* XXX: should we drain it first? */ fb_fill_region(vwhite(128), 0, 0, fb_width, fb_height); @@ -556,11 +555,13 @@ struct tsstate *ts; int col, i, row; - printf("entering get_action\n"); + if (verbose) + printf("entering get_action\n"); for (;;) { ts = ts_poll(); - printf("gesture = %x\n", ts->ts_gesture); + if (verbose) + printf("gesture = %x\n", ts->ts_gesture); if (ts->ts_gesture == TSG_CLICK) { if (ts->ts_y1 < FROW) { if (ts->ts_x1 > fb_width - 40) @@ -570,7 +571,9 @@ for (col = NCOL - 1; col > 0 && ts->ts_x1 < colstart[col]; col--) /* do nothing */; - printf("row = %d, col = %d\n", row, col); + if (verbose) + printf("row = %d, col = %d\n", + row, col); return (col * NROW + row); } else { if (ts->ts_x1 >= SB_MINCOL && @@ -597,6 +600,89 @@ } static int +show_png(int dfd, const char *name) +{ + int fd; + u_int32_t *image, *previmage; + + image = malloc(sizeof(u_int32_t) * fb_width * fb_height); + previmage = malloc(sizeof(u_int32_t) * fb_width * fb_height); + if (image == NULL || previmage == NULL) + err(1, "malloc"); + fb_save(previmage); + busy_indicator(); + if ((fd = openat(dfd, name, O_RDONLY)) == -1) + return (-1); + busy_indicator(); + if (read_png_fd(fd, image, fb_width, fb_height) != 0) + return (-1); + /* read_png_fd() closes the descriptor */ + fb_post(image); + for (;;) + if(ts_poll()->ts_gesture == TSG2_ZOOM_OUT) + break; + fb_post(previmage); + free(previmage); + free(image); + + return (0); +} + +#ifdef NOTYET +static int +show_text_file(int dfd, const char *name) +{ + FILE *fp; + int fd, i, nlines, topline; + size_t linelen; + fb_dialog_action da; + char *lines[1024], buf[14 * 50]; + + if ((fd = openat(dfd, name, O_RDONLY)) == -1) + return (-1); + if ((fp = fdopen(fd, "rb")) == NULL) + return (-1); + for (nlines = 0; nlines++; nlines++) { + lines[nlines] = NULL; + linelen = 0; + if (getdelim(&lines[nlines], &linelen, '\n', fp) == -1) + break; + if (linelen >= 50) + lines[nlines][50] = '\0'; + } + if (nlines == 0) + return (-1); + + topline = 0; + for (;;) { + buf[0] = '\0'; + /* XXX: inefficient, assumes re-termination above */ + for (i = topline; i < nlines && i < topline + 14; i++) + strcat(buf, lines[i]); + + da = fb_dialog(FBDT_PINCH_OR_VSCROLL, blue, black, blue, + name, buf); + switch (da) { + case FBDA_OK: + for (i = 0; i < nlines; i++) + free(lines[nlines]); + return (0); + case FBDA_UP: + if (topline > 0) + topline -= 14; + break; + case FBDA_DOWN: + if (topline + 14 < nlines) + topline += 14; + break; + default: + err(1, "unhandled action"); + } + } +} +#endif + +static int browsedir(int dfd) { int action, topslot, j, curslot, maxdents, nfd, ndents, retfd; @@ -643,8 +729,9 @@ if (dent->icon == NULL) dent->icon = get_icon(dent->desc); - printf("%2d %20s %s\n", curslot, dent->entry->d_name, - dent->desc); + if (verbose) + printf("%2d %20s %s\n", curslot, dent->entry->d_name, + dent->desc); update_slot(curslot, dent->icon, dent->entry->d_name); } if (curslot == NSLOTS) @@ -652,7 +739,8 @@ for (;;) { action = get_action(); - printf("action %d\n", action); + if (verbose) + printf("action %d\n", action); switch (action) { case ACT_NEXT: if (topslot + curslot < ndents) { @@ -689,8 +777,22 @@ goto render; /* XXX: display error */ retfd = nfd; goto cleanup; + } else if (strcmp("image/png", + dents[topslot + action]->desc) == 0) { + show_png(dfd, + dents[topslot + action]->entry->d_name); + goto render; +#ifdef NOTYET + } else if (strcmp("text/plain", + dents[topslot + action]->desc) == 0) { + show_text_file(dfd, + dents[topslot + action]->entry->d_name); + goto render; +#endif } else { - printf ("opening non-directory not supported\n"); + if (verbose) + printf("opening non-directory not " + "supported\n"); goto render; } } @@ -715,7 +817,7 @@ int ch, dfd; int ttyflag = 1, forkflag = 0; - while ((ch = getopt(argc, argv, "fT")) != -1) { + while ((ch = getopt(argc, argv, "fTv")) != -1) { switch (ch) { case 'f': forkflag = 1; @@ -723,6 +825,9 @@ case 'T': ttyflag = 0; break; + case 'v': + verbose++; + break; default: usage(); } @@ -741,21 +846,27 @@ } fb_init(); + busy_indicator(); + fb_fade2on(); fb_load_syscons_font(NULL, "/usr/share/syscons/fonts/iso-8x16.fnt"); + busy_indicator(); if (forkflag) fork_child(); + busy_indicator(); init_magic(); + busy_indicator(); init_bgimage(); + busy_indicator(); icons = malloc(sizeof(u_int32_t) * ICON_WH * 640); if (icons == NULL) err(1, "malloc"); read_png_file(ICONS, icons, 32, 640); + busy_indicator(); fb_post(bgimage); - fb_fade2on(); //fb_fade2text(127); fb_text_cursor(255, 255); ==== //depot/projects/ctsrd/beribsd/src/ctsrd/browser/images/Makefile#2 (text+ko) ==== @@ -1,7 +1,8 @@ # From: @(#)Makefile 8.1 (Berkeley) 6/8/93 # $FreeBSD: src/share/misc/Makefile,v 1.27 2007/12/19 01:28:17 imp Exp $ -FILES= browser.png +FILES= browser.png \ + icons.png NO_OBJ= BINDIR?= ${SHAREDIR} ==== //depot/projects/ctsrd/beribsd/src/cts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ׯ#77^^^P__vqPRRMk41|p8"6J9m\ No newline at end of file ==== //depot/projects/ctsrd/beribsd/src/ctsrd/pictview/img/Makefile#3 (text+ko) ==== @@ -8,8 +8,6 @@ Quill.png \ Terminal.png \ browser-thumb.png \ - busy0.png \ - busy1.png \ keyboardA.png \ keyboardC.png \ keyboardN.png \ ==== //depot/projects/ctsrd/beribsd/src/ctsrd/pictview/pictview.c#10 (text+ko) ==== @@ -362,38 +362,6 @@ /***************************************************************************** - * Busy indicator for startup sequence - *****************************************************************************/ - -static int busy_indicator_state = -1; -static u_int32_t* busy_indicator_imgs[2]; - - -void -busy_indicator(void) -{ - int x,y; - int x0 = (fb_width-64)/2; - int y0 = (fb_height-64)/2; - if(busy_indicator_state<0) { // initialisation phase - int j; - fb_fill(fb_colour(0,0,0)); - for(j=0; j<2; j++) - busy_indicator_imgs[j] = (u_int32_t*) malloc(sizeof(u_int32_t) * 64 * 64); - read_png_file("/usr/share/images/busy0.png", busy_indicator_imgs[0], 64, 64); - read_png_file("/usr/share/images/busy1.png", busy_indicator_imgs[1], 64, 64); - busy_indicator_state = 0; - } - busy_indicator_state = (busy_indicator_state+1) & 0x1; - for(y=0; y<64; y++) - for(x=0; x<64; x++) { - fb_putpixel(x0+x, y0+y, busy_indicator_imgs[busy_indicator_state][x+y*64]); - } - fb_fade2on(); -} - - -/***************************************************************************** * Picture viewer including PNG image loader *****************************************************************************/ @@ -700,6 +668,7 @@ fb_fade2off(); busy_indicator(); + fb_fade2on(); pictview_init(); keyboard_init();
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201207172325.q6HNPd5D076048>