[Commit] twin ChangeLog, 1.23, 1.24 twin_button.c, 1.1, 1.2 twin_font.c, 1.13, 1.14 twin_hello.c, 1.2, 1.3

Keith Packard commit at keithp.com
Tue Oct 26 19:46:42 PDT 2004


Committed by: keithp

Update of /local/src/CVS/twin
In directory home.keithp.com:/tmp/cvs-serv19289

Modified Files:
	ChangeLog twin_button.c twin_font.c twin_hello.c 
Log Message:
2004-10-26  Keith Packard  <keithp at keithp.com>

	* twin_button.c: (_twin_button_paint):
	Paint polygons instead of stroked lines for button edges
	
	* twin_font.c: (_twin_text_compute_info):
	Snap origin to pixel grid
	
	* twin_hello.c: (_twin_hello_timeout):
	Strip newline from ctime output


Index: ChangeLog
===================================================================
RCS file: /local/src/CVS/twin/ChangeLog,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- ChangeLog	26 Oct 2004 19:56:18 -0000	1.23
+++ ChangeLog	27 Oct 2004 02:46:39 -0000	1.24
@@ -1,5 +1,16 @@
 2004-10-26  Keith Packard  <keithp at keithp.com>
 
+	* twin_button.c: (_twin_button_paint):
+	Paint polygons instead of stroked lines for button edges
+	
+	* twin_font.c: (_twin_text_compute_info):
+	Snap origin to pixel grid
+	
+	* twin_hello.c: (_twin_hello_timeout):
+	Strip newline from ctime output
+
+2004-10-26  Keith Packard  <keithp at keithp.com>
+
 	* Makefile.am:
 	* twin_button.c: (_twin_button_paint),
 	(_twin_button_set_label_offset), (_twin_button_dispatch),

Index: twin_button.c
===================================================================
RCS file: /local/src/CVS/twin/twin_button.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- twin_button.c	26 Oct 2004 19:56:19 -0000	1.1
+++ twin_button.c	27 Oct 2004 02:46:40 -0000	1.2
@@ -35,7 +35,6 @@
     twin_fixed_t	wf = twin_int_to_fixed (w);
     twin_fixed_t	hf = twin_int_to_fixed (h);
     twin_fixed_t	bf = _twin_button_bw (button);
-    twin_fixed_t	bh = bf / 2;
     twin_argb32_t	top_color, bot_color;
     twin_pixmap_t	*pixmap = button->label.widget.window->pixmap;
     
@@ -51,15 +50,23 @@
 	    top_color = 0x80808080;
 	    bot_color = 0x80000000;
 	}
-	twin_path_move (path, bh, hf-bh);
-	twin_path_draw (path, bh, bh);
-	twin_path_draw (path, wf-bh, bh);
-	twin_paint_stroke (pixmap, top_color, path, bf);
+	twin_path_move (path, 0, 0);
+	twin_path_draw (path, wf, 0);
+	twin_path_draw (path, wf-bf, bf);
+	twin_path_draw (path, bf, bf);
+	twin_path_draw (path, bf, hf-bf);
+	twin_path_draw (path, 0, hf);
+	twin_path_close (path);
+	twin_paint_path (pixmap, top_color, path);
 	twin_path_empty (path);
-	twin_path_move (path, bh, hf-bh);
-	twin_path_draw (path, wf-bh, hf-bh);
-	twin_path_draw (path, wf-bh, bh);
-	twin_paint_stroke (pixmap, bot_color, path, bf);
+	twin_path_move (path, bf, hf-bf);
+	twin_path_draw (path, wf-bf, hf-bf);
+	twin_path_draw (path, wf-bf, bf);
+	twin_path_draw (path, wf, 0);
+	twin_path_draw (path, wf, hf);
+	twin_path_draw (path, 0, hf);
+	twin_path_close (path);
+	twin_paint_path (pixmap, bot_color, path);
 	twin_path_destroy (path);
     }
 }

Index: twin_font.c
===================================================================
RCS file: /local/src/CVS/twin/twin_font.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- twin_font.c	5 Oct 2004 18:42:53 -0000	1.13
+++ twin_font.c	27 Oct 2004 02:46:40 -0000	1.14
@@ -79,8 +79,8 @@
 	info->matrix.m[xi][1] = 0;
 	info->matrix.m[yi][0] = 0;
 	info->matrix.m[yi][1] = TWIN_FIXED_ONE;
-	info->matrix.m[2][0] = twin_sfixed_to_fixed (origin.x);
-	info->matrix.m[2][1] = twin_sfixed_to_fixed (origin.y);
+	info->matrix.m[2][0] = SNAPI(twin_sfixed_to_fixed (origin.x));
+	info->matrix.m[2][1] = SNAPI(twin_sfixed_to_fixed (origin.y));
 	info->scale.x = twin_fixed_mul (path->state.font_size, 
 					path->state.matrix.m[0][xi]);
 	info->reverse_scale.x = twin_fixed_div (TWIN_FIXED_ONE,

Index: twin_hello.c
===================================================================
RCS file: /local/src/CVS/twin/twin_hello.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- twin_hello.c	26 Oct 2004 19:56:19 -0000	1.2
+++ twin_hello.c	27 Oct 2004 02:46:40 -0000	1.3
@@ -24,14 +24,17 @@
 
 #include "twin_hello.h"
 #include <time.h>
+#include <string.h>
 
 static twin_time_t
 _twin_hello_timeout (twin_time_t now, void *closure)
 {
     twin_label_t    *labelb = closure;
     time_t	    secs = time (0);
+    char	    *t = ctime(&secs);
 
-    twin_label_set (labelb, ctime (&secs), 
+    *strchr(t, '\n') = '\0';
+    twin_label_set (labelb, t,
 		    0xff008000,
 		    twin_int_to_fixed (12),
 		    TWIN_TEXT_OBLIQUE);




More information about the Commit mailing list