r5527 - in trunk/eda/fped: . icons
werner at docs.openmoko.org
werner at docs.openmoko.org
Sat Aug 22 21:00:55 CEST 2009
Author: werner
Date: 2009-08-22 21:00:55 +0200 (Sat, 22 Aug 2009)
New Revision: 5527
Added:
trunk/eda/fped/icons/all.fig
trunk/eda/fped/icons/all_off.fig
trunk/eda/fped/icons/bright.fig
trunk/eda/fped/icons/bright_off.fig
Modified:
trunk/eda/fped/Makefile
trunk/eda/fped/gui.c
trunk/eda/fped/gui.h
trunk/eda/fped/gui_inst.c
trunk/eda/fped/inst.c
trunk/eda/fped/inst.h
Log:
- new visualization option: show all frames or show only current frame
- new visualization option: highlight pads and silk ("final" view)
Modified: trunk/eda/fped/Makefile
===================================================================
--- trunk/eda/fped/Makefile 2009-08-22 16:01:05 UTC (rev 5526)
+++ trunk/eda/fped/Makefile 2009-08-22 19:00:55 UTC (rev 5527)
@@ -22,7 +22,8 @@
vec.xpm frame.xpm frame_locked.xpm frame_ready.xpm \
line.xpm rect.xpm pad.xpm rpad.xpm circ.xpm \
meas.xpm meas_x.xpm meas_y.xpm \
- stuff.xpm stuff_off.xpm meas_off.xpm
+ stuff.xpm stuff_off.xpm meas_off.xpm \
+ bright.xpm bright_off.xpm all.xpm all_off.xpm
SHELL = /bin/bash
CFLAGS_GTK = `pkg-config --cflags gtk+-2.0`
Modified: trunk/eda/fped/gui.c
===================================================================
--- trunk/eda/fped/gui.c 2009-08-22 16:01:05 UTC (rev 5526)
+++ trunk/eda/fped/gui.c 2009-08-22 19:00:55 UTC (rev 5527)
@@ -27,16 +27,23 @@
#include "icons/stuff_off.xpm"
#include "icons/meas.xpm"
#include "icons/meas_off.xpm"
+#include "icons/all.xpm"
+#include "icons/all_off.xpm"
+#include "icons/bright.xpm"
+#include "icons/bright_off.xpm"
GtkWidget *root;
+int show_all = 1;
int show_stuff = 1;
int show_meas = 1;
+int show_bright = 0;
static GtkWidget *frames_box;
-static GtkWidget *ev_stuff, *ev_meas;
-static GtkWidget *stuff_image[2], *meas_image[2];
+static GtkWidget *ev_stuff, *ev_meas, *ev_all, *ev_bright;
+static GtkWidget *stuff_image[2], *meas_image[2], *all_image[2];
+static GtkWidget *bright_image[2];
/* ----- view callbacks ---------------------------------------------------- */
@@ -87,6 +94,21 @@
}
+static gboolean toggle_all(GtkWidget *widget, GdkEventButton *event,
+ gpointer data)
+{
+ switch (event->button) {
+ case 1:
+ show_all = !show_all;
+ set_image(ev_all, all_image[show_all]);
+ inst_deselect();
+ redraw();
+ break;
+ }
+ return TRUE;
+}
+
+
static gboolean toggle_stuff(GtkWidget *widget, GdkEventButton *event,
gpointer data)
{
@@ -117,6 +139,21 @@
}
+static gboolean toggle_bright(GtkWidget *widget, GdkEventButton *event,
+ gpointer data)
+{
+ switch (event->button) {
+ case 1:
+ show_bright = !show_bright;
+ set_image(ev_bright, bright_image[show_bright]);
+ inst_deselect();
+ redraw();
+ break;
+ }
+ return TRUE;
+}
+
+
static void make_tool_bar(GtkWidget *hbox, GdkDrawable *drawable)
{
GtkWidget *bar;
@@ -126,16 +163,24 @@
//gtk_box_pack_end(GTK_BOX(hbox), bar, FALSE, FALSE, 0);
gtk_toolbar_set_style(GTK_TOOLBAR(bar), GTK_TOOLBAR_ICONS);
+ ev_all = tool_button(bar, drawable, NULL, toggle_all, NULL);
ev_stuff = tool_button(bar, drawable, NULL, toggle_stuff, NULL);
ev_meas = tool_button(bar, drawable, NULL, toggle_meas, NULL);
+ ev_bright = tool_button(bar, drawable, NULL, toggle_bright, NULL);
stuff_image[0] = gtk_widget_ref(make_image(drawable, xpm_stuff_off));
stuff_image[1] = gtk_widget_ref(make_image(drawable, xpm_stuff));
meas_image[0] = gtk_widget_ref(make_image(drawable, xpm_meas_off));
meas_image[1] = gtk_widget_ref(make_image(drawable, xpm_meas));
+ all_image[0] = gtk_widget_ref(make_image(drawable, xpm_all_off));
+ all_image[1] = gtk_widget_ref(make_image(drawable, xpm_all));
+ bright_image[0] = gtk_widget_ref(make_image(drawable, xpm_bright_off));
+ bright_image[1] = gtk_widget_ref(make_image(drawable, xpm_bright));
set_image(ev_stuff, stuff_image[show_stuff]);
set_image(ev_meas, meas_image[show_meas]);
+ set_image(ev_all, all_image[show_all]);
+ set_image(ev_bright, bright_image[show_bright]);
}
@@ -145,6 +190,10 @@
g_object_unref(stuff_image[1]);
g_object_unref(meas_image[0]);
g_object_unref(meas_image[1]);
+ g_object_unref(all_image[0]);
+ g_object_unref(all_image[1]);
+ g_object_unref(bright_image[0]);
+ g_object_unref(bright_image[1]);
}
Modified: trunk/eda/fped/gui.h
===================================================================
--- trunk/eda/fped/gui.h 2009-08-22 16:01:05 UTC (rev 5526)
+++ trunk/eda/fped/gui.h 2009-08-22 19:00:55 UTC (rev 5527)
@@ -18,8 +18,10 @@
extern GtkWidget *root;
+extern int show_all;
extern int show_stuff;
extern int show_meas;
+extern int show_bright;
/* update everything after a model change */
Modified: trunk/eda/fped/gui_inst.c
===================================================================
--- trunk/eda/fped/gui_inst.c 2009-08-22 16:01:05 UTC (rev 5526)
+++ trunk/eda/fped/gui_inst.c 2009-08-22 19:00:55 UTC (rev 5527)
@@ -111,7 +111,7 @@
{
if (selected_inst == self)
return mode_selected;
- return self->active ? mode_active : mode_inactive;
+ return self->active || bright(self) ? mode_active : mode_inactive;
}
Added: trunk/eda/fped/icons/all.fig
===================================================================
--- trunk/eda/fped/icons/all.fig (rev 0)
+++ trunk/eda/fped/icons/all.fig 2009-08-22 19:00:55 UTC (rev 5527)
@@ -0,0 +1,22 @@
+#FIG 3.2 Produced by xfig version 3.2.5a
+Landscape
+Center
+Inches
+A4
+100.00
+Single
+-2
+1200 2
+0 32 #c0c000
+6 4350 3225 5625 4425
+2 1 0 15 13 7 50 -1 -1 0.000 1 1 -1 0 0 2
+ 4500 3825 5475 3825
+2 1 0 15 13 7 50 -1 -1 0.000 1 1 -1 0 0 2
+ 4650 3375 5250 4275
+2 1 0 15 13 7 50 -1 -1 0.000 1 1 -1 0 0 2
+ 5250 3375 4650 4275
+-6
+2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5
+ 3600 2400 6000 2400 6000 4800 3600 4800 3600 2400
+2 1 0 10 12 7 50 -1 -1 0.000 0 1 -1 0 0 3
+ 3900 3690 3900 2850 5700 2850
Added: trunk/eda/fped/icons/all_off.fig
===================================================================
--- trunk/eda/fped/icons/all_off.fig (rev 0)
+++ trunk/eda/fped/icons/all_off.fig 2009-08-22 19:00:55 UTC (rev 5527)
@@ -0,0 +1,22 @@
+#FIG 3.2 Produced by xfig version 3.2.5a
+Landscape
+Center
+Inches
+A4
+100.00
+Single
+-2
+1200 2
+0 32 #c0c000
+6 4350 3225 5625 4425
+2 1 0 15 0 7 50 -1 -1 0.000 1 1 -1 0 0 2
+ 4650 3375 5250 4275
+2 1 0 15 0 7 50 -1 -1 0.000 1 1 -1 0 0 2
+ 5250 3375 4650 4275
+2 1 0 15 0 7 50 -1 -1 0.000 1 1 -1 0 0 2
+ 4500 3825 5475 3825
+-6
+2 2 0 1 0 7 60 -1 10 0.000 0 0 -1 0 0 5
+ 3600 2400 6000 2400 6000 4800 3600 4800 3600 2400
+2 1 0 10 0 7 50 -1 -1 0.000 0 1 -1 0 0 3
+ 3900 3690 3900 2850 5700 2850
Added: trunk/eda/fped/icons/bright.fig
===================================================================
--- trunk/eda/fped/icons/bright.fig (rev 0)
+++ trunk/eda/fped/icons/bright.fig 2009-08-22 19:00:55 UTC (rev 5527)
@@ -0,0 +1,24 @@
+#FIG 3.2 Produced by xfig version 3.2.5a
+Landscape
+Center
+Inches
+A4
+100.00
+Single
+-2
+1200 2
+0 32 #b0ffff
+2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5
+ 3600 2400 6000 2400 6000 4800 3600 4800 3600 2400
+2 2 0 0 0 4 50 -1 20 0.000 0 0 -1 0 0 5
+ 4200 3150 4650 3150 4650 4050 4200 4050 4200 3150
+2 2 0 0 0 4 50 -1 20 0.000 0 0 -1 0 0 5
+ 4950 3150 5400 3150 5400 4050 4950 4050 4950 3150
+2 2 0 10 3 7 50 -1 -1 0.000 0 0 -1 0 0 5
+ 3900 2850 5700 2850 5700 4350 3900 4350 3900 2850
+2 2 0 15 29 7 60 -1 -1 0.000 0 0 -1 0 0 5
+ 4950 3150 5400 3150 5400 4050 4950 4050 4950 3150
+2 2 0 15 29 7 60 -1 -1 0.000 0 0 -1 0 0 5
+ 4200 3150 4650 3150 4650 4050 4200 4050 4200 3150
+2 2 0 20 32 7 60 -1 -1 0.000 0 0 -1 0 0 5
+ 3900 2850 5700 2850 5700 4350 3900 4350 3900 2850
Added: trunk/eda/fped/icons/bright_off.fig
===================================================================
--- trunk/eda/fped/icons/bright_off.fig (rev 0)
+++ trunk/eda/fped/icons/bright_off.fig 2009-08-22 19:00:55 UTC (rev 5527)
@@ -0,0 +1,18 @@
+#FIG 3.2 Produced by xfig version 3.2.5a
+Landscape
+Center
+Inches
+A4
+100.00
+Single
+-2
+1200 2
+0 32 #b0ffff
+2 2 0 0 0 19 50 -1 20 0.000 0 0 -1 0 0 5
+ 4200 3150 4650 3150 4650 4050 4200 4050 4200 3150
+2 2 0 0 0 19 50 -1 20 0.000 0 0 -1 0 0 5
+ 4950 3150 5400 3150 5400 4050 4950 4050 4950 3150
+2 2 0 1 0 7 65 -1 10 0.000 0 0 -1 0 0 5
+ 3600 2400 6000 2400 6000 4800 3600 4800 3600 2400
+2 2 0 10 16 7 50 -1 -1 0.000 0 0 -1 0 0 5
+ 3900 2850 5700 2850 5700 4350 3900 4350 3900 2850
Modified: trunk/eda/fped/inst.c
===================================================================
--- trunk/eda/fped/inst.c 2009-08-22 16:01:05 UTC (rev 5526)
+++ trunk/eda/fped/inst.c 2009-08-22 19:00:55 UTC (rev 5527)
@@ -41,6 +41,7 @@
static struct inst_ops vec_ops;
static struct inst_ops frame_ops;
+static struct inst_ops meas_ops;
#define IS_ACTIVE ((active_set & 1))
@@ -63,6 +64,27 @@
}
+int bright(const struct inst *inst)
+{
+ if (!show_bright)
+ return 0;
+ return inst->ops != &vec_ops && inst->ops != &frame_ops &&
+ inst->ops != &meas_ops;
+}
+
+
+static int show_this(const struct inst *inst)
+{
+ if (show_all)
+ return 1;
+ if (inst->ops == &frame_ops && inst->u.frame.ref == active_frame)
+ return 1;
+ if (!inst->outer)
+ return active_frame == root_frame;
+ return inst->outer->u.frame.ref == active_frame;
+}
+
+
/* ----- selection of items not on the canvas ------------------------------ */
@@ -176,6 +198,8 @@
if (!show(prio))
continue;
FOR_ALL_INSTS(i, prio, inst) {
+ if (!show_this(inst))
+ continue;
if (!inst->ops->distance)
continue;
if (!inst_connected(inst))
@@ -228,6 +252,9 @@
goto selected;
}
+ if (!show_all)
+ return 0;
+
if (any_same_frame) {
if (activate_item(any_same_frame))
return inst_select(pos);
@@ -1148,8 +1175,10 @@
FOR_INST_PRIOS_UP(prio)
FOR_ALL_INSTS(i, prio, inst)
- if (show(prio) && !inst->active && inst->ops->draw)
- inst->ops->draw(inst);
+ if (show_this(inst))
+ if (show(prio) && !inst->active &&
+ inst->ops->draw)
+ inst->ops->draw(inst);
FOR_INST_PRIOS_UP(prio)
FOR_ALL_INSTS(i, prio, inst)
if (show(prio) && prio != ip_frame && inst->active &&
Modified: trunk/eda/fped/inst.h
===================================================================
--- trunk/eda/fped/inst.h 2009-08-22 16:01:05 UTC (rev 5526)
+++ trunk/eda/fped/inst.h 2009-08-22 19:00:55 UTC (rev 5527)
@@ -147,6 +147,8 @@
FOR_PKG_INSTS(i ? active_pkg : pkgs, prio, inst)
+int bright(const struct inst *inst);
+
void inst_select_outside(void *item, void (*deselect)(void *item));
int inst_select(struct coord pos);
void inst_deselect(void);
More information about the commitlog
mailing list