summaryrefslogtreecommitdiff
path: root/Software/crystalball.mdwn
blob: b54620c7abb54ab1e405e60a9deb93b2719b34ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53


## CrystalBall


### Introduction

[[CrystalBall|CrystalBall]] aims to be a unified cross-desktop system to provide passive alerts. 

The way it does this, is by separating itself into two parts: receivers and outputs. [[CrystalBall|CrystalBall]] uses both a pool of receivers and a pool of outputs, so many receivers and outputs can be used simultaneously. Receivers in the receiver pool create notification objects, and pass them up to the output pool for display. To keep things from being gui system dependant, notifications implement no gui code. Instead, a notification is simply a collection of fields and values, each with a hint on their purpose or display method. Notifications are sent to all running outputs, which construct a gui for them and are responsible for all display characteristics. 


### Hint System

Notifications are normal python classes holding a collection of data associated with hints. Data is displayed in the order fields are defined in the Notification's data. A Notification class looks like this: 


[[!format txt """
class GUIStandard(Notification):

         def __init__(self, source, title, description, data=None, hint=None):
                  Notification.__init__(self, data, hint)

                  self.data.add_datum("title", title, hints.DATUM_TITLE)
                  self.data.add_datum("source", source, hints.DATUM_SOURCE)
                  self.data.add_datum("description", description, hints.DATUM_DESCRIPTION)
"""]]
Recievers instantiate a Notification class with the data they desire, and then pass it up to a pool of Outputs. Each output is responsible for it's own interpretation of the data and it's hints. Notification classes can inherit from other Notifications, expanding on a layout and adding data at the end. For instance, [[GuiStandardWithImage|GuiStandardWithImage]] adds images to the Notifications: 


[[!format txt """
class GUIStandardWithImage(GUIStandard):

         def __init__(self, source, title, description, image, data=None, hint=None):
                  GUIStandard.__init__(self, source, title, description, data, hint)
                  self.data.add_datum("image", image, hints.DATUM_TITLEIMAGE)
"""]]

### Current Features

Here's what [[CrystalBall|CrystalBall]] can currently do: 

                     * Basic GTK Output 
                     * Debug Console Output 
                     * HAL DeviceAdded Receiver 
                     * Clock Example Receiver 
                     * Welcome Receiver (Shows version at startup) 

### CVS

[[CrystalBall|CrystalBall]] is still in it's early stages, so most of the action can be found in the [[CVS|http://cvs.freedesktop.org/crystalball/]]. 

-- [[MaxGoodman|MaxGoodman]] - 29 Jul 2004