Re: [Fresco-devel] Text styles/cloning graphics
Mourad De Clerck <[email protected]>
| Newsgroups | gmane.comp.video.fresco.devel |
|---|---|
| Message-ID | <1033689315.5441.66.camel@blackbox> |
On Thu, 2002-10-03 at 23:24, Tobias Hunger wrote: > > > You see the problem: We need to duplicate the 'bold' decorator! > > > > right. But I think it's a bit early to jump to the conclusion that we > > need a clone method. I don't yet fully understand the context in which > > that could happen. Just 'clone' won't be enough, anyway. How do you > > specify whether you want a shallow or a deep clone (or any specific > > depth) ? > > It needs to be a deep copy, doesen't it? You cannot use a shallow copied > object in some place of the scenegraph and the 'original' in another, can > you? If we want to use a (chain of) decorators in the styletable, we need a way of copying it the minute there's a linebreak. The alternative is regenerating it from some parsed tags for instance. But that's uglier insofar that you introduce an alien concept in the Textkit interface, and that you have to always make sure the kinds of "tags" and the kinds of decorators are synchronised. Fwiw, I like this idea of composing styles the way you do everything and hand them along with the textbuffer to the textview - it can be quite powerful, like Tobias mentions with his html/url example. > > > How about making that possible with a clone() method on the Graphics? > > > That might be useful for other things as well, don't you think? Or is the > > > whole decorator approach wrong? > > > > Dunno. It's not trivial, to say the least. <snip> Is it a good idea to have a clone() for other purposes? > > > But the real problem is that you don't have any > > control over the 'style' nodes in the graph, i.e. you can't normalize > > it, i.e. remove dead nodes (such as a 'blue' decorator wrapping a 'red' > > decorator...). > > Yes... but you cannot do so all over Fresco right now. So why do you allways > bring this up wrt. text? Of course you can specify a arbitrary long sequence Is there a case where this normalisation should not happen, I mean, where a blue decorator wrapping a red decorator is intended? If it's not maybe the server should "normalize" the SG on insert if that's possible. -- Mourad