aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/interface.h
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2014-11-17 03:11:59 +0100
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2014-11-17 03:56:38 +0100
commite762a43754ba375789fa749ca2e00a3548500d6a (patch)
treebe3e0996f4bee068f58564fe38fac6fee51466a2 /src/interface.h
parent2ee2ddd07e41488b782056e911bcbe2fa51f7e22 (diff)
downloadsciteco-e762a43754ba375789fa749ca2e00a3548500d6a.tar.gz
simplified (User) Interface API
Both UIs have a current_view, so this field, the ssm(), undo_ssm() and get_current_view() methods can be refactored into the Interface base class
Diffstat (limited to 'src/interface.h')
-rw-r--r--src/interface.h15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/interface.h b/src/interface.h
index 09b3c9a..01684fd 100644
--- a/src/interface.h
+++ b/src/interface.h
@@ -162,7 +162,12 @@ class Interface {
void run(void);
};
+protected:
+ ViewImpl *current_view;
+
public:
+ Interface() : current_view(NULL) {}
+
/* default implementation */
inline GOptionGroup *
get_options(void)
@@ -210,23 +215,23 @@ public:
{
undo.push(new UndoTokenShowView(view));
}
+
inline ViewImpl *
get_current_view(void)
{
- return impl().get_current_view_impl();
+ return current_view;
}
inline sptr_t
- ssm(unsigned int iMessage,
- uptr_t wParam = 0, sptr_t lParam = 0)
+ ssm(unsigned int iMessage, uptr_t wParam = 0, sptr_t lParam = 0)
{
- return impl().ssm_impl(iMessage, wParam, lParam);
+ return current_view->ssm(iMessage, wParam, lParam);
}
inline void
undo_ssm(unsigned int iMessage,
uptr_t wParam = 0, sptr_t lParam = 0)
{
- impl().undo_ssm_impl(iMessage, wParam, lParam);
+ current_view->undo_ssm(iMessage, wParam, lParam);
}
/*