2008/3/14, Sven Neumann <[EMAIL PROTECTED]>:
>  On Thu, 2008-03-13 at 08:56 -0700, Bill Skaggs wrote:
>  > In Gimp, and other programs that use Glib, *modules* are
>  > program-fragments that can be compiled separately from the main
>  > application, and linked in dynamically while the program is running.
>  > They differ from plug-ins in that once loaded they function as part of
>  > the application, not as separate programs that communicate with the
>  > application.  The danger of modules is that if they crash, the whole
>  > program crashes with them.  The power is that they have complete
>  > access to everything that Gimp can do.
> Sorry, but the latter is not true. We don't allow modules to access
>  internals of the GIMP core. A module implements a certain class and
>  that's it. It must not do any calls into GIMP. Thus, modules are a lot
>  more limited than plug-ins as the plug-in API is richer and more
>  powerful.

I think design of API is the biggest issue.

Performance is very important for interactive tool, From my experience, it is
necessary to allow modifier objects to access some of gimp core objects
or internal image buffer directory to keep high performance.
Of course it is also important to limit the functions that modifier
can access to
keep the framework simple and to avoid the dependency on Gimp core API.

I am currently refactoring the code and APIs. The brush and modifiers share
some context. Modifiers get informations like pixels, alpha channels
and bit depth etc.
from the drawable object, and modify shared context. Then brush object
draw strokes
using the context.

GimpDrawable, GimpPaintOptions

| Get Information (read only)
                    Set       +-------------------+   Modify           V
   GimpPaintCore ------------>| GimpPaintContext  |<-----------GimpPaintModifier
                              | - coords          |
                              | - colors          |
                              | - canvas_buf      |
                              | - mask            |
                              | - opacity         |
                                       | apply or replace

In this model, modifiers can access share context and read only
operation of GIMP core
To implement the brush modifier framework, I want to allow some
"privileged" modules to
access internals of Gimp core objects (those are passed as the
arguments of the callback

Gimp-developer mailing list

Reply via email to