Quantcast

Loosing current layer

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Loosing current layer

Ted Gould
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


signature.asc (196 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Loosing current layer

Bryce Harrington
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


-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.  How far can you shotput
a projector? How fast can you ride your desk chair down the office luge track?
If you want to score the big prize, get to know the little guy.  
Play to win an NEC 61" plasma display: http://www.necitguy.com/?r=20
_______________________________________________
Inkscape-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/inkscape-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Loosing current layer

MenTaLguY
In reply to this post by Ted Gould
Quoting Ted Gould <[hidden email]>:

> 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


-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.  How far can you shotput
a projector? How fast can you ride your desk chair down the office luge track?
If you want to score the big prize, get to know the little guy.
Play to win an NEC 61" plasma display: http://www.necitguy.com/?r 
_______________________________________________
Inkscape-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/inkscape-devel
Loading...