r5484 - trunk/eda/fped

werner at docs.openmoko.org werner at docs.openmoko.org
Wed Aug 19 01:49:54 CEST 2009


Author: werner
Date: 2009-08-19 01:49:54 +0200 (Wed, 19 Aug 2009)
New Revision: 5484

Modified:
   trunk/eda/fped/gui_inst.c
   trunk/eda/fped/gui_style.c
   trunk/eda/fped/inst.c
   trunk/eda/fped/inst.h
   trunk/eda/fped/unparse.c
Log:
- fixed precedence of unary minus, so that -(a+b) isn't printed as -a+b
- removed in_path logic (never missed not having it) and made selected vectors
  a little brighter



Modified: trunk/eda/fped/gui_inst.c
===================================================================
--- trunk/eda/fped/gui_inst.c	2009-08-18 22:08:54 UTC (rev 5483)
+++ trunk/eda/fped/gui_inst.c	2009-08-18 23:49:54 UTC (rev 5484)
@@ -111,9 +111,7 @@
 {
 	if (selected_inst == self)
 		return mode_selected;
-	if (self->active)
-		return self->in_path ? mode_active_in_path : mode_active;
-	return self->in_path ? mode_inactive_in_path : mode_inactive;
+	return self->active ? mode_active : mode_inactive;
 }
 
 

Modified: trunk/eda/fped/gui_style.c
===================================================================
--- trunk/eda/fped/gui_style.c	2009-08-18 22:08:54 UTC (rev 5483)
+++ trunk/eda/fped/gui_style.c	2009-08-18 23:49:54 UTC (rev 5484)
@@ -49,13 +49,10 @@
 
 
 static void style(GdkGC *gcs[mode_n],
-    const char *in, const char *in_path, const char *act, const char *act_path,
-    const char *sel)
+    const char *in, const char *act, const char *sel)
 {
 	gcs[mode_inactive]		= gc(in, 1);
-	gcs[mode_inactive_in_path]	= gc(in_path, 1);
 	gcs[mode_active]		= gc(act, 1);
-	gcs[mode_active_in_path]	= gc(act_path, 1);
 	gcs[mode_selected]		= gc(sel, 2);
 }
 
@@ -65,13 +62,13 @@
 	gc_bg = gc("#000000", 0);
 	gc_bg_error = gc("#000040", 0);
 	gc_drag = gc("#ffffff", 2);
-	/*		inactive   in+path    active     act+path   selected */
-	style(gc_vec,	"#202000", "#404020", "#909040", "#c0c080", "#ffff80");
-	style(gc_obj,	"#006060", INVALID,   "#00ffff", INVALID,   "#ffff80");
-	style(gc_pad,	"#400000", INVALID,   "#ff0000", INVALID,   "#ffff80");
-	style(gc_ptext,	"#404040", INVALID,   "#ffffff", INVALID,   "#ffffff");
-	style(gc_meas,	"#280040", INVALID,   "#ff00ff", INVALID,   "#ffff80");
-	style(gc_frame,	"#004000", "#205020", "#009000", INVALID,   "#ffff80");
+	/*		inactive   active     selected */
+	style(gc_vec,	"#202000", "#b0b050", "#ffff80");
+	style(gc_obj,	"#006060", "#00ffff", "#ffff80");
+	style(gc_pad,	"#400000", "#ff0000", "#ffff80");
+	style(gc_ptext,	"#404040", "#ffffff", "#ffffff");
+	style(gc_meas,	"#280040", "#ff00ff", "#ffff80");
+	style(gc_frame,	"#004000", "#009000", "#ffff80");
 
 	gc_active_frame = gc("#00ff00", 2);
 //	gc_highlight = gc("#ff8020", 2);

Modified: trunk/eda/fped/inst.c
===================================================================
--- trunk/eda/fped/inst.c	2009-08-18 22:08:54 UTC (rev 5483)
+++ trunk/eda/fped/inst.c	2009-08-18 23:49:54 UTC (rev 5484)
@@ -127,25 +127,9 @@
 /* ----- selection --------------------------------------------------------- */
 
 
-static void set_path(int on)
-{
-	struct inst *inst;
-return;
-	if (inst->ops != &vec_ops && inst->ops != &frame_ops)
-		return;
-/* @@@ wrong */
-	for (inst = selected_inst; inst; inst = inst->outer) {
-		if (inst->ops != &vec_ops && inst->ops != &frame_ops)
-			break;
-		inst->in_path = on;
-	}
-}
-
-
 static void inst_select_inst(struct inst *inst)
 {
 	selected_inst = inst;
-	set_path(1);
 	tool_selected_inst(inst);
 	gui_frame_select_inst(inst);
 	if (inst->ops->select)
@@ -315,7 +299,6 @@
 void inst_deselect(void)
 {
 	if (selected_inst) {
-		set_path(0);
 		tool_selected_inst(NULL);
 		gui_frame_deselect_inst(selected_inst);
 	}
@@ -448,7 +431,6 @@
 	inst->base = inst->bbox.min = inst->bbox.max = base;
 	inst->outer = curr_frame;
 	inst->active = IS_ACTIVE;
-	inst->in_path = 0;
 	inst->next = NULL;
 	*curr_pkg->next_inst[prio] = inst;
 	curr_pkg->next_inst[prio] = &inst->next;

Modified: trunk/eda/fped/inst.h
===================================================================
--- trunk/eda/fped/inst.h	2009-08-18 22:08:54 UTC (rev 5483)
+++ trunk/eda/fped/inst.h	2009-08-18 23:49:54 UTC (rev 5484)
@@ -23,9 +23,7 @@
 
 enum mode {
 	mode_inactive,		/* on inactive frame */
-	mode_inactive_in_path,	/* inactive but is in path to selected */
 	mode_active,		/* on active frame */
-	mode_active_in_path,	/* active and is in path to selected */
 	mode_selected,		/* item is selected */
 	mode_hover,		/* hovering over item's contact area */
 	mode_n			/* number of modes */
@@ -80,7 +78,6 @@
 	struct obj *obj; /* NULL if not object */
 	struct inst *outer; /* frame containing this item */
 	int active;
-	int in_path;
 	union {
 		struct {
 			const struct frame *ref;

Modified: trunk/eda/fped/unparse.c
===================================================================
--- trunk/eda/fped/unparse.c	2009-08-18 22:08:54 UTC (rev 5483)
+++ trunk/eda/fped/unparse.c	2009-08-18 23:49:54 UTC (rev 5484)
@@ -90,7 +90,7 @@
 	if (expr->op == op_var)
 		return stralloc(expr->u.var);
 	if (expr->op == op_minus)
-		return merge2("-", unparse_op(expr->u.op.a, prec_add));
+		return merge2("-", unparse_op(expr->u.op.a, prec_unary));
 	if (expr->op == op_add)
 		return merge3(unparse_op(expr->u.op.a, prec_add), "+",
 		    unparse_op(expr->u.op.b, prec_add));




More information about the commitlog mailing list