1
0
mirror of git://projects.qi-hardware.com/fped.git synced 2024-11-18 09:35:20 +02:00
Commit Graph

243 Commits

Author SHA1 Message Date
werner
4bfb601a40 Wrap wide tables.
- gui_frame.c (build_table): restructured code to build tables column by column
  instead of row by row
- gui_frame.c (build_table): wrap tables wider than the screen area available
  for variables and tables
- gui_util.h, gui_util.c (get_widget_width): new helper function that returns a
  widget's requested width
- gui.c, gui_style.h: replace hard-coded initial pane size with constants
  DEFAULT_FRAME_AREA_WIDTH and DEFAULT_FRAME_AREA_HEIGHT
- gui.c (change_world): pass the width of the left pane as a wrapping hint to 
  build_frames
- gui_frame.c (build_frames): subtract width of longest package template or 
  frame name from available width
- gui.c (change_world): moved call to build_frames to separate function
  do_build_frames
- gui.c (gui_main): used g_signal_connect_swapped instead of g_signal_connect
  for no good reason



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5847 99fdad57-331a-0410-800a-d7fa5415bdb3
2010-02-19 10:27:46 +00:00
werner
3ba5a476b8 - Makefile (SVN_VERSION): use "svn info -R" to get the correct SVN revision
git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5846 99fdad57-331a-0410-800a-d7fa5415bdb3
2010-02-18 14:18:30 +00:00
werner
53a01182a3 Show fped's SVN revision in the title bar.
- Makefile: pass SVN version and commit status to CPP
- gui.c (gui_main): show SVN revision in the title bar, if available



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5845 99fdad57-331a-0410-800a-d7fa5415bdb3
2010-02-18 14:03:14 +00:00
werner
3d6ef48930 As a shortcut, accept entry of "0" as a valid distance for dimensions. (For
safety, this only works if used directly, not through variables.)

- gui_status.c (edit_any_expr): replaced with dist_expr_store, which changes
  values of "0" to "0mm"
- gui_status.c, gui_status.h (edit_dist_expr): new function to edit distance
  expressions
- inst.c (obj_line_edit, obj_rect_edit, obj_arc_edit, obj_meas_edit): changed
  edit_expr to edit_dist_expr



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5844 99fdad57-331a-0410-800a-d7fa5415bdb3
2010-02-18 13:39:20 +00:00
werner
0115283735 Variables and loops can now be added from the variable/loop pop-ups, without
having to go all the way up to the frame.

- gui_frame.c: factory tables had very ragged indentation
- gui_frame.c: added "Add variable" and "Add loop" to variable, table, and loop
  pop-up



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5843 99fdad57-331a-0410-800a-d7fa5415bdb3
2010-02-18 11:35:12 +00:00
werner
9c22c1b2e5 gtk_init calls setlocale(..., ""), which can upset all uses of scanf, printf,
etc. We restore sanity by resetting the locale to "C". Reported by Nick 
Oestergaard.

- gui.c (gui_init): reset the locale to "C" after calling gtk_init 



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5793 99fdad57-331a-0410-800a-d7fa5415bdb3
2010-01-18 22:57:49 +00:00
werner
8a0039f202 When clicking on an instance, fped used to select the currenly active instance
of the corresponding object but didn't change any table or loop selection to
make it active. (It did already change the frame reference.) This meant that,
upon clicking on an instance, often a different instance of the same object
would be selected. This was confusing at best.

With the below changes, table rows and loop iterations are adjusted such that 
the instance that was clicked on becomes active. If the algorithm fails, fped 
will print "__inst_select: tries exhausted" and fail safely. Please report if 
this happens.

- obj.c (search_inst, find_inst, instantiate): added mechanism to search for 
  instances matching a previous instance
- obj.c (run_loops, iterate_tables): record matches in found_* elements of the
  object's struct
- obj.c (reset_found, activate_found): helper functions to initialize and apply
  the activation leading to the instance found
- inst.c (activate_item): added comment explaining how activate_item is
  supposed to work and the fallacies of that logic
- inst.c (inst_select): added tries counter to avoid infinite recursion when
  results don't converge
- inst.c (__inst_select): when selecting an instance in the same frame, adjust
  tables and loops such that the instance becomes active
- inst.c: added call to find_inst after most instance creations (add_inst)
- obj.h: documented the meaning of the curr[ent]*, active*, and found* fields



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5792 99fdad57-331a-0410-800a-d7fa5415bdb3
2010-01-12 02:18:58 +00:00
werner
e84727ce95 When editing a variable or value, the actual value is now shown. The choice
of active frame reference, row, and loop instance affects this value, as it
should.

- obj.c (run_loops): reset loop->curr_value to UNDEF when instantiation is done
- obj.c (generate_frame): reset frame->curr_parent to NULL when instantiation
  is done
- expr.c (eval_var, eval_string_var): distinguish beteen instantiation and
  editing mode, and use "active" values in the latter
- gui_frame.c (edit_var, edit_value, edit_value_list): display the value of the
  variable or the active expression in the "X" field
- gui_frame.c (assignment_value_select_event, table_value_select_event,
  loop_from_select_event, loop_to_select_event): pass the frame to edit_value
  and edit_value_list
- expr.c (str_unit): since we may now accidently expose a wider range of
  exponents, removed -2 ... 2 exponent range limitation



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5788 99fdad57-331a-0410-800a-d7fa5415bdb3
2010-01-10 13:09:55 +00:00
werner
393c178a5f Added tooltips for editable status area items. All tools are now tipped.
- gui_status.h, gui_status.c (edit_*): edit functions now accept a tooltip
- added tooltips for editable status area items
- tooltips on setup_set_type_* looked strange. Show them only for the value
  field next to the type field.



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5776 99fdad57-331a-0410-800a-d7fa5415bdb3
2010-01-03 00:36:52 +00:00
werner
feabeb73f4 The build process used dependencies only if they were explicitly generated.
This often caused accidental builds without proper dependencies.

- Makefile: include .depend also if it doesn't exist yet. This way, GNU make
  will build it and all is fine.
- Makefile: use "-include" instead of "include" to avoid unnecessary nagging
- Makefile: make .depend depend on *.h and *.c, so that we catch all changes
  that _might_ affect the dependencies (this is a little inefficient but better
  safe than sorry)
- README: "make dep" is no longer needed
- TODO: added thoughts for more improvements



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5774 99fdad57-331a-0410-800a-d7fa5415bdb3
2010-01-02 23:58:03 +00:00
werner
661398c20a Yet more tooltips. This time, for all non-editable fields in the status area.
- gui_status.h: use macro to generate status_set_* delarations, just as we use
  a macro for their definitions
- added tooltips for all non-editable fields in the status area



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5773 99fdad57-331a-0410-800a-d7fa5415bdb3
2010-01-02 23:27:36 +00:00
werner
f9eefa4e69 When repeatedly clicking on a stack of items to cycle through the stack, a
click on an anchor point of the selected object would be treated as a drag, 
even if the click was very short. This created a very confusing user 
experience.

- gui_canvas.c (button_release_event): if we didn't "escape" the drag radius,
  don't treat the click as a drag but run the click-to-select process instead
  (note: the drag visualization still flickers briefly)
- gui_canvas.c (button_release_event): to find out if we've escaped the drag
  radius, just call drag_left instead of duplicating some of its code



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5772 99fdad57-331a-0410-800a-d7fa5415bdb3
2010-01-02 22:04:25 +00:00
werner
522e8df574 When selecting a tool and then selecting an object, the tool still appeared to
be active, while in truth it had been reset internally.

- gui_canvas.c (button_press_event): if a click is used for selection (and not
  dragging), reset the tool first



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5771 99fdad57-331a-0410-800a-d7fa5415bdb3
2010-01-02 21:38:15 +00:00
werner
1cd5e6da94 Canvas tooltips now work. The problem was that expose events set the paint
region to only cover the newly exposed area. This prevented the general 
redrawing from clearing areas that still contained hovering and dragging
items. However,the paint region has no effect on reading from the drawable.
Thus when rebuilding the hover and drag stack, the still tainted image was
stored.

This issue could be solved by either introducing a separate mode where the
stack is redrawn instead of rebuilt, or by turning off double-buffering. 
The former would complicate the already fickle logic of overlays, and not
having double-buffering doesn't seem to cause any ill effects.

- gui_canvas.c (make_canvas): disable double-buffering of canvas so that the
  paint region is not restricted in expose events
- gui_tool.c (tool_tip): enabled canvas tooltips



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5770 99fdad57-331a-0410-800a-d7fa5415bdb3
2010-01-02 15:47:46 +00:00
werner
14f21c0aee More work on tooltips and a build fix.
- Makefile: use PID in temporary file name in PPM to XPM conversion, so that we
  don't get mysterious failures in parallel builds
- gui_util.c (debug_save_pixbuf, debug_save_widget): helper functions to debug
  pixbuf and widget content
- Makefile: added target "montage" to show the images recorded with
  debug_save_pixbuf and debug_save_widget
- gui_over.c: when debugging, record the saves pixbuf in files
- gui_tool.c (tool_hover): removed unnecessary initialization
- added infrastructure for tooltips on the canvas (doesn't work properly yet)



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5769 99fdad57-331a-0410-800a-d7fa5415bdb3
2010-01-02 12:55:34 +00:00
werner
329b8306aa Added tooltips to frame/items list.
git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5768 99fdad57-331a-0410-800a-d7fa5415bdb3
2010-01-01 22:08:29 +00:00
werner
bdd6e95521 Added tooltips to all icons acting as buttons.
git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5767 99fdad57-331a-0410-800a-d7fa5415bdb3
2010-01-01 14:59:17 +00:00
werner
40028ed18f The comment of the previous commit contained a slight exaggeration: we did
in fact let duplicate variable names pass.

- fpd.y: report duplicate variable/loop/column names



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5766 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-12-31 16:24:23 +00:00
werner
325a732e1c One could add a new frame if a frame with an underscore as its name already
existed, thus creating a structure that could be saved but no longer loaded.
Likewise, one could add new variables/loops/columns if there was already one
named "_", thus creating the same problem.

- gui_frame.c (pop_up_frame): disable "Add frame" if we already have a frame
  named "_"
- gui_frame.c (pop_up_frame): disable "Add variable" and "Add loop" if we 
  already have a variable or loop named "_"
- gui_frame.c (pop_up_single_var, pop_up_table_var): disable "Add column" if
  we already have a variable or loop named "_"



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5765 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-12-31 16:13:49 +00:00
werner
25e806172a When deleting the locked frame, icon and internal reference weren't reset.
- gui_frame.c (popup_del_frame): when deleting a frame, notify the frame tool
  so that it can undo any locking



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5764 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-12-31 15:11:47 +00:00
werner
09186de7a8 When selecting an expression of an assignment and then selecting another
expression, the background of the first expression did not revert to its 
original color.

- gui_style.h (COLOR_CHOICE_SELECTED): made blue a bit lighter, to improve
  contrast of black foreground text
- gui_frame.c (unselect_value): build_assignment uses COLOR_EXPR_PASSIVE for
  expressions in assignments, so we also have to do the same here.



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5763 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-12-31 09:34:17 +00:00
werner
887643e65a Indicated more prominently that fped is licensed under the GPLv2 and
included the license text. (Thanks to nickoe for pointing this out.)



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5762 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-12-27 22:07:16 +00:00
werner
30f444daee Added package name (transfig) of fig2dev
git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5761 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-12-27 20:55:41 +00:00
werner
3d6c9b2a1f Added Netpbm to prerequisites.
git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5759 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-12-16 17:26:31 +00:00
werner
aca443f566 Make the icon for the currently selected instance transparent so that it better
blends in and won't be mistaken for a button.

- Makefile: generate icon XPMs with transparent background
- gui_util.c (make_image): set transparency color to white
- gui_util.c (make_transparent_image): new function to return a transparent
  image created from an XPM
- gui_tool.c (get_icon_by_inst): make the returned image transparent instead of
  opaque
- icons/vec.fig, icons/arc.fig, icons/line.fig, icons/rect.fig, icons/circ.fig:
  darkened to increase contrast on grey background



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5758 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-12-16 17:25:13 +00:00
werner
b37a8599d9 It can sometimes be unclear what exactly has been selected. To improve this,
we now display an icon for the currently selected instance in the status area.



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5757 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-12-15 21:24:30 +00:00
werner
83669c6db7 When entering the first vectors, where were a number of display anomalies
such a vectors pointing in the wrong direction. They were caused by overflows
due to inadequate zoom settings.

- gui.c (change_world): if the extents have grown, zoom to extents



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5756 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-12-15 20:05:37 +00:00
werner
a830226830 When no instance is selected, show the polar coordinates of the current
pointer position relative to the user origin in the radius/angle fields.
This helps to make quick manual measurements, e.g., of clearances.

This also fixes the following bug:
- gui_canvas.c (refresh_pos): showed canvas coordinates instead of model
  coordinates



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5755 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-12-15 19:33:15 +00:00
werner
2a819a82d7 Added a crude hack to increase the robustness of font scaling. (This can
be necessary if printing unusually large components.)

- postscript.c: in "maxfont", if we get a zero-sized font, dodge the division
  by zero



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5752 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-12-10 12:02:02 +00:00
werner
c6312cd313 A bit of cleanup, as suggested by Chitlesh Goorah.
- moved all examples to examples/
- README: updated and corrected example invocation



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5748 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-12-02 15:36:00 +00:00
werner
582e2391de The absolute Y position in the status bar was actually the X position. Oopsie.
- gui_canvas.c (update_pos): display pos.y and not pos.x in the sys_y field



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5734 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-12-01 13:16:47 +00:00
werner
6f2dc7fb0b Added functions sin(), cos(), and sqrt().
git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5732 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-12-01 12:43:59 +00:00
werner
9cd195bf5b When entering a name with variable expansion, the "invalid character in
variable name" error was never cleared.

- inst.c (validate_pad_name): call status_begin_reporting before expanding the
  string, to clear any previous error
- expr.c (expand): if the last character in the name is a dollar sign, print
  "incomplete variable name" instead of "invalid character [...]"



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5731 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-12-01 10:50:55 +00:00
werner
1613d4bdbc Trying to save arcs would crash fped.
- dump.c (print_obj): removed free(s2) left over from before the reduction of
  allocations



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5728 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-12-01 01:29:07 +00:00
werner
56371f440a Creation of a rounded pad could crash fped.
- gui_tool.c (end_new_rpad): didn't initialize obj->u.pad.type, which could
  cause pad_type_to_layers to abort
- postscript.c: added experimental code for full-page printing (doesn't work
  properly yet)



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5727 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-12-01 01:04:32 +00:00
werner
a26b79041b - inst.c (inst_select): cycle through instances globally, not only within the
same priority



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5716 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-11-27 23:31:03 +00:00
werner
1daa0068d5 Vector name generation could produce duplicates if vectors were moved or
deleted. The new algorithm checks for collisions and also reduces the number
of allocations.

- dump.c (generate_name): store the name in the vector being named
- dump.c (generate_name): compare the new name against all names in use
- dump.c (base_name, obj_base_name, print_label): don't allocate the name
- dump.c: changed all users of the above functions accordingly



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5715 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-11-27 19:55:25 +00:00
werner
907bcf919b Fixed some bugs in the vector list re-ordering function. This should work now,
but there's another problem in the dumping code that still spoils the fun.

- inst.c (do_move_to_vec): marking algorithm propagated an uninitialized value
- inst.c (do_move_to_vec): we have to clear the marks of vectors that are 
  before the vector being moved, because they will still be visited and 
  propagated



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5714 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-11-27 19:18:44 +00:00
werner
2dffbfeaa9 When moving a vector, the list order could get confused, resulting in a
segfault, failure to update the screen content, and assigning of invalid 
references.

- gui_tools.c: removed duplicate (harmless) line 
- inst.c: when moving a vector to a new base, we may have to reorder the list
  so that the assertion vectors always follow their bases is still maintained.



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5713 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-11-27 16:23:35 +00:00
werner
b6e5c6d20a - gui_inst.c (gui_draw_rpad): when drawing an outline instead of filling, use
two lines instead of a rectangle



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5699 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-10-21 15:04:56 +00:00
werner
549a15def5 For future extensions.
- fped.c: added cpp-like command-line options -D, -U, and -I



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5698 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-10-20 23:50:45 +00:00
werner
cd830046fa 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)



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5696 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-10-19 15:00:30 +00:00
werner
c172870dfd - README: added link to the GUI manual
- added a conceptual explanation of instantiation (with picture)



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5636 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-09-13 13:16:39 +00:00
werner
192ec568d8 - inst.c: cleanup_inst leaked memory when using special pads
- changed pad classification in instances from bare/other to copper/special
- moved LAYER_* definitions from layer.h to layer.c
- after instantiation, we perform sanity checks on pads and remove layers from
  coppery pads that are handled by a special layer
- fped.y: the line number in objects was never set
- overlap.c: fixed overlap calculations
- gui_tool.c: end_new_pad didn't initialize the pad type



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5635 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-09-13 11:11:03 +00:00
werner
8df866ab2f - the set of layers of a pad is now maintained in the instance, so that we can
make adjustments when removing layers provided by specialized pads
- gui_inst.c: moved gc construction from gui_draw_pad and gui_draw_rpad to
  shared pad_gc
- layer.h: new home of all definitions related to pads and layers
- layer.c: 
- overlap.c: functions to test for overlaps of pad shapes (in progress)



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5634 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-09-13 09:58:30 +00:00
werner
c91156aac0 - gui_util.c: make container clean-out globally available as vacate_widget
- gui_status.c: the x entry are is now a vbox with variable content
- the pad type is now shown in the x entry area and can be changed by clicking
  on it



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5633 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-09-12 23:15:15 +00:00
werner
f054cdd7d5 - added "make update" that combines "svn update" with remaking the dependencies
git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5628 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-09-12 07:34:02 +00:00
werner
76c3c1c1d0 - added solder mask pad type (patch by Rene Harder)
git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5627 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-09-11 18:34:51 +00:00
werner
5c37256c09 - bare pads are now drawn in orange, so that one can see if a pad has a special
solder mask pattern 
- postscript.c: don't scale fonts down to nothing to make measurement text fit
  (in progress)



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5626 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-09-10 23:40:03 +00:00
werner
e04a8017b7 - postscript.c: don't try to print empty pad names, or we'll have a hard time
scaling that zero-sized box to fill the available space



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5620 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-09-08 19:37:47 +00:00