api

Language Bindings for the C++ API: Test Program Now Runs

Blog post by jalopeura on Thu, 2011-06-02 19:49

In my last blog post, I mentioned the following goals:

- Define an interface definition language
- Define preliminary bindings for a minimal test programy
- Write a preliminary generator to create the bindings
- Write the minimal test program

These have now been achieved, and the minimal test program (in Perl) runs. It shows a window with a button, and the button label changes when the button is clicked.

It still has problems, of course. For example, after 32 messages pass through MessagesReceived, it dies. But it's nice to see something actually running.

Anyone who would like to test it may check out the code at http://svn.osdrawer.net/perl-haiku-kits. There are instructions for generating and compiling the bindings in the repo.

The priority goals remaining for the first quarter are:
- Test threading issues
- Make a final choice on target languages

These additional goals (mentioned in the last post) may need to be postponed to the second quarter.
- Expand preliminary bindings and add new bindings
- Write test programs for the bindings
- Write documentation for the bindings

Language Bindings for the C++ API: First Quarter Goals

Blog post by jalopeura on Wed, 2011-05-25 09:03

During the bonding period I looked into Python's extension tools; they seem to be straightforward and at first glance look relatively easy, so Python is definitely an option. I asked on the mailing list what other languages people were using on Haiku, and Neil kindly made a poll based on the results. Depending on the popularity of the language (based on the poll results) and the ease of writing extensions, I will make a final decision on which langauges to target during GSoC.

I also looked into various ways of defining the extensions. I have decided to use an interface definition and generate bindings from that. I looked at pidgen's IDL, but it didn't have all the necessary information. I also considered parsing the header files directly, but that would also lack some necessary information. I am currently working on defining an SGML-esque interface language. Using an SGML-like language means that if a new target needs information not currently contained in the interface definition, this information can be added without disrupting the parsers for existing targets. SGML also compresses nicely. I am, however, still open to suggestions for other solutions, since I haven't (yet) put enough time into this one to be irreversibly committed to it.

My goal for the first week is to get minimal functionality; I have selected Perl as the target for this portion because I already know how to write extensions for Perl. I am implementing enough of the Application, Message, Window, and Button objects to write a small test program. This should let me work out any issues with the interface language.

Once this test program is working, it should also allow me to test for thread issues. While I could deliberately write a program that blocked, what I'm looking for is situations where C++ would not block with equivalent code. As soon as the test program is working, I'm going to look at changing some data via the from the target language (running in an interpreter in the main thread) when called from Window::MessageReceived (running in the window's thread). If anyone has any other suggestions for creating blocking situations, let me know.

After I have made the final selection on target languages and determined the best way to avoid thread issues, I will continue by expanding the interface definitions used for the test program and creating new interface definitions for additional classes. I will also need to document the interface definition language and each of the classes. Class documentation, at least initially, will consist of the differences between the C++ interface described in the Be/Haiku Book and the interface for the target language in question, along with a link to the relevant page in the Be/Haiku Book.

Unfortunately, I haven't been able to stay online much so far. We have company visiting us, and they're staying in the room with the wireless router/modem. Since Haiku can't do encrypted wireless, and I can't use the only space physically close enough to the router to use an ethernet cable, I have to leave Haiku and boot into Windows whenever I want to use the internet. I tried running Haiku from the physical drive with VMware in Windows, but it's too slow. Does anyone know whether VirtualBox can use the physical drive, and if so, is it faster than VMware?

In summary, my goals for the first quarter are:
- Define an interface definition language
- Define preliminary bindings for a minimal test program
- Write a preliminary generator to create the bindings
- Write the minimal test program
- Test threading issues
- Make a final choice on target languages
- Expand preliminary bindings and add new bindings
- Write test programs for the bindings
- Write documentation for the bindings

Language Bindings for the C++ API

Blog post by jalopeura on Wed, 2011-04-27 08:06

My project will expose the Haiku API to scripting languages. During GSoC, I will focus on enabling the creation of GUI apps; this will include large parts of the Interface Kit and some essential classes from the Application Kit. I will target Perl and Python as the scripting languages.

(After GSoC, I would like to support other languages as well, and increase the number of classes available from scripting languages.)

A timeline is available by following this link.

During the bonding period, I will be looking at the Python API, with a view to developing a generator to create the code for these extensions from an abstraction language, as an alternative to using SWIG. (I will not make a final decision on whether to use SWIG until I have determined whether it is feasible to use a custom-built generator within the GSoC time frame.)

Managing multiple documents in applications

Blog post by stippi on Fri, 2010-10-29 12:41

Working on my rewrite of WonderBrush, I've been thinking about the document management. As you may know, WonderBrush is a stricly single window application in its current release. It can still open more than one document at once, of course, and those are displayed in a list above the navigational preview of the current document. One of the drawbacks of this approach is that there are no previews of all the documents visible at once, and it's harder to make non-current documents the target of drag&drop operations, like when dragging objects from one document onto another document to move or copy them there.

Overview of Messaging in the Application Kit

Blog post by nielx on Sun, 2007-07-15 10:00

For the API Documentation team I've prepared an overview of the messaging functions in the Application Kit, mind map style. This image should be the guide to writing the actual API documentation.

Please redirect comments on the technical content to the haiku-development list. They are highly appreciated!

ANNOUNCEMENT: First API Documentation Team Meeting

Blog post by nielx on Tue, 2007-05-15 11:30

On Friday the 18th of May, 19:00 GMT (21:00 in Amsterdam, 20:00 in London), I'd like the documentation team to meet. This meeting is for all the people interested in the API documentation, whether or not you are actually planning on contributing or not. We would like to hear as much different opinions as possible.

The meeting will be on IRC, on freenode irc.freenode.net), in the channel #haiku-doc. This space is open for everyone. The list of topics to be discussed below.

Syndicate content