Cim5-Architecture
From CenterIM
Contents |
CenterIm 5 Architecture
This page tries to describe the centerim 5 architecture.
Architecture
Centerim 5 is an object oriented program.
Centerim 5 is layered. The bottom layer is libpurple together with CppConsUi. The second layer are the cim5 classes.
Centerim 5(cim5) is based on libpurple. libpurple is a C based instant messaging API. As such cim5 represents core libpurple interfaces as objects. For example libpurple has a conversation API. In cim5 this is represented by the Conversation and Conversations classes.
CppConsUi
CppConsUI is a c++ console windowing toolkit using ncurses.
The goal of CppConsUI is to provide an efficient, easier to use than ncurses, object oriented console based windowing toolkit.
Object diagram
Descriptions are below.
CppConsUI classes
Widget
Base Widget class. A Widget object is responsible for keeping a ncurses PAD object. A Widget is an InputProcessor, meaning that it is able to handle keyboard events.
InputProcessor
The InputProcessor is a class which allows for extensible key input processing. It supports keybindings and custom input processors.
Container
A Container is Widget. It contains a number of other Widgets. It is responsible for drawing the Widgets contained, and for relaying events to the correct Widget(s), e.g. Redraw events and keyboard input events.
Window
A Window is the class which is drawable on the console window. A Window is responsible for keeping the ncurses WINDOW object. A Window is a Container.
WindowManager
The WindowManager is responsible for keeping a collection of (offscreen) Window object and relaying events to the correct Window(s).
Scrollable
A Scrollable is a Widget which keeps a virtual part of console area (through a ncurses WINDOW object) and displays a part of it.
TreeView
A TreeView is a Scrollable Widget. It keeps and displays a tree structure of Widget objects.
Label
A basic text-drawing Widget.
TextBrowser
A Widget to display and browse through large pieces of text.
TextInput
A TextInput is a TextBrowser capable of responding to keyboard input events to edit the stored text.
TextWindow
A TextWindow is a basic Window which contains a TextInput object.
CenterIm classes
BuddyList
A Window which contains a TreeView containing a hierarchical list of instant messaging buddies.
BuddyListNode
An abstract Widget class representing an buddy in the BuddyList.
Buddy/Chat/Group/Contact
A BuddyListNode class descendant representing one of the of BuddyList item types.
Conversation
A Window class and a class representing a libpurple conversation object. It is responsible for receiving and sending messages.
Conversations
A class responsible for acting as a proxy between libpurple conversation and Conversation objects in CenterIm. It is responsible for creating new Conversation objects and acts as an event proxy.
Conf
A class representing the libpurple configuration API. It is responsible for accessing libpurple to retrieve/store configuration settings.
Log
A TextWindow object responsible for catching any and all glib and libpurple debug messages, and displaying them.
Transfers/Accounts/Connections
As of yet stub classes. They will represent appropriate parts of the libpurple API.
