Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 6 Dec 2012 21:05:41 GMT
From:      Brooks Davis <brooks@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 219891 for review
Message-ID:  <201212062105.qB6L5f6r059071@skunkworks.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://p4web.freebsd.org/@@219891?ac=10

Change 219891 by brooks@brooks_zenith on 2012/12/06 21:04:43

	Make all file matches case insensitive for more reliable FAT support.
	
	Extend the edges of full height normal slides.
	
	Make the radio button style controls look slighly more like radio
	buttons by using (*) instead of [*].

Affected files ...

.. //depot/projects/ctsrd/cheribsd/src/ctsrd/cheripoint/cheripoint.c#18 edit

Differences ...

==== //depot/projects/ctsrd/cheribsd/src/ctsrd/cheripoint/cheripoint.c#18 (text+ko) ====

@@ -74,7 +74,7 @@
 uint32_t header_height;
 uint32_t *busyarea, *hourglass;
 enum sbtype sb = SB_CHERI;
-enum mtl_display_mode res = MTL_DM_720x480;
+enum mtl_display_mode res = MTL_DM_800x480;
 static int zombies_waiting = 0;
 
 int *slidep;
@@ -184,10 +184,10 @@
  * The screen looks like:
  *
  * Sandbox        Resolution
- * [*] None       [ ] 800x480
- * [ ] Capsicum   [*] 720x480
- * [ ] CHERI      [ ] 640x480 (Left)
- *                [ ] 640x480 (Centered)
+ * (*) None       ( ) 800x480
+ * ( ) Capsicum   (*) 720x480
+ * ( ) CHERI      ( ) 640x480 (Left)
+ *                ( ) 640x480 (Centered)
  * [ ] Visible
  *
  */
@@ -258,7 +258,7 @@
 	    textbuf, f_width * CD_SB_COLS, f_height);
 
 	fb_fill_buf(textbuf, white, f_width * CD_SB_COLS, f_height);
-	sprintf(text, "[%c] None", sb == SB_NONE ? '*' : ' ');
+	sprintf(text, "(%c) None", sb == SB_NONE ? '*' : ' ');
 	fb_render_text(text, 2, black, white, textbuf,
 	    f_width * CD_SB_COLS, f_height);
 	fb_composite(dbuf, d_width, d_height,
@@ -266,7 +266,7 @@
 	    textbuf, f_width * CD_SB_COLS, f_height);
 
 	fb_fill_buf(textbuf, white, f_width * CD_SB_COLS, f_height);
-	sprintf(text, "[%c] Capsicum", sb == SB_CAPSICUM ? '*' : ' ');
+	sprintf(text, "(%c) Capsicum", sb == SB_CAPSICUM ? '*' : ' ');
 	fb_render_text(text, 2, black, white, textbuf,
 	    f_width * CD_SB_COLS, f_height);
 	fb_composite(dbuf, d_width, d_height,
@@ -274,7 +274,7 @@
 	    textbuf, f_width * CD_SB_COLS, f_height);
 
 	fb_fill_buf(textbuf, white, f_width * CD_SB_COLS, f_height);
-	sprintf(text, "[%c] CHERI", sb == SB_CHERI ? '*' : ' ');
+	sprintf(text, "(%c) CHERI", sb == SB_CHERI ? '*' : ' ');
 	fb_render_text(text, 2, black, white, textbuf,
 	    f_width * CD_SB_COLS, f_height);
 	fb_composite(dbuf, d_width, d_height,
@@ -297,7 +297,7 @@
 	    textbuf, f_width * CD_RES_COLS, f_height);
 
 	fb_fill_buf(textbuf, white, f_width * CD_RES_COLS, f_height);
-	sprintf(text, "[%c] 800x480", res == MTL_DM_800x480 ? '*' : ' ');
+	sprintf(text, "(%c) 800x480", res == MTL_DM_800x480 ? '*' : ' ');
 	fb_render_text(text, 2, black, white, textbuf,
 	    f_width * CD_RES_COLS, f_height);
 	fb_composite(dbuf, d_width, d_height,
@@ -305,7 +305,7 @@
 	    textbuf, f_width * CD_RES_COLS, f_height);
 
 	fb_fill_buf(textbuf, white, f_width * CD_RES_COLS, f_height);
-	sprintf(text, "[%c] 720x480", res == MTL_DM_720x480 ? '*' : ' ');
+	sprintf(text, "(%c) 720x480", res == MTL_DM_720x480 ? '*' : ' ');
 	fb_render_text(text, 2, black, white, textbuf,
 	    f_width * CD_RES_COLS, f_height);
 	fb_composite(dbuf, d_width, d_height,
@@ -313,7 +313,7 @@
 	    textbuf, f_width * CD_RES_COLS, f_height);
 
 	fb_fill_buf(textbuf, white, f_width * CD_RES_COLS, f_height);
-	sprintf(text, "[%c] 640x480 (Left)", res == MTL_DM_640x480 ? '*' : ' ');
+	sprintf(text, "(%c) 640x480 (Left)", res == MTL_DM_640x480 ? '*' : ' ');
 	fb_render_text(text, 2, black, white, textbuf,
 	    f_width * CD_RES_COLS, f_height);
 	fb_composite(dbuf, d_width, d_height,
@@ -321,7 +321,7 @@
 	    textbuf, f_width * CD_RES_COLS, f_height);
 
 	fb_fill_buf(textbuf, white, f_width * CD_RES_COLS, f_height);
-	sprintf(text, "[%c] 640x480 (Centered)",
+	sprintf(text, "(%c) 640x480 (Centered)",
 	    res == MTL_DM_640x480_CENTER ? '*' : ' ');
 	fb_render_text(text, 2, black, white, textbuf,
 	    f_width * CD_RES_COLS, f_height);
@@ -471,7 +471,7 @@
 			fb_fill_region(is->buffer[r * is->width],
 			    0, r, fcol, 1);
 	}
-	if (is->width < (uint)fb_width) {
+	if (is->width < (uint)fb_width - fcol) {
 		/* Right extend the image if needed */
 		for (r = 0; r < is->height; r++)
 			fb_fill_region(is->buffer[((r + 1) * is->width) - 1],
@@ -564,14 +564,33 @@
 	default:
 		break;
 	}
-	iboxstate_free(is);
 
-	/* Skip the rest in the full height image case */
+	/* 
+	 * If the image is full height, then left and right extend the
+	 * edges and skip further compositing
+	 */
 	if (y == 0) {
+		if (x > 0) {
+			/* Left extend the image if needed */
+			for (r = 0; r < is->height; r++)
+				fb_fill_region(is->buffer[r * is->width],
+				    0, r, x, 1);
+		}
+		if (x + is->width < (uint)fb_width) {
+			/* Right extend the image if needed */
+			for (r = 0; r < is->height; r++)
+				fb_fill_region(is->buffer[((r + 1) *
+				    is->width) - 1],
+				    x + is->width, r,
+				    fb_width - (x + is->width), 1);
+		}
+		iboxstate_free(is);
 		unbusy();
 		return (0);
 	}
 
+	iboxstate_free(is);
+
 	busy(0);
 
 	/* put an SRI logo in the lower left corner */
@@ -890,10 +909,10 @@
 		if (entry->d_type != DT_REG)
 			continue;
 		/* Skip obvious non-PNGs */
-		if (fnmatch("*.[pP][nN][gG]", entry->d_name, 0) != 0)
+		if (fnmatch("*.png", entry->d_name, FNM_CASEFOLD) != 0)
 			continue;
 
-		if (fnmatch("*-cover-*.png", entry->d_name, 0) == 0)
+		if (fnmatch("*-cover-*.png", entry->d_name, FNM_CASEFOLD) == 0)
 			addslide(&ncovers, &maxcovers, &covers, entry->d_name);
 		else
 			addslide(&nslides, &maxslides, &slides, entry->d_name);
@@ -906,10 +925,15 @@
 	slide = *slidep;
 	for (;;) {
 		gesture = 0;
+		/* If there isn't a cover, skip over it */
+		if (slide == 0 && ncovers == 0)
+			slide = 1;
+
 		if (slide == 0) {
 			asprintf(&coverpat, "*-cover-%d.png", slide_width);
 			for (cover = 0; cover < ncovers; cover++)
-				if (fnmatch(coverpat, covers[cover], 0) == 0)
+				if (fnmatch(coverpat, covers[cover],
+				    FNM_CASEFOLD) == 0)
 					break;
 			free(coverpat);
 			if (cover == ncovers)
@@ -981,7 +1005,7 @@
 			set_display_mode(res);
 			break;
 		case TSG_EAST:
-			if (slide == 0)
+			if (slide == 0 || (slide == 1 && ncovers == 0))
 				slide = nslides;
 			else
 				slide--;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201212062105.qB6L5f6r059071>