r5696 - trunk/eda/fped

werner at docs.openmoko.org werner at docs.openmoko.org
Mon Oct 19 17:00:31 CEST 2009


Author: werner
Date: 2009-10-19 17:00:30 +0200 (Mon, 19 Oct 2009)
New Revision: 5696

Modified:
   trunk/eda/fped/Makefile
   trunk/eda/fped/gui_inst.c
   trunk/eda/fped/gui_style.c
   trunk/eda/fped/inst.h
Log:
Drawing all the pad layers as filled areas can cause confusion. Now we draw 
the solder mask with lines.

- gui_inst.c: draw solder mask with lines, not with filled rectangles and arcs
- gui_style.c: increase line width for solder mask from 1 to 2 pixels
- Makefile: added manual/concept-inst.png (forgot to commit this before)



Modified: trunk/eda/fped/Makefile
===================================================================
--- trunk/eda/fped/Makefile	2009-10-19 12:30:19 UTC (rev 5695)
+++ trunk/eda/fped/Makefile	2009-10-19 15:00:30 UTC (rev 5696)
@@ -28,7 +28,8 @@
        stuff.xpm stuff_off.xpm meas_off.xpm \
        bright.xpm bright_off.xpm all.xpm all_off.xpm
 
-PNGS = intro-1.png intro-2.png intro-3.png intro-4.png intro-5.png intro-6.png
+PNGS = intro-1.png intro-2.png intro-3.png intro-4.png intro-5.png \
+       intro-6.png concept-inst.png
 
 SHELL = /bin/bash
 CFLAGS_GTK = `pkg-config --cflags gtk+-2.0`

Modified: trunk/eda/fped/gui_inst.c
===================================================================
--- trunk/eda/fped/gui_inst.c	2009-10-19 12:30:19 UTC (rev 5695)
+++ trunk/eda/fped/gui_inst.c	2009-10-19 15:00:30 UTC (rev 5696)
@@ -257,12 +257,14 @@
 }
 
 
-static GdkGC *pad_gc(const struct inst *inst)
+static GdkGC *pad_gc(const struct inst *inst, int *fill)
 {
+	*fill = TRUE;
 	switch (layers_to_pad_type(inst->u.pad.layers)) {
 	case pt_bare:
 		return gc_pad_bare[get_mode(inst)];
 	case pt_mask:
+		*fill = FALSE;
 		return gc_pad_mask[get_mode(inst)];
 	default:
 		return gc_pad[get_mode(inst)];
@@ -275,10 +277,11 @@
 	struct coord min = translate(self->base);
 	struct coord max = translate(self->u.pad.other);
 	GdkGC *gc;
+	int fill;
 
-	gc = pad_gc(self);
+	gc = pad_gc(self, &fill);
 	sort_coord(&min, &max);
-	gdk_draw_rectangle(DA, gc, TRUE,
+	gdk_draw_rectangle(DA, gc, fill,
 	    min.x, min.y, max.x-min.x, max.y-min.y);
 
 	gui_draw_pad_text(self);
@@ -290,22 +293,23 @@
 	struct coord min = translate(self->base);
 	struct coord max = translate(self->u.pad.other);
 	GdkGC *gc;
+	int fill;
 	unit_type h, w, r;
 
-	gc = pad_gc(self);
+	gc = pad_gc(self, &fill);
 	sort_coord(&min, &max);
 	h = max.y-min.y;
 	w = max.x-min.x;
 	if (h > w) {
 		r = w/2;
-		draw_arc(DA, gc, TRUE, min.x+r, max.y-r, r, 180, 0);
-		gdk_draw_rectangle(DA, gc, TRUE, min.x, min.y+r, w, h-2*r);
-		draw_arc(DA, gc, TRUE, min.x+r, min.y+r, r, 0, 180);
+		draw_arc(DA, gc, fill, min.x+r, max.y-r, r, 180, 0);
+		gdk_draw_rectangle(DA, gc, fill, min.x, min.y+r, w, h-2*r);
+		draw_arc(DA, gc, fill, min.x+r, min.y+r, r, 0, 180);
 	} else {
 		r = h/2;
-		draw_arc(DA, gc, TRUE, min.x+r, min.y+r, r, 90, 270);
-		gdk_draw_rectangle(DA, gc, TRUE, min.x+r, min.y, w-2*r, h);
-		draw_arc(DA, gc, TRUE, max.x-r, min.y+r, r, 270, 90);
+		draw_arc(DA, gc, fill, min.x+r, min.y+r, r, 90, 270);
+		gdk_draw_rectangle(DA, gc, fill, min.x+r, min.y, w-2*r, h);
+		draw_arc(DA, gc, fill, max.x-r, min.y+r, r, 270, 90);
 	}
 
 	gui_draw_pad_text(self);

Modified: trunk/eda/fped/gui_style.c
===================================================================
--- trunk/eda/fped/gui_style.c	2009-10-19 12:30:19 UTC (rev 5695)
+++ trunk/eda/fped/gui_style.c	2009-10-19 15:00:30 UTC (rev 5696)
@@ -48,11 +48,11 @@
 
 
 static void style(GdkGC *gcs[mode_n],
-    const char *in, const char *act, const char *sel)
+    const char *in, const char *act, const char *sel, int width)
 {
-	gcs[mode_inactive]		= gc(in, 1);
-	gcs[mode_active]		= gc(act, 1);
-	gcs[mode_selected]		= gc(sel, 2);
+	gcs[mode_inactive]		= gc(in, width);
+	gcs[mode_active]		= gc(act, width);
+	gcs[mode_selected]		= gc(sel, 2*width);
 }
 
 
@@ -62,14 +62,14 @@
 	gc_bg_error = gc("#000040", 0);
 	gc_drag = gc("#ffffff", 2);
 	/*			inactive   active     selected */
-	style(gc_vec,		"#202000", "#b0b050", "#ffff80");
-	style(gc_obj,		"#006060", "#00ffff", "#ffff80");
-	style(gc_pad,		"#400000", "#ff0000", "#ffff80");
-	style(gc_pad_bare,	"#402000", "#ff6000", "#ffff80");
-	style(gc_pad_mask,	"#000040", "#0000ff", "#ffff80");
-	style(gc_ptext,		"#404040", "#ffffff", "#ffffff");
-	style(gc_meas,		"#280040", "#ff00ff", "#ffff80");
-	style(gc_frame,		"#005000", "#009000", "#ffff80");
+	style(gc_vec,		"#202000", "#b0b050", "#ffff80", 1);
+	style(gc_obj,		"#006060", "#00ffff", "#ffff80", 1);
+	style(gc_pad,		"#400000", "#ff0000", "#ffff80", 1);
+	style(gc_pad_bare,	"#402000", "#ff6000", "#ffff80", 1);
+	style(gc_pad_mask,	"#000040", "#0000ff", "#ffff80", 2);
+	style(gc_ptext,		"#404040", "#ffffff", "#ffffff", 1);
+	style(gc_meas,		"#280040", "#ff00ff", "#ffff80", 1);
+	style(gc_frame,		"#005000", "#009000", "#ffff80", 1);
 
 	gc_active_frame = gc("#00ff00", 2);
 //	gc_highlight = gc("#ff8020", 2);

Modified: trunk/eda/fped/inst.h
===================================================================
--- trunk/eda/fped/inst.h	2009-10-19 12:30:19 UTC (rev 5695)
+++ trunk/eda/fped/inst.h	2009-10-19 15:00:30 UTC (rev 5696)
@@ -41,7 +41,7 @@
 	ip_pad_copper,	/* pads also accept clicks inside; pads with copper */
 	ip_pad_special,	/* pads with only solder paste or mask, on top */
 	ip_circ,	/* circles don't overlap easily */
-	ip_arc,		/* arc are like circles, just shorter */
+	ip_arc,		/* arcs are like circles, just shorter */
 	ip_rect,	/* rectangles have plenty of sides */
 	ip_meas,	/* mesurements are like lines but set a bit apart */
 	ip_line,	/* lines are easly overlapped by other things */




More information about the commitlog mailing list