From 48540940b6c28bb4378abfeb500ec45a625b37b6 Mon Sep 17 00:00:00 2001 From: Vadim Dashevskiy Date: Tue, 15 May 2012 10:38:20 +0000 Subject: initial commit git-svn-id: http://svn.miranda-ng.org/main/trunk@2 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/yapp/docs/licence_YAPP.txt | 6 ++ plugins/yapp/docs/m_notify.h | 177 +++++++++++++++++++++++++++++++++++++ plugins/yapp/docs/m_popup2.h | 29 ++++++ 3 files changed, 212 insertions(+) create mode 100644 plugins/yapp/docs/licence_YAPP.txt create mode 100644 plugins/yapp/docs/m_notify.h create mode 100644 plugins/yapp/docs/m_popup2.h (limited to 'plugins/yapp/docs') diff --git a/plugins/yapp/docs/licence_YAPP.txt b/plugins/yapp/docs/licence_YAPP.txt new file mode 100644 index 0000000000..a8cbd75ec3 --- /dev/null +++ b/plugins/yapp/docs/licence_YAPP.txt @@ -0,0 +1,6 @@ +The YAPP plugin for Miranda-IM is Copyright (c) 2006 Scott Ellis (mail@scottellis.com.au) + +http://www.scottellis.com.au + +It is released under the General Public Licence, available here: +http://www.gnu.org/copyleft/gpl.html \ No newline at end of file diff --git a/plugins/yapp/docs/m_notify.h b/plugins/yapp/docs/m_notify.h new file mode 100644 index 0000000000..f9bce9624e --- /dev/null +++ b/plugins/yapp/docs/m_notify.h @@ -0,0 +1,177 @@ +#ifndef __m_notify_h__ +#define __m_notify_h__ + +/*** Miranda Notify Dispatcher ************************************************\ +Notify Dispatcher provides common interface to different notification plugins +like osd, popup, ticker etc. +\******************************************************************************/ + +/* Options UI event and service. The same as for miranda options */ +#define ME_NOTIFY_OPT_INITIALISE "Notify/Opt/Initialise" +#define MS_NOTIFY_OPT_ADDPAGE "Notify/Opt/AddPage" + +typedef struct tagMNOTIFYACTIONINFO { + HICON icon; + char name[MAXMODULELABELLENGTH]; + char service[MAXMODULELABELLENGTH]; + DWORD cookie; +} MNOTIFYACTIONINFO; + +// Just like miranda pluginLink... This should work faster then services, +// we need some reactivity in notifications. +typedef struct tagMNNOTIFYLINK +{ + /* Create a new notification type */ + HANDLE (* Register)(const char *name, HICON icon); + + // Create a new notification object + HANDLE (* Create)(HANDLE type); + + // Check is handle is a valid notification object + int (* IsValid)(HANDLE notify); + + // Set/get information about object, or type defaults + int (* Set)(HANDLE notifyORtype, const char *name, DBVARIANT val); + int (* Get)(HANDLE notifyORtype, const char *name, DBVARIANT *val); + + // Set/get actions + int (* AddAction)(HANDLE notifyORtype, HICON icon, const char *name, const char *service, DWORD cookie); + int (* GetActions)(HANDLE notifyORtype, MNOTIFYACTIONINFO *actions); + + // Increment/decrement refer count of notification object. Unreferred objects are destroyed + int (* AddRef)(HANDLE notify); + int (* Release)(HANDLE notify); + + // Notify user + void (* Show)(HANDLE notify); + void (* Update)(HANDLE notify); + void (* Remove)(HANDLE notify); +} MNOTIFYLINK; + +// Get the MNOTIFYLINK struct +// result = (LRESULT)(MNOTIFYLINK*)notifyLink +#define MS_NOTIFY_GETLINK "Notify/GetLink" + +// Hook this to process corresponding actions +#define ME_NOTIFY_SHOW "Notify/Show" +#define ME_NOTIFY_UPDATE "Notify/Update" +#define ME_NOTIFY_REMOVE "Notify/Remove" + +#if !defined(MNOTIFY_NOEXTERN) + extern + #ifdef __cpluplus + "C" + #endif + MNOTIFYLINK *notifyLink; +#endif + +#if !defined(MNOTIFY_NOHELPERS) && !defined(MNOTIFY_NOEXTERN) + #define MNotifyRegister(a,b) (notifyLink?notifyLink->Register((a),(b)):0) + #define MNotifyCreate(a) (notifyLink?notifyLink->Create((a)):0) + #define MNotifyIsValid(a) (notifyLink?notifyLink->IsValid((a)):0) + #define MNotifySet(a,b,c) (notifyLink?notifyLink->Set((a),(b),(c)):0) + #define MNotifyGet(a,b,c) (notifyLink?notifyLink->Get((a),(b),(c)):0) + #define MNotifyAddAction(a,b,c) (notifyLink?notifyLink->AddAction((a),(b),(c)):0) + #define MNotifyGetActions(a,b) (notifyLink?notifyLink->GetActions((a),(b)):0) + #define MNotifyGet(a,b,c) (notifyLink?notifyLink->Get((a),(b),(c)):0) + #define MNotifyAddRef(a) (notifyLink?notifyLink->AddRef((a)):0) + #define MNotifyRelease(a) (notifyLink?notifyLink->Release((a)):0) + #define MNotifyShow(a) (notifyLink?notifyLink->Show(a):0) + #define MNotifyUpdate(a) (notifyLink?notifyLink->Update(a):0) + #define MNotifyRemove(a) (notifyLink?notifyLink->Remove(a):0) + + static void __inline MNotifyGetLink() + { + notifyLink = ServiceExists(MS_NOTIFY_GETLINK) ? (MNOTIFYLINK *)CallService(MS_NOTIFY_GETLINK,0,0) : 0; + } + + // get helpers + static __inline BYTE MNotifyGetByte(HANDLE notifyORtype, const char *name, BYTE defValue) + { + DBVARIANT dbv; + MNotifyGet(notifyORtype, name, &dbv); + if (dbv.type != DBVT_BYTE) return defValue; + return dbv.bVal; + } + static __inline WORD MNotifyGetWord(HANDLE notifyORtype, const char *name, WORD defValue) + { + DBVARIANT dbv; + MNotifyGet(notifyORtype, name, &dbv); + if (dbv.type != DBVT_WORD) return defValue; + return dbv.wVal; + } + static __inline DWORD MNotifyGetDWord(HANDLE notifyORtype, const char *name, DWORD defValue) + { + DBVARIANT dbv; + MNotifyGet(notifyORtype, name, &dbv); + if (dbv.type != DBVT_DWORD) return defValue; + return dbv.dVal; + } + static __inline const char *MNotifyGetString(HANDLE notifyORtype, const char *name, const char *defValue) + { + DBVARIANT dbv; + MNotifyGet(notifyORtype, name, &dbv); + if (dbv.type != DBVT_ASCIIZ) return defValue; + return dbv.pszVal; + } + static __inline const WCHAR *MNotifyGetWString(HANDLE notifyORtype, const char *name, const WCHAR *defValue) + { + DBVARIANT dbv; + MNotifyGet(notifyORtype, name, &dbv); + if (dbv.type != DBVT_WCHAR) return defValue; + return dbv.pwszVal; + } + + // set helpers + static __inline void MNotifySetByte(HANDLE notifyORtype, const char *name, BYTE value) + { + DBVARIANT dbv; + dbv.type = DBVT_BYTE; + dbv.bVal = value; + MNotifySet(notifyORtype, name, dbv); + } + static __inline void MNotifySetWord(HANDLE notifyORtype, const char *name, WORD value) + { + DBVARIANT dbv; + dbv.type = DBVT_WORD; + dbv.wVal = value; + MNotifySet(notifyORtype, name, dbv); + } + static __inline void MNotifySetDWord(HANDLE notifyORtype, const char *name, DWORD value) + { + DBVARIANT dbv; + dbv.type = DBVT_DWORD; + dbv.dVal = value; + MNotifySet(notifyORtype, name, dbv); + } + static __inline void MNotifySetString(HANDLE notifyORtype, const char *name, const char *value) + { + DBVARIANT dbv; + dbv.type = DBVT_ASCIIZ; + dbv.pszVal = (char *)value; + MNotifySet(notifyORtype, name, dbv); + } + static __inline void MNotifySetWString(HANDLE notifyORtype, const char *name, const WCHAR *value) + { + DBVARIANT dbv; + dbv.type = DBVT_WCHAR; + dbv.pwszVal = (WCHAR *)value; + MNotifySet(notifyORtype, name, dbv); + } +#endif + +// Common options for Get/Set actions +#define NFOPT_TYPENAME "General/TypeName" +#define NFOPT_ICON "General/Icon" +#define NFOPT_CONTACT "General/Contact" +#define NFOPT_EVENT "General/Event" +#define NFOPT_TEXT "General/Text" +#define NFOPT_TEXTW "General/TextW" +#define NFOPT_TITLE "General/Title" +#define NFOPT_TITLEW "General/TitleW" +#define NFOPT_BACKCOLOR "General/BackColor" +#define NFOPT_TEXTCOLOR "General/TextColor" +#define NFOPT_TIMEOUT "General/Timeout" +//#define NFOPT_ONDESTROY "General/OnDestroy" + +#endif // __m_notify_h__ diff --git a/plugins/yapp/docs/m_popup2.h b/plugins/yapp/docs/m_popup2.h new file mode 100644 index 0000000000..b23aecf7fb --- /dev/null +++ b/plugins/yapp/docs/m_popup2.h @@ -0,0 +1,29 @@ +#ifndef __m_popup2_h__ +#define __m_popup2_h__ + +#define NFOPT_POPUP2_BACKCOLOR "Popup2/BackColor" +#define NFOPT_POPUP2_TEXTCOLOR "Popup2/TextColor" +#define NFOPT_POPUP2_TIMEOUT "Popup2/Timeout" +#define NFOPT_POPUP2_LCLICKSVC "Popup2/LClickSvc" +#define NFOPT_POPUP2_LCLICKCOOKIE "Popup2/LClickCookie" +#define NFOPT_POPUP2_RCLICKSVC "Popup2/RClickSvc" +#define NFOPT_POPUP2_RCLICKCOOKIE "Popup2/RClickCookie" +#define NFOPT_POPUP2_STATUSMODE "Popup2/StatusMode" +#define NFOPT_POPUP2_PLUGINDATA "Popup2/PluginData" +#define NFOPT_POPUP2_WNDPROC "Popup2/WndProc" + +#define NFOPT_POPUP2_BACKCOLOR_S "Popup2/BackColor/Save" +#define NFOPT_POPUP2_TEXTCOLOR_S "Popup2/TextColor/Save" +#define NFOPT_POPUP2_TIMEOUT_S "Popup2/Timeout/Save" + +#define MS_POPUP2_SHOW "Popup2/Show" +#define MS_POPUP2_UPDATE "Popup2/Update" +#define MS_POPUP2_REMOVE "Popup2/Remove" + +#ifndef POPUP2_NOHELPERS + #define MPopup2Show(a) (CallService(MS_POPUP2_SHOW, 0, (LPARAM)(a))) + #define MPopup2Update(a) (CallService(MS_POPUP2_UPDATE, 0, (LPARAM)(a))) + #define MPopup2Remove(a) (CallService(MS_POPUP2_REMOVE, 0, (LPARAM)(a))) +#endif + +#endif // __m_popup2_h__ -- cgit v1.2.3