====== User interface ======

There is a central application object which is the single instantiation of the class Zim::GUI. This object manages a number of objects that handle certain parts of the interface. These can be either pieces of the program that are split out to a separate module or objects defined by plugins. Examples of such components are the main interface widgets like the PageView, the TreeView and the PathBar. These components typically inherit from the base class Zim::GUI::Component. They can access the main object using the attribute "''{app}''". The Zim::GUI object also holds a reference the the Zim [[notebook]] object which can be accessed using the "''{notebook}''" attribute.


{{./relations_gui_layer.png}}


Zim::GUI autoloads methods that return child objects. So calling "''$app->PathBar''" will autoload and return an object of the class Zim::GUI::PathBar. Some classes like PageView are loaded directly, but the autoloading is used for example for all dialogs.

Specialized widgets that are not strictly zim specific are in the Gtk2::Ex:: namespace. The plan is that these will be released to CPAN at some point.

===== Actions =====
Actions are the methods that are triggered by menu items and by toolbar items. The menu and toolbar items are defined using Gtk2::UIManager but Zim::GUI::Component contains convenience routines to add new actions and new interface items.

In the API of the various components the action methods start with a capital to distinguish them from normal methods. The actions form the most stable part of the API, so for example [[plugins]] should try to do as much as possible just sticking to these methods. Also the [[Daemon|IPC interface]] is only allowed to call capitalized methods.
