From c77821d0b4b3ae09e47ce6d6ca9d6b21dbb56d30 Mon Sep 17 00:00:00 2001 From: Vadim Dashevskiy Date: Mon, 4 Nov 2013 08:59:15 +0000 Subject: LCDFramework project removed, integrated to MirandaG15 project git-svn-id: http://svn.miranda-ng.org/main/trunk@6767 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/MirandaG15/src/LCDFramework/CLCDInput.h | 108 ++++++++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 plugins/MirandaG15/src/LCDFramework/CLCDInput.h (limited to 'plugins/MirandaG15/src/LCDFramework/CLCDInput.h') diff --git a/plugins/MirandaG15/src/LCDFramework/CLCDInput.h b/plugins/MirandaG15/src/LCDFramework/CLCDInput.h new file mode 100644 index 0000000000..ccf9def536 --- /dev/null +++ b/plugins/MirandaG15/src/LCDFramework/CLCDInput.h @@ -0,0 +1,108 @@ +#ifndef _LCDINPUTTEXT_H_INCLUDED_ +#define _LCDINPUTTEXT_H_INCLUDED_ + +#define MARKER_HOLD 0 +#define MARKER_HORIZONTAL 1 +#define MARKER_VERTICAL 2 + +#define KEYS_RETURN 0 +#define KEYS_CTRL_RETURN 1 + +#include "CLCDTextObject.h" +#include "CLCDBar.h" + +struct SMarker +{ + int iPosition; + int iXLine; + int iXWidth; + int iLine; +}; + +struct SLineEntry +{ + int iOffset; + int iWidth; + bool bLineBreak; +}; + +class CLineEntry +{ +public: + tstring strLine; + vector vWrapLineOffsets; +}; + +class CLCDInput : public CLCDTextObject +{ +public: + CLCDInput(); + ~CLCDInput(); + + bool Initialize(); + bool Shutdown(); + + bool Draw(CLCDGfx *pGfx); + bool Update(); + + void ShowSymbols(bool bShow); + void SetBreakKeys(int iKeys); + void SetScrollbar(CLCDBar *pScrollbar); + + void ActivateInput(); + void DeactivateInput(); + bool IsInputActive(); + + tstring GetText(); + void Reset(); + + static LRESULT CALLBACK KeyboardHook(int Code, WPARAM wParam, LPARAM lParam); + + int GetLineCount(); + int GetLine(); + + bool ScrollLine(bool bDown=true); + void ScrollToMarker(); + long GetLastInputTime(); + +protected: + void OnFontChanged(); + void OnSizeChanged(SIZE OldSize); + + LRESULT ProcessKeyEvent(int Code, WPARAM wParam, LPARAM lParam); + + void UpdateOffsets(int iModified); + + void UpdateMarker(); + void MoveMarker(int iDir,int iMove,bool bShift=false); +protected: + bool m_bShowSymbols; + bool m_iBreakKeys; + + int m_iLineCount; + long m_lInputTime; + bool m_bInsert; + + long m_lBlinkTimer; + bool m_bShowMarker; + + int m_iLinePosition; + SMarker m_Marker[2]; + + // Text variables + tstring m_strText; + vector m_vLineOffsets; + + // Input variables + static CLCDInput* m_pInput; + HHOOK m_hKBHook; + BYTE m_acKeyboardState[256]; + + // Scrollbar + CLCDBar *m_pScrollbar; +}; + + +#endif // !_LCDTEXT_H_INCLUDED_ + +//** end of LCDText.h **************************************************** -- cgit v1.2.3