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

44 Commits

Author SHA1 Message Date
Werner Almesberger
15e5811aea gui_frame.c (loop_scroll_event): reverse direction
For consistency with traversal of package list.
2015-01-09 08:57:21 -03:00
Werner Almesberger
5a1fd80fc8 new sidebar mode "Show packages"
Yes, now one can finally go through header.fpd and its 160 packages
without going crazy !
2015-01-09 01:58:29 -03:00
Werner Almesberger
73389fba76 sanitize show var/code handling; switch to enum for future changes 2015-01-09 00:57:36 -03:00
Werner Almesberger
23a33488d4 gui_frame.c: allow scrolling through packages also on the name template 2012-08-21 02:13:55 -03:00
Werner Almesberger
5d76af2d7c make variable type changes also commit the value (name) being edited
This streamlines the workflow.
2012-05-28 12:15:15 -03:00
Werner Almesberger
f2d3986600 fix whitespace anomalies
/ \t/, / $/, and /\t$/
2012-05-28 03:11:15 -03:00
Werner Almesberger
4c3dea7111 support switching variables between assignment and key (WIP)
This is a little awkward: to change a variable used as key to an
assignment, one first had to change the name such that it doesn't
clash, hit Enter, and then edit the variable again to change its
type.

Variable type changes should pick up the edit in progress and allow
a type change to also imply acceptance of the variable.
2012-05-28 02:54:50 -03:00
Werner Almesberger
326a480b63 gui_frame.c: display a question mark before variables used as key 2012-05-28 02:53:01 -03:00
Werner Almesberger
424b74e482 change use of curly braces with "if-else" to kernel style 2012-05-25 13:33:54 -03:00
werner
d4c4031b9a Added support for reordering frames in the GUI.
- gui_frame.c (build_frame_label): the root frame doesn't participate in any
  form of dragging, so we don't set up dragging for it at all
- gui_frame_drag.c (pick_table_cell, swap_table_cells_by_coord, 
  swap_table_rows): helper functions for swapping rows in a Gtk table
- gui_frame_drag.c (swap_frames, drag_frame_motion, setup_frame_drag): added
  support for reordering of frames by dragging
- gui_frame_drag.c (SWAP, swap_vars, swap_values, swap_rows): removed SWAP(). 
  Use swap() from util.h instead.
- TODO: removed frame ordering entry



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5970 99fdad57-331a-0410-800a-d7fa5415bdb3
2010-05-30 20:30:24 +00:00
werner
dbace0b2fa Cleaned up the disgusting mess that was the list of frames. The changes:
- removed root_frame. "frames" now takes its place.
- removed frame->prev. In those few cases where we need the previous frame (for
  deletion and dumping), we walk the list or recurse.
- the list of frames is now in GUI order, not file order.
- when reading the .fpd file, put the root frame first and leave it there.
- instead of walking the frames list and excluding the root frame by testing
  frame->name, just start at frames->next
- likewise, instead of testing !frame->name just use frame == frames



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5948 99fdad57-331a-0410-800a-d7fa5415bdb3
2010-04-28 00:34:32 +00:00
werner
af0d2c78cb Removing the old interface for adding frame refrences. Also updated the
documentation.

- Makefile, icons/frame_locked.fig, icons/frame_ready.fig: removed the icons of
  locked and ready frames 
- gui_tool.c: removed the frame tool and all the image handling associated with
  it, leaving only the bits in place that are used by frame to canvas dragging 
- gui_tool.h, gui_tool.c (tool_frame_update, tool_frame_deleted), gui_canvas.c
  (key_press_event), gui_frame.c (popup_del_frame, select_frame): removed
  the notifications of frame changes
- gui.html: removed the old clumsy frame reference procedure and described the
  new way



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5937 99fdad57-331a-0410-800a-d7fa5415bdb3
2010-04-25 00:11:45 +00:00
werner
a4d2926b2d Working towards the dragging of frames. Changed the press/drag/release logic of
tables such that items are selected on release and we can thus drag without
selecting. (From a user point of view, selecting would be fine. But selecting 
may sometimes cause a change_world or similar, destroying the widget, which 
upsets drag and drop.)

- gui_frame_drag.c (setup_var_drag, setup_value_drag): moved targets to file
  scope
- gui_frame_drag.c (has_target, drag_var_motion, drag_value_motion): Gtk
  doesn't check target compatibility for us, so we have to do this explicitly
- gui_frame_drag.c (drag_begin): don't leak the pixbuf
- gui_frame_drag.c (is_dragging, drag_end), gui_frame_drag.h: for drag vs.
  activations on button release, we now can test what is being dragged. For
  this, we have to explicitly clear the variable "dragging" when done.
- gui_frame_drag.c (setup_var_drag, setup_value_drag): moved common setup to
  setup_drag_common
- gui_frame_drag.c (setup_frame_drag, drag_frame_motion), gui_frame_drag.h, 
  gui_frame.c (frame_select_event, build_frame_label): added infrastructure for
  dragging frames
- gui_frame_drag.c (setup_canvas_drag, drag_canvas_motion), gui_frame_drag.h,
  gui_canvas.c (motion_notify_event, make_canvas): added infrastructure for
  dragging to the canvas
- gui_frame.c (table_var_select_event, table_value_select_event, build_table):
  split logic into press and release action, so that we can drag without
  implicitly selecting



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5930 99fdad57-331a-0410-800a-d7fa5415bdb3
2010-04-23 22:01:56 +00:00
werner
093a34f860 Added support for reordering rows and columns in a table via the GUI. To move
a column, drag the variable or any of its values and drag horizontally. To move
a row, drag one of its value vertically.

- gui_frame.c (table_var_select_event, table_value_select_event): return FALSE
  if dragging is possible
- gui_frame.c (build_table), gui_frame_drag.h, gui_frame_drag.c, Makefile:
  support for rearranging tables using Gtk's drag and drop mechanism
- TODO: two items less



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5929 99fdad57-331a-0410-800a-d7fa5415bdb3
2010-04-23 13:43:19 +00:00
werner
e302162a70 When unselecting a value selected for editing in a table with a single row, the
unselected value was set to the background color for an inactive row. Now it's
set to the color of an active row.

- gui_frame.c (unselect_value): to detect a table, consider not only the number
  of rows but also the number of columns
- gui_frame.c (unselect_value, edit_value_list): use COLOR_EXPR_* for
  expressions, not COLOR_VAR_* (this has no visual effect for now, since the
  colors in questions have the same value)



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5918 99fdad57-331a-0410-800a-d7fa5415bdb3
2010-04-19 12:23:04 +00:00
werner
c8cf877204 Simplified and improved the design of wrapped tables.
- gui_frame.c (build_table): don't add an extra column for wrapped tables. They
  look better without it.
- gui_frame.c (build_table): add two pixels of background color between parts
  of a wrapped table
- gui_style.h (FRAME_AREA_MISC_WIDTH): reduced to better fit real layout



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5848 99fdad57-331a-0410-800a-d7fa5415bdb3
2010-02-19 14:00:55 +00:00
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
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
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
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
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
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
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
d9b7ad94ec - when displaying loop iterations, we now use the active count, not just the
last count
- loop iterations now show the actual value, not the zero-based iteration 
  number
- gui.html: added a GUI manual (in progress)



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5531 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-08-22 22:55:39 +00:00
werner
de044ca61f We can now generate part families.
- README: added build prerequisites
- "part name" is now more correctly called "package name"
- changed keyword "part" to "package"
- removed inst_debug and struct inst_ops.debug functions - never really used 
  them anyway
- we can now generate multiple packages from a single file



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5478 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-08-17 20:42:51 +00:00
werner
be86e276b8 - adjust measurement bbox for projection (still not perfect, but better)
- we can now scroll-wheel through table rows
- added menu branch "View" with zoom and var/code display controls
- commented out is_min_of_next until its fate is decided, so that we don't get 
  a warning



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5462 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-08-16 12:04:01 +00:00
werner
e3794589a8 - when editing a value list, we need to return the values and free them in case
of successful validation
- free previous expression in set_col_values
- added rapid entry also for table values (fill the row)



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5460 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-08-16 05:05:12 +00:00
werner
64f80e84a2 Columns and loops can now be entered in one step as var = val, val, ...
- moved definition of expr_result from expr.c to fpd.y
- new header file fpd.h with all the things fpd.l and fpd.y export
- edit_var already calls edit_nothing, so there's no need to call it before
- added rapid entry option for loops, variables, and columns: var = val, ...



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5459 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-08-16 04:12:37 +00:00
werner
6f00ab6ac2 - KiCad is very liberal when it comes to valid part names, and so are we now
(i.e., we now accept anything but control and non-ASCII characters)



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5446 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-08-14 22:12:16 +00:00
werner
d39ae30f6e - added rounded pads
- initialize item_widget to NULL if not showing items or bad things happen



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5440 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-08-14 10:18:40 +00:00
werner
dbcfae8261 - objects selected via the item view can now be edited directly, even if no
instance is found. This allows recovery from mistakes where a failing item
  never gets instantiated.



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5434 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-08-13 10:57:39 +00:00
werner
8e54c1f7c3 - added the usual COLOR_ prefix also to TOOL_SELECTED/TOOL_UNSELECTED
- instantiate_meas if a mesurements has no samples, do the next one, don't stop
  completely
- when instantiation fails, the corresponding vector, object, or loop is now
  marked red in the variables/items list.



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5432 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-08-13 09:30:16 +00:00
werner
9f2ea8cdc2 - reduced padding around item lines
- item ordering heuristics failed to properly use "."
- updated description of "need" in dump.c
- saved fbga.fpd and sc89.fpd with new ordering



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5427 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-08-12 17:01:40 +00:00
werner
2bae5614d9 - when selecting an object via the item list, make its frame active
- having variables and items on the screen at the same time was too much. We 
  can now toggle with "/" while the canvas has the focus. (This needs better 
  controls.)



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5425 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-08-12 14:44:17 +00:00
werner
a648cb888f - changed item list font to Courier, which looks a lot tidier
- active items can now be selected from the item list (selecting inactive items
  will be a little harder)



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5424 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-08-12 11:26:59 +00:00
werner
e65d90947c - put hbox around frame table so that it doesn't grow when we give it more
space than it needs
- dump.c: separated ordering function from actual printing
- added list of vectors and object (on the right side of the variables)



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5423 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-08-12 10:45:52 +00:00
werner
386a9fd50b - added support for string constants to unparse()
- implemented eval_str
- expand() now tries to obtain a string
- added example fbga.fpd to demonstrate use of strings
- when invoked with an inexisting file, fped now starts with an empty model,
  instead of getting confused 
- we now religiously call edit_nothing before adding fields to edit, so that
  we won't create a loop through edit-next



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5421 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-08-11 23:26:38 +00:00
werner
75d9780131 - band-aid: make canvas grab focus on click and scroll, so that it's easy to
get it back when we lose it
- improved heuristics for measx/measy: instead of looking for "next" or "max"
  on secondary coordinate, pick the one that's closest. I.e., if there's a
  chance to just connect with x' = 0 or y' = 0, do it.
- mouse wheel on loop value now selects next/previous value
- corrected proximity calculation for measurements
- vec/frame/meas toggle now deselects, so that we don't accidently leave a
  supposedly hidden item selected



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5413 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-08-09 01:51:20 +00:00
werner
e677ee1691 - for consistency, renamed gui_tools to gui_tool
git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5410 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-08-08 19:44:17 +00:00
werner
a1de1ee2d9 - moved handling of frame area from gui.c to gui_frame.c and cleaned up their
includes



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5409 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-08-08 19:35:16 +00:00