gschem: Add concept of action positions.
commitc2487dcd059a3443ebfaca69906e6c1024289175
authorPeter TB Brett <peter@peter-b.co.uk>
Sun, 1 Sep 2013 21:19:01 +0000 (1 22:19 +0100)
committerPeter TB Brett <peter@peter-b.co.uk>
Sun, 1 Sep 2013 21:19:01 +0000 (1 22:19 +0100)
treefbb7aa13b52e668555a06b8b864b0e466cd93a6e
parent4f69c81bcda4fd5ce5c871122988d0c1df3c62e3
gschem: Add concept of action positions.

Often in gschem actions it may be useful not to use the actual current
mouse pointer position but to use the mouse pointer position that was
current when the action was invoked.

This patch adds action positions.  An action is invoked at a
particular point in the schematic by using the eval-action-at-point!
procedure.  This can be called with or without an argument to specify
the point, e.g.

  (eval-action-at-point! add-line) ;; Use the current mouse position.
  (eval-action-at-point! add-line '(100 . 100)) ;; Start at (100, 100)

The pointer position can only be considered reliable when the user was
actually clicking on or pointing at the schematic view area to invoke
the action, rather than on a menu or toolbar button.  At the moment
this means that an action position is only set when a command is
invoked by hotkey.
gschem/include/prototype.h
gschem/scheme/gschem.scm
gschem/scheme/gschem/action.scm
gschem/src/g_action.c