summaryrefslogtreecommitdiff
path: root/plugins/Toaster/src/structs.h
diff options
context:
space:
mode:
authorMikalaiR <nikolay.romanovich@narod.ru>2015-09-15 12:28:41 +0000
committerMikalaiR <nikolay.romanovich@narod.ru>2015-09-15 12:28:41 +0000
commit7d17df97bb5dc0c604a8ed1722f8dba9ea8c56fd (patch)
tree907986661bd629f9e1fdc236e07e8912f4483471 /plugins/Toaster/src/structs.h
parentb4e932fe7025e034972ae3adbb04c61ed78f0120 (diff)
Toaster: code optimization
git-svn-id: http://svn.miranda-ng.org/main/trunk@15358 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Toaster/src/structs.h')
-rw-r--r--plugins/Toaster/src/structs.h59
1 files changed, 59 insertions, 0 deletions
diff --git a/plugins/Toaster/src/structs.h b/plugins/Toaster/src/structs.h
new file mode 100644
index 0000000000..e74eb14bf1
--- /dev/null
+++ b/plugins/Toaster/src/structs.h
@@ -0,0 +1,59 @@
+#pragma once
+
+struct ToastData : public MZeroedObject
+{
+ MCONTACT hContact;
+ TCHAR *tszTitle;
+ TCHAR *tszText;
+ union
+ {
+ HICON hIcon;
+ HBITMAP hBitmap;
+ };
+ int iType; // 0 = none, 1 = hBitmap, 2 = hIcon
+
+ WNDPROC pPopupProc;
+ void *vPopupData;
+
+ ToastData(MCONTACT _hContact, const TCHAR *_tszTitle, const TCHAR *_tszText, HICON _hIcon = NULL) :
+ hContact(_hContact),
+ tszTitle(mir_tstrdup(_tszTitle)),
+ tszText(mir_tstrdup(_tszText)),
+ hIcon(_hIcon),
+ iType(_hIcon ? 2 : 0)
+ {}
+ ToastData(MCONTACT _hContact, const TCHAR *_tszTitle, const TCHAR *_tszText, HBITMAP bmp = NULL) :
+ hContact(_hContact),
+ tszTitle(mir_tstrdup(_tszTitle)),
+ tszText(mir_tstrdup(_tszText)),
+ hBitmap(bmp),
+ iType(bmp ? 1 : 0)
+ {}
+ ~ToastData()
+ {
+ mir_free(tszTitle);
+ mir_free(tszText);
+ }
+};
+
+struct ClassData : public MZeroedObject
+{
+ int iFlags;
+ HICON hIcon;
+
+ WNDPROC pPopupProc;
+
+ ClassData(int f, HICON h = NULL) : iFlags(f), hIcon(h)
+ {
+ }
+};
+
+struct ToastHandlerData : public MZeroedObject
+{
+ MCONTACT hContact;
+
+ WNDPROC pPopupProc;
+ void *vPopupData;
+
+ ToastNotification *tstNotification;
+};