Questions about the Backend Interface
linas@linas.org
linas@linas.org
Tue, 6 Mar 2001 15:32:24 -0600 (CST)
It's been rumoured that Derek Atkins said:
> > > > 2) There appears to be no way for the backend to trigger an
> > > > event to the engine/GUI if something happens. For example,
> > > > I'd like the backend (server) to signal to the engine
> > > > (client) that some information changed, or perhaps even
> > > > pushing the changed information.
> >
> > Terminology, as used in gnucash:
> > -- backend: the part of the client that knows how to talk to servers.
> > -- engine: the part of the client that provides a data cache and a
> > uniform API to the GUI.
> >
> > To answer your question: in practice, the backend can 'push' new data
> > into the engine, because it has access to all the pointers & structures.
>
> Hrm. Then perhaps the best way to 'trigger' an event is to have the
> server push the new data to the backend, and the backend can then push
> it into the engine and notify the engine that the data has changed?
Yes. Although the last step can be skipped: the backend itself
can trigger the event mechanism to tell the gui that something changed
(using suspend_events and resume_events in gnc-event.c, I beleive).
--linas