author | mickeyl <mickeyl> | 2003-09-27 11:29:26 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2003-09-27 11:29:26 (UTC) |
commit | 651b6c612db4e809c506973996f2580c4158ac3a (patch) (side-by-side diff) | |
tree | 8c8edc86e4b206dd4542a6b556ad1a319d6698ab /inputmethods/dasher/DasherView.inl | |
parent | d1a11b45e805fe7771ea05944757d767c3c4c8ea (diff) | |
download | opie-651b6c612db4e809c506973996f2580c4158ac3a.zip opie-651b6c612db4e809c506973996f2580c4158ac3a.tar.gz opie-651b6c612db4e809c506973996f2580c4158ac3a.tar.bz2 |
merge dasher which has been introduced in BRANCH first (wtf?) into HEAD
Diffstat (limited to 'inputmethods/dasher/DasherView.inl') (more/less context) (ignore whitespace changes)
-rw-r--r-- | inputmethods/dasher/DasherView.inl | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/inputmethods/dasher/DasherView.inl b/inputmethods/dasher/DasherView.inl new file mode 100644 index 0000000..fbb0c16 --- a/dev/null +++ b/inputmethods/dasher/DasherView.inl @@ -0,0 +1,75 @@ +// DasherView.inl +// +///////////////////////////////////////////////////////////////////////////// +// +// Copyright (c) 2001-2002 David Ward +// +///////////////////////////////////////////////////////////////////////////// + + +inline void Dasher::CDasherView::Render() +{ + m_Screen->Blank(); + + // Render nodes to screen object (should use off screen buffer) + RecursiveRender(m_DasherModel.Root(), m_DasherModel.Rootmin(), m_DasherModel.Rootmax(), 2, false); + RecursiveRender(m_DasherModel.Root(), m_DasherModel.Rootmin(), m_DasherModel.Rootmax(), 2, true); + Crosshair(m_DasherModel.DasherOX()); // add crosshair +// m_Screen->Display(); // copy from buffer to screen +} + +inline void Dasher::CDasherView::MapScreen(int* DrawX, int* DrawY) +{ + using namespace Dasher::Opts; + + switch (ScreenOrientation) { + case (LeftToRight): + break; + case (RightToLeft): + *DrawX = m_Screen->GetWidth() - *DrawX; + break; + case (TopToBottom): { + int Swapper = ( *DrawX * m_Screen->GetHeight()) / m_Screen->GetWidth(); + *DrawX = (*DrawY * m_Screen->GetWidth()) / m_Screen->GetHeight(); + *DrawY = Swapper; + break; + } + case (BottomToTop): { + // Note rotation by 90 degrees not reversible like others + int Swapper = m_Screen->GetHeight() - ( *DrawX * m_Screen->GetHeight()) / m_Screen->GetWidth(); + *DrawX = (*DrawY * m_Screen->GetWidth()) / m_Screen->GetHeight(); + *DrawY = Swapper; + break; + } + default: + break; + } +} + + +inline void Dasher::CDasherView::UnMapScreen(int* MouseX, int* MouseY) +{ + using namespace Dasher::Opts; + + switch (ScreenOrientation) { + case (LeftToRight): + break; + case (RightToLeft): + *MouseX = m_Screen->GetWidth() - *MouseX; + break; + case (TopToBottom): { + int Swapper = (*MouseX * m_Screen->GetHeight()) / m_Screen->GetWidth(); + *MouseX = (*MouseY *m_Screen->GetWidth()) / m_Screen->GetHeight();; + *MouseY = Swapper; + break; + } + case (BottomToTop): { + int Swapper = (*MouseX * m_Screen->GetHeight()) / m_Screen->GetWidth(); + *MouseX = ((m_Screen->GetHeight() - *MouseY) * m_Screen->GetWidth()) / m_Screen->GetHeight(); + *MouseY = Swapper; + break; + } + default: + break; + } +} |