[Commit] twin ChangeLog, 1.24, 1.25 twin_button.c, 1.2, 1.3 twin_dispatch.c, 1.1, 1.2 twin_draw.c, 1.7, 1.8 twin_hello.c, 1.3, 1.4 twin_pixmap.c, 1.7, 1.8 twin_widget.c, 1.2, 1.3 twinint.h, 1.15, 1.16

Keith Packard commit at keithp.com
Tue Oct 26 23:07:38 PDT 2004


Committed by: keithp

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

Modified Files:
	ChangeLog twin_button.c twin_dispatch.c twin_draw.c 
	twin_hello.c twin_pixmap.c twin_widget.c twinint.h 
Log Message:
2004-10-26  Keith Packard  <keithp at keithp.com>

	* twin_button.c: (_twin_button_paint):
	* twin_widget.c: (_twin_widget_bevel):
	* twinint.h:
	Move bevel routine to twin_widget for sharing
	
	* twin_dispatch.c: (twin_dispatch):
	Change order of timeout vs work, making work come last as
	that's where redisplay occurs.
	
	* twin_draw.c: (twin_fill):
	Oops.  Argument order wrong in twin_pixmap_damage call
	
	* twin_hello.c: (twin_hello_start):
	Make button italic to test
	
	* twin_pixmap.c: (twin_pixmap_damage):
	Change names of formals to match prototype


Index: ChangeLog
===================================================================
RCS file: /local/src/CVS/twin/ChangeLog,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- ChangeLog	27 Oct 2004 02:46:39 -0000	1.24
+++ ChangeLog	27 Oct 2004 06:07:35 -0000	1.25
@@ -1,6 +1,26 @@
 2004-10-26  Keith Packard  <keithp at keithp.com>
 
 	* twin_button.c: (_twin_button_paint):
+	* twin_widget.c: (_twin_widget_bevel):
+	* twinint.h:
+	Move bevel routine to twin_widget for sharing
+	
+	* twin_dispatch.c: (twin_dispatch):
+	Change order of timeout vs work, making work come last as
+	that's where redisplay occurs.
+	
+	* twin_draw.c: (twin_fill):
+	Oops.  Argument order wrong in twin_pixmap_damage call
+	
+	* twin_hello.c: (twin_hello_start):
+	Make button italic to test
+	
+	* twin_pixmap.c: (twin_pixmap_damage):
+	Change names of formals to match prototype
+	
+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):

Index: twin_button.c
===================================================================
RCS file: /local/src/CVS/twin/twin_button.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- twin_button.c	27 Oct 2004 02:46:40 -0000	1.2
+++ twin_button.c	27 Oct 2004 06:07:35 -0000	1.3
@@ -29,46 +29,9 @@
 static void
 _twin_button_paint (twin_button_t *button)
 {
-    twin_path_t		*path = twin_path_create ();
-    twin_coord_t	w = button->label.widget.extents.right - button->label.widget.extents.left;
-    twin_coord_t	h = button->label.widget.extents.bottom - button->label.widget.extents.top;
-    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_argb32_t	top_color, bot_color;
-    twin_pixmap_t	*pixmap = button->label.widget.window->pixmap;
-    
-    if (path)
-    {
-	if (button->active)
-	{
-	    top_color = 0x80000000;
-	    bot_color = 0x80808080;
-	}
-	else
-	{
-	    top_color = 0x80808080;
-	    bot_color = 0x80000000;
-	}
-	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, 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);
-    }
+    _twin_widget_bevel (&button->label.widget, 
+			_twin_button_bw(button),
+			button->active);
 }
 
 static void

Index: twin_dispatch.c
===================================================================
RCS file: /local/src/CVS/twin/twin_dispatch.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- twin_dispatch.c	25 Oct 2004 19:09:36 -0000	1.1
+++ twin_dispatch.c	27 Oct 2004 06:07:35 -0000	1.2
@@ -29,8 +29,8 @@
 {
     for (;;)
     {
-	_twin_run_work ();
 	_twin_run_timeout ();
+	_twin_run_work ();
 	_twin_run_file (_twin_timeout_delay ());
     }
 }

Index: twin_draw.c
===================================================================
RCS file: /local/src/CVS/twin/twin_draw.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- twin_draw.c	25 Oct 2004 19:09:36 -0000	1.7
+++ twin_draw.c	27 Oct 2004 06:07:35 -0000	1.8
@@ -402,5 +402,5 @@
     op = fill[operator][dst->format];
     for (iy = top; iy < bottom; iy++)
 	(*op) (twin_pixmap_pointer (dst, left, iy), src, right - left);
-    twin_pixmap_damage (dst, left, right, top, bottom);
+    twin_pixmap_damage (dst, left, top, right, bottom);
 }

Index: twin_hello.c
===================================================================
RCS file: /local/src/CVS/twin/twin_hello.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- twin_hello.c	27 Oct 2004 02:46:40 -0000	1.3
+++ twin_hello.c	27 Oct 2004 06:07:35 -0000	1.4
@@ -65,7 +65,7 @@
 						  "Button",
 						  0xff800000,
 						  twin_int_to_fixed (18),
-						  TWIN_TEXT_BOLD);
+						  TWIN_TEXT_BOLD|TWIN_TEXT_OBLIQUE);
     twin_widget_set (&labela->widget, 0xc0c0c0c0);
     (void) widget;
     twin_widget_set (&labelb->widget, 0xc0c0c0c0);

Index: twin_pixmap.c
===================================================================
RCS file: /local/src/CVS/twin/twin_pixmap.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- twin_pixmap.c	26 Oct 2004 06:15:42 -0000	1.7
+++ twin_pixmap.c	27 Oct 2004 06:07:35 -0000	1.8
@@ -226,16 +226,16 @@
 }
 
 void
-twin_pixmap_damage (twin_pixmap_t *pixmap,
-		    twin_coord_t x1, twin_coord_t y1,
-		    twin_coord_t x2, twin_coord_t y2)
+twin_pixmap_damage (twin_pixmap_t   *pixmap,
+		    twin_coord_t    left,	twin_coord_t top,
+		    twin_coord_t    right,	twin_coord_t bottom)
 {
     if (pixmap->screen)
 	twin_screen_damage (pixmap->screen,
-			    x1 + pixmap->x,
-			    y1 + pixmap->y,
-			    x2 + pixmap->x,
-			    y2 + pixmap->y);
+			    left + pixmap->x,
+			    top + pixmap->y,
+			    right + pixmap->x,
+			    bottom + pixmap->y);
 }
 
 static twin_argb32_t

Index: twin_widget.c
===================================================================
RCS file: /local/src/CVS/twin/twin_widget.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- twin_widget.c	26 Oct 2004 19:56:19 -0000	1.2
+++ twin_widget.c	27 Oct 2004 06:07:35 -0000	1.3
@@ -122,6 +122,50 @@
 	    0 <= y && y < _twin_widget_height(widget)); 
 }
 
+void
+_twin_widget_bevel (twin_widget_t   *widget,
+		    twin_fixed_t    b,
+		    twin_bool_t	    down)
+{
+    twin_path_t		*path = twin_path_create ();
+    twin_fixed_t	w = twin_int_to_fixed (_twin_widget_width (widget));
+    twin_fixed_t	h = twin_int_to_fixed (_twin_widget_height (widget));
+    twin_argb32_t	top_color, bot_color;
+    twin_pixmap_t	*pixmap = widget->window->pixmap;
+    
+    if (path)
+    {
+	if (down)
+	{
+	    top_color = 0x80000000;
+	    bot_color = 0x80808080;
+	}
+	else
+	{
+	    top_color = 0x80808080;
+	    bot_color = 0x80000000;
+	}
+	twin_path_move (path, 0, 0);
+	twin_path_draw (path, w, 0);
+	twin_path_draw (path, w-b, b);
+	twin_path_draw (path, b, b);
+	twin_path_draw (path, b, h-b);
+	twin_path_draw (path, 0, h);
+	twin_path_close (path);
+	twin_paint_path (pixmap, top_color, path);
+	twin_path_empty (path);
+	twin_path_move (path, b, h-b);
+	twin_path_draw (path, w-b, h-b);
+	twin_path_draw (path, w-b, b);
+	twin_path_draw (path, w, 0);
+	twin_path_draw (path, w, h);
+	twin_path_draw (path, 0, h);
+	twin_path_close (path);
+	twin_paint_path (pixmap, bot_color, path);
+	twin_path_destroy (path);
+    }
+}
+
 twin_widget_t *
 twin_widget_create (twin_box_t	    *parent,
 		    twin_argb32_t   background,

Index: twinint.h
===================================================================
RCS file: /local/src/CVS/twin/twinint.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- twinint.h	26 Oct 2004 19:56:19 -0000	1.15
+++ twinint.h	27 Oct 2004 06:07:35 -0000	1.16
@@ -485,6 +485,11 @@
 		       twin_coord_t	y);
 
 void
+_twin_widget_bevel (twin_widget_t   *widget,
+		    twin_fixed_t    bevel_width,
+		    twin_bool_t	    down);
+
+void
 _twin_label_init (twin_label_t		*label,
 		  twin_box_t		*parent,
 		  const char		*value,




More information about the Commit mailing list