Re: new Desktop::Editor



Dave Camp wrote:
> Here's my suggestion:
> 
> What is currently Desktop::Editor should be split into two
> interfaces: one representing the text buffer, and one
> representing a view of the text buffer.  The viewer interface
> would have the ui-related functions (scroll_*, etc).  The
> buffer interface would contain the other methods defined in your
> Desktop::Editor interface.  In addition, it would contain methods
> for managing views of the buffer, such as (for example) get_active_view(),
> get_views(), and new_view().
> 

I agree with this. For inspiration one can look at how emacs implements
such functionality at the C level for buffers and windows (views).

This also allows creating specialized views for the editor, for example,
DebugView for an ide. This specialized view would include additional
functionality for displaying breakpoints and execution lines.

You'll find that once you try to shoehorn existing editors into an
IDE you almost have to have this architecture.

I would also like to see something like callbacks for text changes
in the buffer. If you have a source browser and source browser view,
you want to update your tags and view as new lexical elements
are added.

One could argue that an EditorView would also have callbacks for
current cursor position. Thus, if you had a view displaying
things like current function, current locals, etc. the view
could be updated as the cursor changes position.

Thomas



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