[openbeos] Re: StyledEdit news of various interest

  • From: "Ingo Weinhold" <bonefish@xxxxxxxxxxxxxxx>
  • To: openbeos@xxxxxxxxxxxxx
  • Date: Thu, 17 Jul 2003 00:22:20 +0200 CEST

On Wed, 16 Jul 2003 14:41:40 -0700 PDT "Andrew Bachmann" <
shatty@xxxxxxxxxxxxx> wrote:
> > On Tue, 15 Jul 2003 23:01:54 -0700 PDT "Andrew Bachmann" <
> > shatty@xxxxxxxxxxxxx> wrote:
> > > OBOS StyledEdit now stands as an example of how to use this 
> > > functionality.  I'm hoping that 
> > > something like this could be made a standard through beunited.  
> > > However I don't really hope 
> > > that this particular interface/implementation makes it. :-)
> > 
> > Well, if the naming and some details would be adjusted to be more 
> > BeOS-
> > like, I think, it can go into our libbe as a private API for the 
> > time 
> > being. :-)
> 
> Yeah I have been picking up some un-beos habits from my co-workers
> since I have been spending a lot of time doing my real job lately. :-
> )

That in itself is a bad habit. ;-)

> Putting it into libbe.so seems okay, or perhaps libtextencoding.so ?

Yep, libtextencoding is the better place.

> > > Although it works, it may be 
> > > preferable to support a different enumeration interface than the 
> > > method I chose at the time.  
> > 
> > The typical roster interface for enumeration would be more like:
> > 
> >   status_t GetNextCharacterSet(BCharacterSet *charSet);
> >   void RewindCharacterSets();
> 
> Yeah this is more like what I was thinking of.  Possibly with a 
> cookie
> arg?

If the roster would end up as a singleton, then it would make sense to 
make it stateless. Otherwise, it could be light-weight (i.e. if storing 
the data is moved to another entity (e.g. the registar)) and track the 
state internally. Just like BVolumeRoster, BMediaFormats, BEntryList, 
BNode,...

[...]
> > > BTextView should be expanded to support SetEncoding/Encoding.
> > 
> > Mmh, is that really necessary? I always found it compelling, that 
> > the 
> > BeOS always uses UTF8 throughout the whole API, providing 
> > conversion 
> > functions for other encodings only.
> 
> Ah, I agree.  Somehow or another I was thinking GetStyledText was a
> BTextView method.  However, it is not.  As such a better solution 
> would
> probably be to add an optional argument to GetStyledText which is the
> encoding.  This puts the burden on the app developer if they want to
> save out in the encoding that it was loaded in, but I don't feel too 
> bad
> about doing that.

Yes, that sounds good.

[...]
> >   LIBRARY_PATH=distro/x86.R1/beos/system/lib:$LIBRARY_PATH distro/
> > x86.R1/beos/apps/StyledEdit
> > 
> > makes it work properly.
> > 
> > BTW, read-only files aren't handled correctly. The R5 StyledEdit 
> > doesn't allow editing them, while OBOS StyledEdit does.
> 
> Interesting.  But is the best solution to not allow editing at all, 
> or just not
> to allow saving over a read-only file? (or both)

Don't know. One could also show the file read-only, providing the 
functionality to make it writable -- e.g. BeIDE has a tiny button with 
a lock at the bottom to toggle between read-only and read-write. A 
checkable menu item e.g. in Edit menu would do as well.

CU, Ingo


Other related posts: