Gnome Subtitles Architecture

Contents:

The GUI

Because a picture's worth a thousand words, i'll start with one.

As you can see, there are 3 main areas of relevance here:



The Core

The top class of the entire interface is GUI (GUI.cs). This class contains the 3 parts of the window just described and a very important class in the whole program - the application core:

One thing to keep in mind about Gnome Subtitles is that it uses SubLib as the backend. So, any methods to handle subtitles aren't implemented in Gnome Subtitles. In Gnome Subtitles, we handle the interface. SubLib is changed at request to include more features. The communication is easy because its lead developer is Gnome Subtitles' lead developer too. The SubLib's API is available at http://sublib.sf.net/api.

In Gnome Subtitles, the Subtitles class is used to call SubLib's methods:

Now, let's refer other important files of Gnome Subtitles, in alphabetical order:

Gnome Subtitles uses Glade to design its main window and dialogs. As such, all main interface classes (GUI, SubtitleView, SubtitleEdit, Menus) inherit the GladeWidget class:

As is easily noticeable, almost all the classes have a reference to the main GUI, so you can access any part of the interface from another part of the interface.



The Dialogs

Finally, the dialogs. All the dialogs inherit the GladeDialog class:

Again, the existing Dialogs are good examples for creating new ones. Basically, to implement a new dialog, just create it in glade (inserting it in the used gnome-subtitles.glade file) and create a class that inherits GladeDialog.



Conclusion

This is all you have to know to start hacking on Gnome Subtitles. For more information, use the Mailing List or contact the Authors.

Gnome Subtitles is a work in progress. The TODO list in the development section of the website contains the planed features to be implemented next.