views:

96

answers:

2

I'm amazed at Transmission, a BT client. It has a Mac, a GTK+, a QT, a Web Client and a CLI interface to it.

I tried reading some of it's source to understand how he creates all these interfaces, but no luck.

Does the developer creates them using a single ide? Or does he create the interface logic in each specific environment (specially mac), "exports" this window code and integrates with the main logic? Is it possible to create that mac interface in another OS using an IDE?

How did the developers create this software with so many interfaces, in a independent way?

I was thinking about creating a Python application with multiple interface modules like this one. Is there a book/website with information about multiple interface modules like this one? I prefer this "native" approach instead of a "mono" or other cross-platform solutions that make applications look like they're not from the system they're running.

+1  A: 

The different interfaces are written separately so that they can integrate better with their platforms. For example the Mac client is written in Objective-C and uses Cocoa and Growl, while the GTK+ client is written in C and uses DBUS, libcanberra, and gconf2.

There are a handful of programmers who work on Transmission, rather than just one, or this would be prohibitively difficult. Keeping the various "flavors" of Transmission in sync is time-consuming and not always successful. For example grouping exists in the Mac client, but is only in the planning stages for the GTK+ and Qt versions.

As far as the IDEs used... the Mac programmer uses xcode, and the GTK+ programmer uses vim. I don't know what the Qt programmer uses. :)

Do you know if it's possible to create that mac interface in another OS using an IDE?
Somebody still uses you MS-DOS
@charleskerr: I have to disagree. The GTK+ port is __not__ at planning stage: I'm using it from more than 2 years without any problem (apart one bug in the 1.11 version).
ntd
@ntd I think he was saying that the grouping functionality is in the planning stage, not the whole app.
Tom Dalling
@tom: yes, you're right.
ntd
+1  A: 

As far as I can see from the sources, the authors use a (propably static) library libtransmission for all the shared code (BitTorrent handling etc.) and provide different GUIs (with own main.c etc.) as different applications for each platform. So its the other way round as you thought it is (GUI-Apps using libtransmission not Transmission uses libGui)

Communication between GUI and Library is done via function calls and callbacks (calling your function when something happens).

I think the interfaces just growed, maybe they had just one application which they started, refactored out the bittorrent part, created a second application, connected it to it and so on.

Creating and managing interfaces in an independent way is possible when you

  • Check whether it builds on the other platforms (you can use a buildserver for that)
  • Seperate platform specific code (e.g. with #defines, different files or a supporting library)
  • Ask the other Maintainers (who see it from other platforms) how they would abstract specific functions (which information have they to provide? which thread may call this? under which circumstances do they need a callback?
nob