On Dec 25, 2009, at 4:28 AM, Alex Leone wrote:
- This eventually calls src/document.cpp:601: SPDocument::fitToRect(Geom::Rect const &rect)
My plan was to add marginTop, marginLeft, etc as parameters to SPDocument::fitToRect, and somehow pass these parameters through the void *data parameter in sp_action_perform. However, all the other calls to sp_action_perform in inkscape set the void *data parameter to NULL, and it looks like the action handler doesn't have any code to call free on the parameter after all the action listeners are serviced.
Am I trying to do this completely wrong?
Yes, this does sound a bit off.
the data parameter on sp_action_perform is really some C legacy approach for passing a pointer to some arbitrary blob of data.
Once we moved the C++ the 'proper' thing to do is set member values and operate on those.
Also... that is in the "action_perform" response. That should be thought of as an event trigger to "do your thing". Not quite the point to inject that.