Changeset 5527


Ignore:
Timestamp:
08/22/09 21:00:55 (4 years ago)
Author:
werner
Message:
  • new visualization option: show all frames or show only current frame
  • new visualization option: highlight pads and silk ("final" view)
Location:
trunk/eda/fped
Files:
4 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/eda/fped/Makefile

    r5525 r5527  
    2323       line.xpm rect.xpm pad.xpm rpad.xpm circ.xpm \ 
    2424       meas.xpm meas_x.xpm meas_y.xpm \ 
    25        stuff.xpm stuff_off.xpm meas_off.xpm 
     25       stuff.xpm stuff_off.xpm meas_off.xpm \ 
     26       bright.xpm bright_off.xpm all.xpm all_off.xpm 
    2627 
    2728SHELL = /bin/bash 
  • trunk/eda/fped/gui.c

    r5514 r5527  
    2828#include "icons/meas.xpm" 
    2929#include "icons/meas_off.xpm" 
     30#include "icons/all.xpm" 
     31#include "icons/all_off.xpm" 
     32#include "icons/bright.xpm" 
     33#include "icons/bright_off.xpm" 
    3034 
    3135 
    3236GtkWidget *root; 
     37int show_all = 1; 
    3338int show_stuff = 1; 
    3439int show_meas = 1; 
     40int show_bright = 0; 
    3541 
    3642 
    3743static GtkWidget *frames_box; 
    38 static GtkWidget *ev_stuff, *ev_meas; 
    39 static GtkWidget *stuff_image[2], *meas_image[2]; 
     44static GtkWidget *ev_stuff, *ev_meas, *ev_all, *ev_bright; 
     45static GtkWidget *stuff_image[2], *meas_image[2], *all_image[2]; 
     46static GtkWidget *bright_image[2]; 
    4047 
    4148 
     
    8895 
    8996 
     97static gboolean toggle_all(GtkWidget *widget, GdkEventButton *event, 
     98    gpointer data) 
     99{ 
     100        switch (event->button) { 
     101        case 1: 
     102                show_all = !show_all; 
     103                set_image(ev_all, all_image[show_all]); 
     104                inst_deselect(); 
     105                redraw(); 
     106                break; 
     107        } 
     108        return TRUE; 
     109} 
     110 
     111 
    90112static gboolean toggle_stuff(GtkWidget *widget, GdkEventButton *event, 
    91113    gpointer data) 
     
    118140 
    119141 
     142static gboolean toggle_bright(GtkWidget *widget, GdkEventButton *event, 
     143    gpointer data) 
     144{ 
     145        switch (event->button) { 
     146        case 1: 
     147                show_bright = !show_bright; 
     148                set_image(ev_bright, bright_image[show_bright]); 
     149                inst_deselect(); 
     150                redraw(); 
     151                break; 
     152        } 
     153        return TRUE; 
     154} 
     155 
     156 
    120157static void make_tool_bar(GtkWidget *hbox, GdkDrawable *drawable) 
    121158{ 
     
    127164        gtk_toolbar_set_style(GTK_TOOLBAR(bar), GTK_TOOLBAR_ICONS); 
    128165 
     166        ev_all = tool_button(bar, drawable, NULL, toggle_all, NULL); 
    129167        ev_stuff = tool_button(bar, drawable, NULL, toggle_stuff, NULL); 
    130168        ev_meas = tool_button(bar, drawable, NULL, toggle_meas, NULL); 
     169        ev_bright = tool_button(bar, drawable, NULL, toggle_bright, NULL); 
    131170 
    132171        stuff_image[0] = gtk_widget_ref(make_image(drawable, xpm_stuff_off)); 
     
    134173        meas_image[0] = gtk_widget_ref(make_image(drawable, xpm_meas_off)); 
    135174        meas_image[1] = gtk_widget_ref(make_image(drawable, xpm_meas)); 
     175        all_image[0] = gtk_widget_ref(make_image(drawable, xpm_all_off)); 
     176        all_image[1] = gtk_widget_ref(make_image(drawable, xpm_all)); 
     177        bright_image[0] = gtk_widget_ref(make_image(drawable, xpm_bright_off)); 
     178        bright_image[1] = gtk_widget_ref(make_image(drawable, xpm_bright)); 
    136179 
    137180        set_image(ev_stuff, stuff_image[show_stuff]); 
    138181        set_image(ev_meas, meas_image[show_meas]); 
     182        set_image(ev_all, all_image[show_all]); 
     183        set_image(ev_bright, bright_image[show_bright]); 
    139184} 
    140185 
     
    146191        g_object_unref(meas_image[0]); 
    147192        g_object_unref(meas_image[1]); 
     193        g_object_unref(all_image[0]); 
     194        g_object_unref(all_image[1]); 
     195        g_object_unref(bright_image[0]); 
     196        g_object_unref(bright_image[1]); 
    148197} 
    149198 
  • trunk/eda/fped/gui.h

    r5411 r5527  
    1919 
    2020extern GtkWidget *root; 
     21extern int show_all; 
    2122extern int show_stuff; 
    2223extern int show_meas; 
     24extern int show_bright; 
    2325 
    2426 
  • trunk/eda/fped/gui_inst.c

    r5525 r5527  
    112112        if (selected_inst == self) 
    113113                return mode_selected; 
    114         return self->active ? mode_active : mode_inactive; 
     114        return self->active || bright(self) ? mode_active : mode_inactive; 
    115115} 
    116116 
  • trunk/eda/fped/inst.c

    r5525 r5527  
    4242static struct inst_ops vec_ops; 
    4343static struct inst_ops frame_ops; 
     44static struct inst_ops meas_ops; 
    4445 
    4546 
     
    6162                return 1; 
    6263        } 
     64} 
     65 
     66 
     67int bright(const struct inst *inst) 
     68{ 
     69        if (!show_bright) 
     70                return 0; 
     71        return inst->ops != &vec_ops && inst->ops != &frame_ops && 
     72            inst->ops != &meas_ops; 
     73} 
     74 
     75 
     76static int show_this(const struct inst *inst) 
     77{ 
     78        if (show_all) 
     79                return 1; 
     80        if (inst->ops == &frame_ops && inst->u.frame.ref == active_frame) 
     81                return 1; 
     82        if (!inst->outer) 
     83                return active_frame == root_frame; 
     84        return inst->outer->u.frame.ref == active_frame; 
    6385} 
    6486 
     
    177199                        continue; 
    178200                FOR_ALL_INSTS(i, prio, inst) { 
     201                        if (!show_this(inst)) 
     202                                continue; 
    179203                        if (!inst->ops->distance) 
    180204                                continue; 
     
    229253        } 
    230254 
     255        if (!show_all) 
     256                return 0; 
     257 
    231258        if (any_same_frame) { 
    232259                if (activate_item(any_same_frame)) 
     
    11491176        FOR_INST_PRIOS_UP(prio) 
    11501177                FOR_ALL_INSTS(i, prio, inst) 
    1151                         if (show(prio) && !inst->active && inst->ops->draw) 
    1152                                 inst->ops->draw(inst); 
     1178                        if (show_this(inst)) 
     1179                                if (show(prio) && !inst->active && 
     1180                                    inst->ops->draw) 
     1181                                        inst->ops->draw(inst); 
    11531182        FOR_INST_PRIOS_UP(prio) 
    11541183                FOR_ALL_INSTS(i, prio, inst) 
  • trunk/eda/fped/inst.h

    r5522 r5527  
    148148 
    149149 
     150int bright(const struct inst *inst); 
     151 
    150152void inst_select_outside(void *item, void (*deselect)(void *item)); 
    151153int inst_select(struct coord pos); 
Note: See TracChangeset for help on using the changeset viewer.