Introducing libinfinitymm


Now that exams are over I have been able to spend the past week getting to really work on my GSOC project. In this time I created a c++ wrapper for libinfnity, which is the library my project will be using. The git repository can be found on Gitorious. Libinfinity has a very flexible object oriented design (the online docs are AWOL, so heres my copy), and should make the rest of my project pretty straightforward. In order to implement the collaborative editing component you need to just supply an object which implements InfTextBuffer (now Infinity::TextBuffer), so making a Kate Document implement this interface should be a breeze compared to the glib/gmmproc funk I’ve been dealing with the past week. For the rest of the week I have a fair amount of testing/code scrubbing to get done, but hopefully not long after i’ll have some results to show off :) Now, back to coding.


Wrapping libinfinity


This week I have been working on creating a C++ wrapper for libinfinity. The library uses a gobject API and is very extensible, so ditching it in favor of a non-glib library would be a real waste. Luckily, there are tools like gmmproc (an internal glibmm tool) which auto-generates the C++ classes to wrap gobject based libraries, given that you don’t mind using the gtkmm source code as your documentation. Aside from having a fun time dissecting various libraries to figure out how to use gmmproc, the application is absolutely awesome. The tool reads from definition files (which can also be auto-generated from other glibmm/pygtk tools) which store data on the library’s object names, their member functions, parameters, etc. and parses .hg and .ccg files which contain C++ code with macros (such as _WRAP_METHOD) into source files which are fed to the compiler. Some documentation can be found in the gtkmm book: http://www.gtkmm.org/docs/gtkmm-2.4/docs/tutorial/html/chapter-wrapping-c-libraries.html. After getting the hang of the tool usage, wrapping the library is a breeze, so a usable version will be on its way very soon.