summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Plugins/emoticons/commons.h2
-rw-r--r--Plugins/emoticons/sdk/m_anismiley.h3
-rw-r--r--Plugins/emoticons/sdk/m_smileyadd.h53
3 files changed, 57 insertions, 1 deletions
diff --git a/Plugins/emoticons/commons.h b/Plugins/emoticons/commons.h
index f36ba8a..44ea7e9 100644
--- a/Plugins/emoticons/commons.h
+++ b/Plugins/emoticons/commons.h
@@ -66,9 +66,9 @@ using namespace std;
#include <m_icolib.h>
#include <m_avatars.h>
#include <m_imgsrvc.h>
+#include <m_smileyadd.h>
#include <m_anismiley.h>
#include <anismiley.tlh>
-#include <m_smileyadd.h>
#include <m_netlib.h>
#include "../utils/mir_memory.h"
diff --git a/Plugins/emoticons/sdk/m_anismiley.h b/Plugins/emoticons/sdk/m_anismiley.h
index d839cb3..321e683 100644
--- a/Plugins/emoticons/sdk/m_anismiley.h
+++ b/Plugins/emoticons/sdk/m_anismiley.h
@@ -58,6 +58,7 @@ static BOOL InsertAnimatedSmiley(HWND _hwnd, TCHAR * _szFilename, COLORREF _dwBa
#endif // defined ServiceExists && defined CallService
+#if !defined(NM_FIREVIEWCHANGE)
/**
NM_FIREVIEWCHANGE is WM_NOTIFY Message for notify parent of host window about smiley are going to be repaint
@@ -113,4 +114,6 @@ typedef struct
// Code of WM_NOTIFY message (code)
#define NM_FIREVIEWCHANGE NM_FIRST+1;
+#endif
+
#endif // m_anismiley_h__ \ No newline at end of file
diff --git a/Plugins/emoticons/sdk/m_smileyadd.h b/Plugins/emoticons/sdk/m_smileyadd.h
index 2de1b61..67ede1a 100644
--- a/Plugins/emoticons/sdk/m_smileyadd.h
+++ b/Plugins/emoticons/sdk/m_smileyadd.h
@@ -180,6 +180,59 @@ typedef struct
#define MIID_SMILEY { 0xe03c71b2, 0x6dee, 0x467e, { 0xa4, 0xf0, 0xdd, 0x51, 0x67, 0x45, 0x87, 0x6a } }
#endif
+/**
+ NM_FIREVIEWCHANGE is WM_NOTIFY Message for notify parent of host window about smiley are going to be repaint
+
+ The proposed action is next: Owner of RichEdit windows received NM_FIREVIEWCHANGE through WM_NOTIFY
+ twice first time before painting|invalidating (FVCN_PREFIRE) and second time - after (FVCN_POSTFIRE).
+ The Owner window may change any values of received FVCNDATA_NMHDR structure in order to raise needed action.
+ For example it may substitute FVCA_INVALIDATE to FVCA_CUSTOMDRAW event to force painting on self offscreen context.
+
+ It can be:
+ FVCA_CUSTOMDRAW - in this case you need to provide valid HDC to draw on and valid RECT of smiley
+ FVCA_INVALIDATE - to invalidate specified rect of window
+ FVCA_NONE - skip any action. But be aware - animation will be stopped till next repainting of smiley.
+ FVCA_SENDVIEWCHANGE - to notify richedit ole about object changed. Be aware Richedit will fully reconstruct itself
+
+ Another point is moment of received smiley rect - it is only valid if FVCA_DRAW is initially set,
+ and it is PROBABLY valid if FVCA_INVALIDATE is set. And it most probably invalid in case of FVCA_SENDVIEWCHANGE.
+ The smiley position is relative last full paint HDC. Usually it is relative to top-left corner of host
+ richedit (NOT it client area) in windows coordinates.
+
+*/
+
+// Type of Event one of
+#define FVCN_PREFIRE 1
+#define FVCN_POSTFIRE 2
+
+// Action of event are going to be done
+#define FVCA_NONE 0
+#define FVCA_DRAW 1 // do not modify hdc in case of _DRAW, Use _CUSTOMDRAW
+#define FVCA_CUSTOMDRAW 2
+#define FVCA_INVALIDATE 3
+#define FVCA_SENDVIEWCHANGE 4
+#define FVCA_SKIPDRAW 5
+
+// Extended NMHDR structure for WM_NOTIFY
+typedef struct
+{
+ //NMHDR structure
+ HWND hwndFrom; // Window of smiley host
+ UINT idFrom; // ignored
+ UINT code; // NM_FIREVIEWCHANGE
+
+ size_t cbSize;
+ BYTE bEvent; // FVCN_ value - pre- or post- painting
+ BYTE bAction; // FVCA_ keys
+ HDC hDC; // Canvas to draw on
+ RECT rcRect; // Valid/should be in case of FVCA_DRAW
+ COLORREF clrBackground; // color to fill background if fTransparent is not set
+ BOOL fTransparent; // if need to fill back color
+ LPARAM lParam; // used by host window PreFire and PostFire event
+} FVCNDATA_NMHDR;
+
+// Code of WM_NOTIFY message (code)
+#define NM_FIREVIEWCHANGE NM_FIRST+1;
typedef struct
{