summaryrefslogtreecommitdiff
path: root/Plugins/emoticons/EmoticonsSelectionLayout.h
diff options
context:
space:
mode:
Diffstat (limited to 'Plugins/emoticons/EmoticonsSelectionLayout.h')
-rw-r--r--Plugins/emoticons/EmoticonsSelectionLayout.h68
1 files changed, 68 insertions, 0 deletions
diff --git a/Plugins/emoticons/EmoticonsSelectionLayout.h b/Plugins/emoticons/EmoticonsSelectionLayout.h
new file mode 100644
index 0000000..e0b2bb7
--- /dev/null
+++ b/Plugins/emoticons/EmoticonsSelectionLayout.h
@@ -0,0 +1,68 @@
+#define MIN_COLS 5
+#define MAX_LINES 8
+#define MAX_COLS 12
+#define BORDER 3
+
+
+struct EmoticonSelectionData
+{
+ Module *module;
+ COLORREF background;
+
+ int xPosition;
+ int yPosition;
+ int Direction;
+ HWND hwndTarget;
+ UINT targetMessage;
+ LPARAM targetWParam;
+};
+
+
+class EmoticonsSelectionLayout
+{
+public:
+ EmoticonSelectionData *ssd;
+ HWND hwnd;
+ int selection;
+
+ struct {
+ int width;
+ int height;
+ } window;
+
+ virtual void Load() = 0;
+
+ virtual void OnUp(HWND hwnd) = 0;
+ virtual void OnDown(HWND hwnd) = 0;
+ virtual void OnLeft(HWND hwnd) = 0;
+ virtual void OnRight(HWND hwnd) = 0;
+
+ virtual void Draw(HDC hdc) = 0;
+
+ virtual void SetSelection(HWND hwnd, POINT p) = 0;
+
+ void SetSelection(HWND hwnd, int sel);
+
+ virtual void CreateToolTips() = 0;
+
+ void DestroyToolTips();
+
+protected:
+
+ HFONT GetFont(HDC hdc);
+ void ReleaseFont(HFONT hFont);
+ RECT CalcRect(TCHAR *txt);
+
+ void GetEmoticonSize(Emoticon *e, int &width, int &height);
+
+ int GetNumOfCols(int num_emotes);
+ int GetNumOfLines(int num_emotes, int cols);
+
+ void CreateEmoticonToolTip(Emoticon *e, RECT fr);
+
+ void EraseBackground(HDC hdc);
+
+ void DrawEmoticon(HDC hdc, int index, RECT rc);
+ void DrawEmoticonText(HDC hdc, TCHAR *txt, RECT rc);
+
+};