Andre Poenitz wrote:
On Tue, Sep 05, 2006 at 03:33:36PM +0200, Abdelrazak Younes wrote:
 char const * const dialognames[] = {
 "aboutlyx", "bibitem", "bibtex", "box", "branch", "changes",...
For this I'd actually prefer a factory that's initialized by static
singleton or such.
Could you elaborate a bit please?
The different dialogs are accessed with a string key. The key could as well be an int without any difference in behaviour, that's what I mean.

The enum requires a place where all dialogs are known (at least
conceptionally) so that we can define an
  enum { dialogFoo, dialogBar .... }

With a factory (in an ideal world...) we could (in theory...) have a
core completely ignorant of concrete dialogs. 'lfun-insert-inset foo'
would just ask the factory to create a dialog by a generator registered
under the name 'foo'.

I agree that the core should not know about concrete dialog. But I would like to be sure that the dialog IDs are exactly the same for all frontends. For this I need the enum to be placed in src/frontend/. Then each frontend could choose to implement or not a dialog. The code in src/frontend/ is an abstraction of the frontend and does not really belong to the core.

Abdel.

Reply via email to