Re: MyStyle database.

Sasha_Vasko@osca.state.mo.us
Tue, 9 Feb 1999 18:34:03 -0600





>I like the idea of a single MyStyle database.  It has the advantage of
>allowing inheritance from one style to (potentially) afterstep and every
>module at once.  I agree with Doug and Michal - shared memory is not the
>way to go.

I agree to that, but note that we have the way to share data built in into
X itself.
I'm talking about properties.
We can assign one property, associated with root window, to each parsed
style
 identifyed by something like :
"AS_STYLE_ParsedStyleName".
This way, to my knowledge, is as portable as X itself is .

>We have a communication method already in place, if we care to use it.
>However, passing large chunks of text over the pipes risks killing modules

Notifications will be sent automatically - all we have to do is write a
handlers
for PropertyNotify events ! Therefore costly communications between
modules will be totaly eliminated.

>3. We might want to read all of the styles in and parse them into their
>   final form, in one process (afterstep or asconfig).  Then when a style
>   is requested, pass the result (as a completely inherited style) to the
>   requesting module.  This works because the X resource IDs are global
>   to the server.  Note that if the central repository of styles was
>   killed for some reason, afterstep and all modules would likewise
>   quickly die, as the X resources would be deallocated.

Like I said. asconfig or afterstep would parse main look file and and
create MyStyle
structures in it's final form. This structures will be stored in
properties, with names.
Module, then will read MyStyle structures, that it needs, into a local
memory and use
it.
There is an attractive idea of separating this parsing code in to special
app, that will be
run only on startup or config change, and then quit, when parsing is done.
This app can
ask X (XSetCloseDownMode) not to delete resources on exit. Problem here is
how to
cleanup those old resources, when config is updated and this app gets to
rerun.
As the band aid here I can propose, storing list of those resources as
another property,
and when app gets to rerun, retrieve them into local memory; parse new
styles;
then wait a considerable amount of time (so everyone can update it's localy
stored info )
and then deallocate those old resources and quit. This is rather awkward
way
but it might be worth trying.

Anyway as the first step - parsing main look file by afterstep will work
just fine.

Of course I expect Ethan as an expert on MyStyles ;) to advise on this
proposal..

>In all cases, we could still parse styles from the module config, and
>simply supplement them with styles from the central database.

That will work fine with offered scheme, it's only that local module config
will
need to be reparsed each time configuration updated.
One thing to take into a consideration here is that themefying of AfterStep
in this
case will be rather difficult, so we might want to vote on keeping all
styles in the single file.


>Ethan Fischer

Sasha