GNOME::Editor; new try



Hi,

a new try at a GNOME::Editor we can all live with :)
This one puts all the non-file-changing stuff in GNOME::File, as it
could be useful to something like gnome-less.

cya,
Martijn

~~~~~

module GNOME {
   enum SEEKFROM {
      SEEK_START,
      SEEK_CURRENT,
      SEEK_END
   };

   typedef SearchOption REG_REGEX = 1
   typedef SearchOption REG_ICASE = 2;
   typedef SearchOption REG_NOSUB = 4;
   typedef SearchOption REG_NEWLINE = 8;

   interface FileFactory {
      exception NotFound {};

      Object open (in string path) raises (NotFound);
   };

   interface File : GNOME::object {
      exception SaveError {};
      exception OutOfRange {};
      exception NotFound {};

      readonly attribute string path;
      readonly attribute unsigned long currentline;
      readonly attribute unsigned long currentcolumn;

      void scroll (in long                offset,
                   in GNOME::SEEKFROM     whence) raises (OutOfRange);
      void search (in string              regexp,
                   in GNOME::SEEKFROM     whence,
                   in GNOME::SearchOption flags) raises (NotFound);

      void save () raises (SaveError);
      void save_as (in string path) raises (SaveError);
      void close ();
   };

   interface EditorFactory : GNOME::FileFactory {
      Object new ();
   };

   interface Editor : GNOME::File {
      void insert (in string              new);
      void delete (in unsigned long       charcount);
      void replace (in string             regexp,
                    in string             newstring,
                    in GNOME::SEEKFROM    whence,
                    in GNOME::SearchOption flags) raises (NotFound);
   };
};

-- 
Martijn van Beers
martijn@earthling.net



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