Okay,
Getting stuck in DFW because of weather was frustrating, but it meant that I got Inkscape stuff done :)
I've got it so that I new window does not pop up for script based effects. But, you loose the current layer (and a warning prints on the console). Not good.
I think what I want to do is be able to find every window that references a particular document, and figure out what their current layer is. I couldn't figure out a way to do that.
It looks like the list I want is in the Inkscape::Application, but I can only get that through a private variable in SPView (or Desktop). Am I missing something on how this should work?
--Ted
On Mon, Jun 06, 2005 at 12:43:17AM -0700, Ted Gould wrote:
I think what I want to do is be able to find every window that references a particular document, and figure out what their current layer is. I couldn't figure out a way to do that.
It looks like the list I want is in the Inkscape::Application, but I can only get that through a private variable in SPView (or Desktop). Am I missing something on how this should work?
That's probably correct. The encapsulation for SPView is a slow refactoring in progress. Ultimately, those should have a C++ style interface but since SPView is used pretty extensively through the codebase, it may be a while before its all sorted out.
Bryce
Quoting Ted Gould <ted@...11...>:
I think what I want to do is be able to find every window that references a particular document, and figure out what their current layer is. I couldn't figure out a way to do that.
Well, it sounds like what you're doing is tearing down the old document and basically rebuilding a new one in place?
It's probably better if you arrange for some notification mechanism (i.e. a pair of additional signals on SPDocument) that all attached SPViews can watch in turn to know when to save and restore state like the id of the current layer, etc.
i.e.:
1. call "save view state" signal on SPDocument (all attached SPViews save state automatically)
2. teardown/rebuild document
3. call "restore view state" signal on SPDocument (all attached SPViews restore their state automatically, the best they can)
Much cleaner than grovelling through SPViews from the top down.
SPViews potentially have more intrinsic state than just the current layer -- it's best if you let them look after themselves in this regard. Otherwise, you're going to open up a nightmare can of architectural spaghetti.
-mental
participants (3)
-
unknown@example.com
-
Bryce Harrington
-
Ted Gould