sketch-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GTK+-2 and plugins


From: Bernhard Herzog
Subject: Re: GTK+-2 and plugins
Date: 07 Jun 2003 20:19:27 +0200
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/21.2

[for some reason the mail I'm replying to hasn't shown up on
sketch-devel AFAICT and it's not in the archives, so I'm quoting most of
it. Also, I'm sorry that it took so long for me to get back to this :( ]

"David Boddie" <address@hidden> writes:

> [The first part of this message is probably more relevant to
> Bernhard H. than to most other readers.]
> 
> 1. How far off is a GTK+-2 version of Sketch 0.7?

GTK2 support is already in CVS.

> I'm interested
> in knowing because I'm considering fixing some things in 0.7.12
> but if these are likely to have been resolved in an imminent new
> release then I'll wait until it arrives before looking into them.
> In particular, I notice some strange artifacts which only occur
> when anti-aliasing is enabled.

The artifacts are most likely due to numerical problems in libart nad
thus independend of the GTK version

> 2. I've recently been experimenting with an import filter to allow
> me to browse some old desktop publisher documents using Sketch.
> Since the import filter relied on an existing filter, I decided to
> try and subclass this to take advantage of its facilities.
> The directory structure looked something like this:
> 
>   Plugins/Filters:
>   
>     drawinput.py       - the filter to reuse
>     impressioninput.py - the new filter
>     ...
>   
>     Lib/
>     
>       drawfile.py
>       spritefile.py
>       ...
> 
> Unfortunately, I couldn't make impressioninput.py import
> drawinput.py without a certain amount of reorganisation. I came
> up with this layout:
> 
>   Plugins/Filters:
> 
>     drawinput-filter.py       - a dummy filter which imports
>                                 Lib/drawinput.py
>     impressioninput-filter.py - a dummy filter which imports
>                                 Lib/impresioninput.py
>     ...
> 
>     Lib/
>       
>       __init__.py
>       drawinput.py       - the filter to reuse
>       impressioninput.py - the new filter
>       ...
>   
>       Lib/
>       
>         __init__.py
>         drawfile.py
>         spritefile.py
>         ...
> 
> This is all rather more complicated than I had in mind so I'm
> hoping that I've made an elementary error in managing modules.

This seems more complex than it would have to be. First, I'd rename the
inner Lib directory to something else, e.g. DrawFile and maybe put a new
module in there that contains all code that drawinput and
impressioninput have in common moving code out of drawinput and into
DrawFile if necessary. The new layout would become:

   Plugins/Filters:
      drawinput.py 
      impressioninput.py

      Lib/
         DrawFile/
            __init__.py
            drawfile.py
            spritefile.py
            common.py
            ...


> Is there a way to import and subclass filters from other filter
> modules?

No. At least not easily.

   Bernhard

-- 
Intevation GmbH                                 http://intevation.de/
Sketch                                 http://sketch.sourceforge.net/
MapIt!                                           http://www.mapit.de/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]