Re: GNOME::Editor



On Mon, 1 Mar 1999, Martijn van Beers wrote:

> module GNOME {
>   interface Editor {
>     typedef unsigned long FileID;
> 
>     FileID OpenFile (in string path);
>     void SaveFile (in FileID id);
>     void CloseFile (in FileID id);
>     void GotoLine (in FileID id, in unsigned long line);
>     void Scroll (in FileID id, in long nroflines);
>   }

I don't like this (no offense intended :). Here's how I'd do it:

#include "bonobo.idl"

interface TextEditor : GNOME::Bonobo::Document {
  attribute unsigned long currentLine;
  oneway void Scroll(in long offset);
};

Or something like this :-)

The basic problems with your interface:
	. Using FileID instead of providing a proper per-open-file object.
	. Not separating the generic operations from the ones specific to
	a text editor.
	. Providing a way to set state (GotoLine) without providing a way
	to query it.

My suggestion cures all three problems. However, Bonobo isn't quite ready
yet; talk to miguel about this.

My $0.02,
-- Elliot
"In film you will find four basic story lines. Man versus man, man
 versus nature, nature versus nature, and dog versus vampire."
    - Steven Spielberg




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