Extending the BeAPI/HaikuAPI

Hi there!
I have a few suggestion/wanted featues for the Haiku API (some might be there already it was a long time since a develop for Haiku/BeOS).

  • Multiline support for BStringView (and maybe even BTextControls title)
  • Attribute support for BStringView/BTextView (Maybe add BAttributedString, or something)
  • http/ftp/etc handlers for links in text.
  • Animation Support
  • Shadows (Text, Views, Windows)

An IDE with included Debugger :slight_smile:

Maybe some is already added, please give some pointers then.
Thanks!

1 Like

It would be nice if there was a way to integrate Debugger with KDevelop.

Speaking of KDevelop, does anyone know how to get it to build a project correctly? I always get errors when I try to build via the IDE. But running Make in the terminal works fine.

Would be great to build something to the tune of BeIDE with some modernization for today’s coder.

StyledEdit is just a BTextView with a BMenu and scroll bars. So you can already do multi-line and text formatting there.

We do have an API for network handlers (see BUrl and BUrlProtocolRoster IIRC), however the only protocols supported currently are http and gopher (no FTP yet).

Animation is possible in principle, you could either use the Pulse() method or your own BMessageRunner, however we should probably wrap this in an easierto use framework.

Likewise for text/view shadows: it’s possible to draw them (probably using a BGradient and B_OP_ALPHA drawing mode) but we could make this easier. Shadows for Windows would require compositing, however (or at least that’s what makes the most sense for implementing them), and app_server currently does not work that way.

If you want to display multiline text in a ListView. Do you really want to add 500 items with a BTextView each? I dont know if ListView use some smart re-use as iOS does, but it seems like a huge overkill.

I wasnt really clear when I meant http/ftp handlers for TextView/StringView. What I meant was that it automatically detect links (and highlights them) and let the user click them and it opens the default browser (again, see how it works in iOS/MacOS).

Regards
//Mikael

You switched from BTextView to BListView?

BListView is a view, and the BStringItems it contains are not. So if you want a list with 500 items, you just add the 500 BStringItems to your list view. The objects will hold just a pointer to their respective strings, so this is not too much of a problem. In cases where you really have to deal with thousands or millions of items, you can create your own widget, but a plain list view would be inappropriate from an UI perspective anyways (who wants to scroll down for hours looking for the correct item in the list?)

Detecting links is not something I would do by default in a BTextView. I’d say it’s up to the application to know what is a link and what isn’t. Applications doing this are our AboutSystem, and the RSS viewer fRiSS. We could provide this as an option, to share the code between apps, as it can get tricky to manage the highlighting, changing the mouse cursor on hover, etc.

So BStringItem supports multiline?

No, BStringItem is one item in the list with a single line of text.

If you want more complex items you need to create your own BListItem subclass and a custom Draw() function for it. See for example the network preferences, which has items with multiple texts and an icon.

Hi!

BListView is a view, and the BStringItems it contains are not.

I am very familiar with the fly wieght design that ListItems are using

So if you want a list with 500 items, you just add the 500 BStringItems to your list view.

BStringItem still only supports one line. I want to Have multiline like the description field here:

Detecting links is not something I would do by default in a BTextView. I’d say it’s up to the application to know what is a link and what isn’t.

Its not a contradiction. If BTextView supports it by configuaration, its easy for a developer to add it to the application in question.

fTextView->DetectableTypes( B_HTTP_LINK | B_FTP_LINK | B_PHONENUMBERS_LINK );

Multiline support for BStringView (and maybe even BTextControls title)

This is very much needed… I used a non-editable, non-selectable BTextView to get the “No preview available” text to wrap in Screen Saver Prefs:

// A BStringView would be enough, if only it handled word wrapping.
fNoPreview = new BTextView("no preview");
fNoPreview->SetText(B_TRANSLATE("No preview available"));
fNoPreview->MakeEditable(false);
fNoPreview->MakeResizable(false);
fNoPreview->MakeSelectable(false);

Attribute support for BStringView/BTextView (Maybe add BAttributedString, or something)

I have a crazy idea… what if we were to implement bold. italics, underline in file names using attributes to keep track of it. This trick would only work on Haiku and when you copied the file to a dumb FS like FAT32 you’d lose the formatting… but oh well. Would be seriously cool though if you could do that and would be a feature that no other OS has.

http/ftp/etc handlers for links in text.

We have the beginnings of this in AboutSystem…

Shadows (Text, Views, Windows)

We can do fake shadows now, and we should because BeOS did, but we really need a compositing window manager before we can really support this feature.

An IDE with included Debugger :slight_smile:

We already have an debugger integrated into the system which is actually pretty nice.

2 Likes

Would the OS then be formatting-sensitive as well? Case-sensitivity with files is already a cause for confusion, where a program sometimes can’t find a file if one letter happens to be uppercase instead of lowercase.

I would be happy enough with color-tags as it was done in Mac OS 7 (and possibly later versions, I don’t remember). I use it a lot in Thunderbird to quickly identify provenance of different mails, and I dont see why the native mail client wouldn’t be able to do the same.

It would be great to show unread messages with bold text, too, I guess?

2 Likes