summaryrefslogtreecommitdiff
path: root/Plugins/notification_speak
diff options
context:
space:
mode:
Diffstat (limited to 'Plugins/notification_speak')
-rw-r--r--Plugins/notification_speak/commons.h77
-rw-r--r--Plugins/notification_speak/m_notification_speak.h57
-rw-r--r--Plugins/notification_speak/notification_speak.cpp164
-rw-r--r--Plugins/notification_speak/notification_speak.dsp213
-rw-r--r--Plugins/notification_speak/notification_speak.dsw29
-rw-r--r--Plugins/notification_speak/notification_speak.h50
-rw-r--r--Plugins/notification_speak/options.cpp110
-rw-r--r--Plugins/notification_speak/options.h36
-rw-r--r--Plugins/notification_speak/resource.h21
-rw-r--r--Plugins/notification_speak/resource.rc101
10 files changed, 858 insertions, 0 deletions
diff --git a/Plugins/notification_speak/commons.h b/Plugins/notification_speak/commons.h
new file mode 100644
index 0000000..20176a4
--- /dev/null
+++ b/Plugins/notification_speak/commons.h
@@ -0,0 +1,77 @@
+/*
+Copyright (C) 2005 Ricardo Pescuma Domenecci
+
+This is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public
+License as published by the Free Software Foundation; either
+version 2 of the License, or (at your option) any later version.
+
+This is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with this file; see the file license.txt. If
+not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.
+*/
+
+
+#ifndef __COMMONS_H__
+# define __COMMONS_H__
+
+
+#include <windows.h>
+#include <time.h>
+#include <win2k.h>
+#include <tchar.h>
+#include <stdio.h>
+
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+
+#include <newpluginapi.h>
+#include <m_system.h>
+#include <m_plugins.h>
+#include <m_options.h>
+#include <m_langpack.h>
+#include <m_database.h>
+#include <m_utils.h>
+#include <m_protocols.h>
+
+#include <m_notify.h>
+#include <m_metacontacts.h>
+
+#include "resource.h"
+
+
+#define MODULE_NAME "NotificationSpeak"
+
+extern HINSTANCE hInst;
+extern PLUGINLINK *pluginLink;
+extern PLUGININFO pluginInfo;
+
+#include "m_notification_speak.h"
+#include "options.h"
+#include "../utils/mir_memory.h"
+#include "../utils/mir_options_notify.h"
+#include "../utils/templates.h"
+
+
+#define MAX_REGS(_A_) ( sizeof(_A_) / sizeof(_A_[0]) )
+
+
+#define MS_SPEAK_SAY "Speak/Say"
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // __COMMONS_H__
diff --git a/Plugins/notification_speak/m_notification_speak.h b/Plugins/notification_speak/m_notification_speak.h
new file mode 100644
index 0000000..6530c66
--- /dev/null
+++ b/Plugins/notification_speak/m_notification_speak.h
@@ -0,0 +1,57 @@
+/*
+Copyright (C) 2006 Ricardo Pescuma Domenecci
+
+This is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public
+License as published by the Free Software Foundation; either
+version 2 of the License, or (at your option) any later version.
+
+This is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with this file; see the file license.txt. If
+not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.
+*/
+
+
+#ifndef __M_NOTIFICATION_SPEAK_H__
+# define __M_NOTIFICATION_SPEAK_H__
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+
+#define NFOPT_SPEAK_TEMPLATE_TEXT "Speak/Text" // const char *
+#define NFOPT_SPEAK_TEMPLATE_TEXTW "Speak/TextW" // const WCHAR *
+
+#define NFOPT_SPEAK_SAY "Speak/Say" // BYTE
+
+
+#define MS_SPEAK_SHOW "Speak/Show"
+
+
+
+#ifdef _UNICODE
+
+# define NFOPT_SPEAK_TEMPLATE_TEXTT NFOPT_SPEAK_TEMPLATE_TEXTW
+
+#else
+
+# define NFOPT_SPEAK_TEMPLATE_TEXTT NFOPT_SPEAK_TEMPLATE_TEXT
+
+#endif
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // __M_NOTIFICATION_SPEAK_H__
diff --git a/Plugins/notification_speak/notification_speak.cpp b/Plugins/notification_speak/notification_speak.cpp
new file mode 100644
index 0000000..a4c6095
--- /dev/null
+++ b/Plugins/notification_speak/notification_speak.cpp
@@ -0,0 +1,164 @@
+/*
+Copyright (C) 2005 Ricardo Pescuma Domenecci
+Based on work by tweety, nullbyte
+
+This is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public
+License as published by the Free Software Foundation; either
+version 2 of the License, or (at your option) any later version.
+
+This is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with this file; see the file license.txt. If
+not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.
+*/
+
+
+#include "notification_speak.h"
+
+
+
+// Prototypes /////////////////////////////////////////////////////////////////////////////////////
+
+
+
+HINSTANCE hInst;
+PLUGINLINK *pluginLink;
+MNOTIFYLINK *notifyLink;
+
+PLUGININFO pluginInfo = {
+ sizeof(PLUGININFO),
+ "Speak Notification",
+ PLUGIN_MAKE_VERSION(0,0,0,1),
+ "Notification type that speak notifications aloud. Depends on Speak plugin.",
+ "Ricardo Pescuma Domenecci",
+ "",
+ "© 2006 Ricardo Pescuma Domenecci",
+ "http://www.miranda-im.org/",
+ 0, //not transient
+ 0 //doesn't replace anything built-in
+};
+
+
+HANDLE hhkNotificationShow = NULL;
+HANDLE hhkModulesLoaded = NULL;
+
+
+int ModulesLoaded(WPARAM wParam,LPARAM lParam);
+void LoadNotifyImp();
+void UnloadNotifyImp();
+
+int SpeakShow(WPARAM wParam, LPARAM lParam);
+
+
+
+// Functions //////////////////////////////////////////////////////////////////////////////////////
+
+
+BOOL WINAPI DllMain(HINSTANCE hinstDLL,DWORD fdwReason,LPVOID lpvReserved)
+{
+ hInst = hinstDLL;
+ return TRUE;
+}
+
+
+__declspec(dllexport) PLUGININFO* MirandaPluginInfo(DWORD mirandaVersion)
+{
+ return &pluginInfo;
+}
+
+
+int __declspec(dllexport) Load(PLUGINLINK *link)
+{
+ // Copy data
+ pluginLink = link;
+
+ init_mir_malloc();
+
+ hhkModulesLoaded = HookEvent(ME_SYSTEM_MODULESLOADED, ModulesLoaded);
+
+ return 0;
+}
+
+
+int __declspec(dllexport) Unload(void)
+{
+ UnloadNotifyImp();
+ UnhookEvent(hhkModulesLoaded);
+ return 0;
+}
+
+
+int ModulesLoaded(WPARAM wParam,LPARAM lParam)
+{
+ if (ServiceExists(MS_SPEAK_SAY))
+ {
+ MNotifyGetLink();
+ LoadNotifyImp();
+ InitOptions();
+ }
+ else
+ {
+ MessageBox(NULL, TranslateT("Speak Notification requires Speak plugin to be installed"),
+ TranslateT("Error"), MB_OK | MB_ICONERROR);
+ }
+
+ return 0;
+}
+
+
+
+
+
+void LoadNotifyImp()
+{
+ hhkNotificationShow = HookEvent(ME_NOTIFY_SHOW, SpeakShow);
+
+ CreateServiceFunction(MS_SPEAK_SHOW, SpeakShow);
+}
+
+
+void UnloadNotifyImp()
+{
+ UnhookEvent(hhkNotificationShow);
+}
+
+
+int SpeakShow(WPARAM wParam, LPARAM lParam)
+{
+ HANDLE hNotify = (HANDLE)lParam;
+
+ if (!MNotifyGetByte(hNotify, NFOPT_SPEAK_SAY, 0))
+ return 0;
+
+ TCHAR def[1024];
+ mir_sntprintf(def, MAX_REGS(def), _T("%s\r\n%s"),
+ MNotifyGetTTemplate(hNotify, NFOPT_DEFTEMPL_TITLET, _T("%title%")),
+ MNotifyGetTTemplate(hNotify, NFOPT_DEFTEMPL_TEXTT, _T("%text%")));
+
+ // Get text
+ TCHAR *log_text = MNotifyGetTParsedTemplate(hNotify, NFOPT_SPEAK_TEMPLATE_TEXTT, def);
+
+ if (log_text != NULL)
+ {
+#ifdef _UNICODE
+ // Speak does not have an unicode version
+ char *tmp = mir_dupToAscii(log_text);
+
+ CallService(MS_SPEAK_SAY, 0, (LPARAM) tmp);
+
+ mir_free(tmp);
+#else
+ CallService(MS_SPEAK_SAY, 0, (LPARAM) log_text);
+#endif
+
+ mir_free(log_text);
+ }
+
+ return 0;
+}
diff --git a/Plugins/notification_speak/notification_speak.dsp b/Plugins/notification_speak/notification_speak.dsp
new file mode 100644
index 0000000..6e5339a
--- /dev/null
+++ b/Plugins/notification_speak/notification_speak.dsp
@@ -0,0 +1,213 @@
+# Microsoft Developer Studio Project File - Name="notification_speak" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
+
+CFG=notification_speak - Win32 Debug Unicode
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "notification_speak.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "notification_speak.mak" CFG="notification_speak - Win32 Debug Unicode"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "notification_speak - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "notification_speak - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "notification_speak - Win32 Debug Unicode" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "notification_speak - Win32 Release Unicode" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+MTL=midl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "notification_speak - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "NOTIFICATION_SPEAK_EXPORTS" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /I "../../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "NOTIFICATION_SPEAK_EXPORTS" /YX /FD /c
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x809 /d "NDEBUG"
+# ADD RSC /l 0x809 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"../../bin/release/plugins/notification_speak.dll"
+
+!ELSEIF "$(CFG)" == "notification_speak - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "NOTIFICATION_SPEAK_EXPORTS" /YX /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../../include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "NOTIFICATION_SPEAK_EXPORTS" /FR /YX /FD /GZ /c
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x809 /d "_DEBUG"
+# ADD RSC /l 0x809 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"../../bin/debug/plugins/notification_speak.dll" /pdbtype:sept
+
+!ELSEIF "$(CFG)" == "notification_speak - Win32 Debug Unicode"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "notification_speak___Win32_Debug_Unicode"
+# PROP BASE Intermediate_Dir "notification_speak___Win32_Debug_Unicode"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug_Unicode"
+# PROP Intermediate_Dir "Debug_Unicode"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../../include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "NOTIFICATION_SPEAK_EXPORTS" /FR /YX /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../../include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_UNICODE" /D "UNICODE" /D "_USRDLL" /D "NOTIFICATION_SPEAK_EXPORTS" /FR /YX /FD /GZ /c
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x809 /d "_DEBUG"
+# ADD RSC /l 0x809 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"../../bin/debug/plugins/notification_speak.dll" /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"../../bin/debug/plugins/notification_speakW.dll" /pdbtype:sept
+
+!ELSEIF "$(CFG)" == "notification_speak - Win32 Release Unicode"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "notification_speak___Win32_Release_Unicode"
+# PROP BASE Intermediate_Dir "notification_speak___Win32_Release_Unicode"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release_Unicode"
+# PROP Intermediate_Dir "Release_Unicode"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "../../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "NOTIFICATION_SPEAK_EXPORTS" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /I "../../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_UNICODE" /D "UNICODE" /D "_USRDLL" /D "NOTIFICATION_SPEAK_EXPORTS" /YX /FD /c
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x809 /d "NDEBUG"
+# ADD RSC /l 0x809 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"../../bin/release/plugins/notification_speak.dll"
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"../../bin/release/plugins/notification_speakW.dll"
+
+!ENDIF
+
+# Begin Target
+
+# Name "notification_speak - Win32 Release"
+# Name "notification_speak - Win32 Debug"
+# Name "notification_speak - Win32 Debug Unicode"
+# Name "notification_speak - Win32 Release Unicode"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\utils\mir_memory.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\utils\mir_options_notify.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\notification_speak.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\options.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\resource.rc
+# End Source File
+# Begin Source File
+
+SOURCE=..\utils\templates.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=.\commons.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\m_notification_speak.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\utils\mir_memory.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\utils\mir_options_notify.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\notification_speak.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\options.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\utils\templates.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/Plugins/notification_speak/notification_speak.dsw b/Plugins/notification_speak/notification_speak.dsw
new file mode 100644
index 0000000..fb0e6b4
--- /dev/null
+++ b/Plugins/notification_speak/notification_speak.dsw
@@ -0,0 +1,29 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "notification_speak"=".\notification_speak.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/Plugins/notification_speak/notification_speak.h b/Plugins/notification_speak/notification_speak.h
new file mode 100644
index 0000000..6b6c166
--- /dev/null
+++ b/Plugins/notification_speak/notification_speak.h
@@ -0,0 +1,50 @@
+/*
+Copyright (C) 2006 Ricardo Pescuma Domenecci
+
+This is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public
+License as published by the Free Software Foundation; either
+version 2 of the License, or (at your option) any later version.
+
+This is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with this file; see the file license.txt. If
+not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.
+*/
+
+
+#ifndef __NOTIFICATION_SPEAK_H__
+# define __NOTIFICATION_SPEAK_H__
+
+
+#include "commons.h"
+
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+
+// Dll init
+BOOL WINAPI DllMain(HINSTANCE hinstDLL,DWORD fdwReason,LPVOID lpvReserved);
+
+// Exports:
+__declspec(dllexport) PLUGININFO* MirandaPluginInfo(DWORD mirandaVersion);
+int __declspec(dllexport) Load(PLUGINLINK *link);
+int __declspec(dllexport) Unload(void);
+
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // __NOTIFICATION_SPEAK_H__ \ No newline at end of file
diff --git a/Plugins/notification_speak/options.cpp b/Plugins/notification_speak/options.cpp
new file mode 100644
index 0000000..6983389
--- /dev/null
+++ b/Plugins/notification_speak/options.cpp
@@ -0,0 +1,110 @@
+/*
+Copyright (C) 2005 Ricardo Pescuma Domenecci
+
+This is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public
+License as published by the Free Software Foundation; either
+version 2 of the License, or (at your option) any later version.
+
+This is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with this file; see the file license.txt. If
+not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.
+*/
+
+
+#include "options.h"
+
+
+
+// Prototypes /////////////////////////////////////////////////////////////////////////////////////
+
+
+int NotifyOptionsInitialize(WPARAM wParam,LPARAM lParam);
+
+BOOL CALLBACK DlgProcSpeak(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
+
+
+// Functions //////////////////////////////////////////////////////////////////////////////////////
+
+
+// Initializations needed by options
+void InitOptions()
+{
+ HookEvent(ME_NOTIFY_OPT_INITIALISE, NotifyOptionsInitialize);
+}
+
+
+// Deinitializations needed by options
+void DeInitOptions()
+{
+}
+
+
+int NotifyOptionsInitialize(WPARAM wParam,LPARAM lParam)
+{
+ OPTIONSDIALOGPAGE odp = {0};
+ odp.cbSize = sizeof(odp);
+ odp.hInstance = hInst;
+ odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_SPEAK);
+ odp.ptszTitle = TranslateT("Speak");
+ odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
+ odp.pfnDlgProc = DlgProcSpeak;
+ odp.position = 20;
+ CallService(MS_NOTIFY_OPT_ADDPAGE, wParam, (LPARAM)&odp);
+
+ return 0;
+}
+
+
+static OptPageControl pageControls[] = {
+ { CONTROL_CHECKBOX, IDC_SAY, NFOPT_SPEAK_SAY, (BYTE) 0 },
+ { CONTROL_TEMPLATE, IDC_TEXT, NFOPT_SPEAK_TEMPLATE_TEXTT, (BYTE) 0 }
+};
+
+TCHAR def[1024];
+
+static BOOL CALLBACK DlgProcSpeak(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+ switch (msg)
+ {
+ case WM_USER+100:
+ {
+ HANDLE hNotify = (HANDLE)lParam;
+
+ mir_sntprintf(def, MAX_REGS(def), _T("%s\r\n%s"),
+ MNotifyGetTTemplate(hNotify, NFOPT_DEFTEMPL_TITLET, _T("%title%")),
+ MNotifyGetTTemplate(hNotify, NFOPT_DEFTEMPL_TEXTT, _T("%text%")));
+
+ pageControls[1].szDefVale = def;
+
+ break;
+ }
+ case WM_COMMAND:
+ {
+ if (HIWORD(wParam) == BN_CLICKED)
+ {
+ switch (LOWORD(wParam))
+ {
+ case IDC_BTN_HELP:
+ {
+ HANDLE hNotify = (HANDLE)GetWindowLong(hwndDlg, GWL_USERDATA);
+ MNotifyShowTVariables(hNotify);
+
+ return TRUE;
+ }
+ }
+ }
+
+ break;
+ }
+ }
+
+ return SaveOptsDlgProc(pageControls, MAX_REGS(pageControls), hwndDlg, msg, wParam, lParam);
+}
+
diff --git a/Plugins/notification_speak/options.h b/Plugins/notification_speak/options.h
new file mode 100644
index 0000000..fae6353
--- /dev/null
+++ b/Plugins/notification_speak/options.h
@@ -0,0 +1,36 @@
+/*
+Copyright (C) 2005 Ricardo Pescuma Domenecci
+
+This is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public
+License as published by the Free Software Foundation; either
+version 2 of the License, or (at your option) any later version.
+
+This is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with this file; see the file license.txt. If
+not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.
+*/
+
+
+#include "commons.h"
+
+
+#ifndef __OPTIONS_H__
+# define __OPTIONS_H__
+
+
+// Initializations needed by options
+void InitOptions();
+
+// Deinitializations needed by options
+void DeInitOptions();
+
+
+
+#endif // __OPTIONS_H__
diff --git a/Plugins/notification_speak/resource.h b/Plugins/notification_speak/resource.h
new file mode 100644
index 0000000..c0d9a00
--- /dev/null
+++ b/Plugins/notification_speak/resource.h
@@ -0,0 +1,21 @@
+//{{NO_DEPENDENCIES}}
+// Microsoft Developer Studio generated include file.
+// Used by resource.rc
+//
+#define IDD_OPT_SPEAK 101
+#define IDC_SAY 1000
+#define IDC_TEXT_GROUP 1004
+#define IDC_TEXT 1005
+#define IDC_TEXT_L 1007
+#define IDC_BTN_HELP 1009
+
+// Next default values for new objects
+//
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE 102
+#define _APS_NEXT_COMMAND_VALUE 40001
+#define _APS_NEXT_CONTROL_VALUE 1001
+#define _APS_NEXT_SYMED_VALUE 101
+#endif
+#endif
diff --git a/Plugins/notification_speak/resource.rc b/Plugins/notification_speak/resource.rc
new file mode 100644
index 0000000..d489e42
--- /dev/null
+++ b/Plugins/notification_speak/resource.rc
@@ -0,0 +1,101 @@
+//Microsoft Developer Studio generated resource script.
+//
+#include "resource.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#include "afxres.h"
+
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// Portuguese (Brazil) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_PTB)
+#ifdef _WIN32
+LANGUAGE LANG_PORTUGUESE, SUBLANG_PORTUGUESE_BRAZILIAN
+#pragma code_page(1252)
+#endif //_WIN32
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Dialog
+//
+
+IDD_OPT_SPEAK DIALOGEX 0, 0, 206, 111
+STYLE DS_SYSMODAL | DS_3DLOOK | WS_CHILD | WS_VISIBLE
+EXSTYLE WS_EX_TRANSPARENT | WS_EX_CONTROLPARENT
+FONT 8, "MS Sans Serif"
+BEGIN
+ CONTROL "Say notification aloud",IDC_SAY,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,13,20,180,11
+ GROUPBOX "General",IDC_STATIC,4,5,198,36
+ GROUPBOX " Text ",IDC_TEXT_GROUP,4,46,198,56
+ LTEXT "Text to speak:",IDC_TEXT_L,13,58,156,11
+ EDITTEXT IDC_TEXT,12,70,181,24,ES_MULTILINE | ES_AUTOVSCROLL |
+ ES_WANTRETURN
+ PUSHBUTTON "?",IDC_BTN_HELP,174,53,18,14
+END
+
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE DISCARDABLE
+BEGIN
+ "resource.h\0"
+END
+
+2 TEXTINCLUDE DISCARDABLE
+BEGIN
+ "#include ""afxres.h""\r\n"
+ "\0"
+END
+
+3 TEXTINCLUDE DISCARDABLE
+BEGIN
+ "\r\n"
+ "\0"
+END
+
+#endif // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// DESIGNINFO
+//
+
+#ifdef APSTUDIO_INVOKED
+GUIDELINES DESIGNINFO DISCARDABLE
+BEGIN
+ IDD_OPT_SPEAK, DIALOG
+ BEGIN
+ RIGHTMARGIN, 203
+ BOTTOMMARGIN, 107
+ END
+END
+#endif // APSTUDIO_INVOKED
+
+#endif // Portuguese (Brazil) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+
+
+/////////////////////////////////////////////////////////////////////////////
+#endif // not APSTUDIO_INVOKED
+