Re: GNOME::Editor

> I need an editor for photon, and I don't think it's any use for me
> to write yet another editor, so I intend to reuse existing ones.
> The way I want to communicate with the editor would be through CORBA.
> I'll probably need some extra functionality that is specific to
> photon in the interface, but there would also be a lot of functionality
> that isn't photon specific. So, I thought there should be a GNOME::Editor
> interface from which I could derive.

A GNOME::Editor interface is indeed very important.

I looked at your interface, and I think we can improve it a bit.

First of all, you do not want to have the Editor interface handle
various "file instances" which is what your FileID tag does.

I suggest you have an EditorFactory object (you derive this from
GNOME::GenericFactory, look in $prefix/share/idl/gnome-factory.idl). 

So, you need each GNOME editor to implement two interfaces: the
GNOME::GenericFactory which will return object references to

module GNOME {
  inteface TextFactory {
    Object find_file (in string path);
  interface TextEditor {
    exception NotFound {};
    exception SaveError {};

    void open (in string path) raises (NotFound);
    void save (void) raises (SaveError);
    void save_as (in string path) raises(SaveError);

    void close (void);

    void goto_line (in unsigned long line);
    void scroll_to_line (in FileID id, in long line);

  interface SourceEditor {
    void jump_to_fn (in string name);

To get this working with the gnorba libraries you want to use:

repo_id=IDL:GNOME/GenericFactory:1.0 IDL:GNOME/EditorFactory:1.0
description=Some Text editor

description=Some Text editor window.

So your application would just need to call:

   editor = goad_server_activate_with_id (NULL, "some_text_editor", 0, NULL);

GNORBA will launch the factory for you and invoke the factory method
to get a new reference to the editor interface for your specific


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