Bug 12 - Move generic code from gui/gtkmm to a higher level
Status:
RESOLVED FIXED
Component:
Core
Version:
unspecified
Hardware:
PC All
Importance:
P1 major
Target Milestone:
---
Assignee:
Rob Caelers
URL:
Depends on:
Blocks:
Reported:
Aug 30 2002 23:48:54 UTC
by:
Rob Caelers
Modified:
Sep 7 2002 23:54:50 UTC
| Who | When | What | Removed | Added |
|---|---|---|---|---|
| Rob Caelers | Sep 6 2002 23:26:09 UTC | status | NEW | ASSIGNED |
| priority | P2 | P1 | ||
| summary | Move some generics stuff from GUI to Core | Move generic code from gui/gtkmm to a higher level | ||
| Rob Caelers | Sep 7 2002 23:54:50 UTC | status | ASSIGNED | RESOLVED |
| resolution | FIXED |
Description
Rob Caelers Aug 30 2002 23:48:54 UTC
Some generic code should be moved out of gui layer. E.g. merging of break. advancing restbreaks etc. The control layer is not supposed to have any knowledge of what kind of timers exist. It just maintain a numer of identical timers... So, there should be some generic rules....
Comment 1
Rob Caelers Sep 6 2002 23:26:09 UTC
BreakControl.{cc,hh} and a large part of GUI.{cc.hh} are gtkmm independent.
Generics parts should be moved to workrave/src/ or workrave/gui.
Control.cc: This class should not have any knowledge about specific timers
(breaks). It only knows about a collection of identical Timers. In the (very
far) future, this class may implement a generic/configurable mapping from timer
events to actions (GUI actions, sound, auto-away to ICQ client etc). This also
requires some configurable "break-gluing" (i.e. RB overrides MP, don't show MP
when RB is imminent). Control.cc should also take care of distributed operation.
(Short summary: no changes on short term)
GUI.cc: This class knows about specific timers/breaks (MP, RB, daily, weekly).
It starts, stops, configures and glues these breaks (see above). It uses the
BreakControl class. GUI.cc is also responsible for generating sounds. This class
might become superfluous when Control.cc implements the generic timer event to
action mapping. GUI.cc will have to be split in 2 classes:
workrave/gui/gtkmm/GUI.cc (inter-thread communication stuff, creation of gtkmm
GUI windows, Gtk::Main::run(), etc) and workrave/src/GUI.cc (toolkit independent
part). Note that workrave/gui/* and workrave/src may ONLY use each others
interface classes.
BreakControl.cc: Only talks to some well-defined interfaces
(BreakWindowInterface, ControlInterface, TimerInterface). GUI toolkit
independent. Probably move to workrave/gui. Requires some minor changes.
Advantages:
- Generation of sound not part of gui/gtkmm
- KDE/Qt port (Ronald: hint hint) can re-use a lot of code.
GUIs that want to do thing differently can bypass src/GUI.cc and BreakControl.ccComment 2
Rob Caelers Sep 6 2002 23:32:00 UTC
Splitting GUI.cc is not as easy as it seems.... Some GUI independent processing should be done on the GUI thread (access to the Configurator). Perhaps this is also a good time to merge some threads....
Comment 3
Rob Caelers Sep 7 2002 23:54:50 UTC
Done. sort of. all files are still in gui/gtkmm. but platform independent stuff could easily be moved to a higher-level directory. BreakControl and GUIControl are Gtkmm independent. Toolkit dependent classes must implement some interfaces.