summaryrefslogtreecommitdiff
path: root/plugins/QuickContacts/src
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/QuickContacts/src')
-rw-r--r--plugins/QuickContacts/src/Version.h14
-rw-r--r--plugins/QuickContacts/src/commons.h34
-rw-r--r--plugins/QuickContacts/src/options.cpp7
-rw-r--r--plugins/QuickContacts/src/options.h6
-rw-r--r--plugins/QuickContacts/src/quickcontacts.cpp38
-rw-r--r--plugins/QuickContacts/src/stdafx.cpp18
6 files changed, 59 insertions, 58 deletions
diff --git a/plugins/QuickContacts/src/Version.h b/plugins/QuickContacts/src/Version.h
new file mode 100644
index 0000000000..2bcb8dd9ea
--- /dev/null
+++ b/plugins/QuickContacts/src/Version.h
@@ -0,0 +1,14 @@
+#define __MAJOR_VERSION 1
+#define __MINOR_VERSION 0
+#define __RELEASE_NUM 0
+#define __BUILD_NUM 0
+
+#define __FILEVERSION_STRING __MAJOR_VERSION,__MINOR_VERSION,__RELEASE_NUM,__BUILD_NUM
+
+#define __PLUGIN_NAME "Quick contacts"
+#define __FILENAME "QuickContacts.dll"
+#define __DESCRIPTION "Open contact-specific windows by hotkey."
+#define __AUTHOR "Ricardo Pescuma Domenecci, Heiko Schillinger"
+#define __AUTHOREMAIL "pescuma@miranda-im.org"
+#define __AUTHORWEB "http://miranda-ng.org/"
+#define __COPYRIGHT "© 2007-2009 Ricardo Pescuma Domenecci"
diff --git a/plugins/QuickContacts/src/commons.h b/plugins/QuickContacts/src/commons.h
index c53689f1cd..a165d55010 100644
--- a/plugins/QuickContacts/src/commons.h
+++ b/plugins/QuickContacts/src/commons.h
@@ -22,51 +22,37 @@ Boston, MA 02111-1307, USA.
#ifndef __COMMONS_H__
# define __COMMONS_H__
-
#define WINVER 0x0500
+
#include <windows.h>
#include <commctrl.h>
-#include <stdio.h>
-#include <tchar.h>
-
-// Miranda headers
-#define MIRANDA_VER 0x0A00
#include <newpluginapi.h>
-#include <m_system.h>
-#include <m_system_cpp.h>
-#include <m_protocols.h>
#include <m_protosvc.h>
#include <m_clist.h>
-#include <m_ignore.h>
-#include <m_contacts.h>
#include <m_message.h>
#include <m_userinfo.h>
#include <m_skin.h>
#include <m_langpack.h>
#include <m_database.h>
-#include <m_options.h>
-#include <m_utils.h>
#include <m_button.h>
#include <m_file.h>
#include <m_url.h>
#include <m_history.h>
+#include <m_icolib.h>
+#include <m_hotkeys.h>
+#include <win2k.h>
+
#include <m_metacontacts.h>
#include <m_MagneticWindows.h>
-#include <m_popup.h>
-#include <m_voice.h>
#include <m_voiceservice.h>
-#include <m_icolib.h>
-#include <m_hotkeys.h>
+#include <m_quickcontacts.h>
-#include "../utils/mir_memory.h"
#include "../utils/mir_options.h"
-#include "../utils/utf8_helpers.h"
#include "resource.h"
-#include "m_quickcontacts.h"
#include "options.h"
-
+#include "Version.h"
#define MODULE_NAME "QuickContacts"
@@ -76,12 +62,6 @@ extern HINSTANCE hInst;
extern char *metacontacts_proto;
-#define MAX_REGS(_A_) ( sizeof(_A_) / sizeof(_A_[0]) )
-
-
-
-
-
// Copied from "../modernb/clc.h" ///////////////////////////////////////////////////////////////////
//add a new hotkey so it has a default and can be changed in the options dialog
diff --git a/plugins/QuickContacts/src/options.cpp b/plugins/QuickContacts/src/options.cpp
index 6d5fd59a94..8e9edec9af 100644
--- a/plugins/QuickContacts/src/options.cpp
+++ b/plugins/QuickContacts/src/options.cpp
@@ -18,10 +18,7 @@ not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
-
-#include "options.h"
-
-
+#include "commons.h"
// Prototypes /////////////////////////////////////////////////////////////////////////////////////
@@ -99,7 +96,7 @@ static OptPageControl controls[] = {
static INT_PTR CALLBACK OptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- int ret = SaveOptsDlgProc(controls, MAX_REGS(controls), MODULE_NAME, hwndDlg, msg, wParam, lParam);
+ int ret = SaveOptsDlgProc(controls, SIZEOF(controls), MODULE_NAME, hwndDlg, msg, wParam, lParam);
switch (msg)
{
diff --git a/plugins/QuickContacts/src/options.h b/plugins/QuickContacts/src/options.h
index 1036261bbb..9f9f5083c5 100644
--- a/plugins/QuickContacts/src/options.h
+++ b/plugins/QuickContacts/src/options.h
@@ -22,12 +22,6 @@ Boston, MA 02111-1307, USA.
#ifndef __OPTIONS_H__
# define __OPTIONS_H__
-
-#include "commons.h"
-
-#include <windows.h>
-
-
#define TYPE_GLOBAL 0
#define TYPE_LOCAL 1
diff --git a/plugins/QuickContacts/src/quickcontacts.cpp b/plugins/QuickContacts/src/quickcontacts.cpp
index 000af4664c..3bc7f4f355 100644
--- a/plugins/QuickContacts/src/quickcontacts.cpp
+++ b/plugins/QuickContacts/src/quickcontacts.cpp
@@ -18,22 +18,20 @@ not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
-
#include "commons.h"
-
// Prototypes ///////////////////////////////////////////////////////////////////////////
PLUGININFOEX pluginInfo={
sizeof(PLUGININFOEX),
- "Quick Contacts",
- PLUGIN_MAKE_VERSION(1,0,0,0),
- "Open contact-specific windows by hotkey.",
- "Ricardo Pescuma Domenecci, Heiko Schillinger",
- "pescuma@miranda-im.org",
- "© 2007-2009 Ricardo Pescuma Domenecci",
- "http://pescuma.org/miranda/quickcontacts",
+ __PLUGIN_NAME,
+ PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
+ __DESCRIPTION,
+ __AUTHOR,
+ __AUTHOREMAIL,
+ __COPYRIGHT,
+ __AUTHORWEB,
UNICODE_AWARE,
// {F93BA59C-4F48-4F2E-8A91-77A2801527A3}
{0xf93ba59c, 0x4f48, 0x4f2e, {0x8a, 0x91, 0x77, 0xa2, 0x80, 0x15, 0x27, 0xa3}}
@@ -274,7 +272,7 @@ TCHAR *GetListName(c_struct *cs)
{
if (opts.group_append && cs->szgroup[0] != _T('\0'))
{
- mir_sntprintf(tmp_list_name, MAX_REGS(tmp_list_name), _T("%s (%s)"), cs->szname, cs->szgroup);
+ mir_sntprintf(tmp_list_name, SIZEOF(tmp_list_name), _T("%s (%s)"), cs->szname, cs->szgroup);
return tmp_list_name;
}
else
@@ -438,7 +436,7 @@ void LoadContacts(HWND hwndDlg, BOOL show_all)
if (DBGetContactSettingTString(hMeta == NULL ? hContact : hMeta, "CList", "Group", &dbv) == 0)
{
if (dbv.ptszVal != NULL)
- lstrcpyn(contact->szgroup, dbv.ptszVal, MAX_REGS(contact->szgroup));
+ lstrcpyn(contact->szgroup, dbv.ptszVal, SIZEOF(contact->szgroup));
DBFreeVariant(&dbv);
}
@@ -446,12 +444,12 @@ void LoadContacts(HWND hwndDlg, BOOL show_all)
// Make contact name
TCHAR *tmp = (TCHAR *) CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM) hContact, GCDNF_TCHAR);
- lstrcpyn(contact->szname, tmp, MAX_REGS(contact->szname));
+ lstrcpyn(contact->szname, tmp, SIZEOF(contact->szname));
PROTOACCOUNT *acc = ProtoGetAccount(pszProto);
if (acc != NULL)
{
- lstrcpyn(contact->proto, acc->tszAccountName, MAX_REGS(contact->proto));
+ lstrcpyn(contact->proto, acc->tszAccountName, SIZEOF(contact->proto));
}
contact->hcontact = hContact;
@@ -576,7 +574,7 @@ HANDLE GetSelectedContact(HWND hwndDlg)
// Now try the name
TCHAR cname[120] = _T("");
- GetDlgItemText(hwndDlg, IDC_USERNAME, cname, MAX_REGS(cname));
+ GetDlgItemText(hwndDlg, IDC_USERNAME, cname, SIZEOF(cname));
for(int loop = 0; loop < contacts.getCount(); loop++)
{
@@ -618,7 +616,7 @@ LRESULT CALLBACK EditProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam)
int ret = SendMessage(hdlg,EM_GETSEL,(WPARAM)&start,(LPARAM)&end);
- SendMessage(hdlg,WM_GETTEXT,(WPARAM)MAX_REGS(sztext),(LPARAM)sztext);
+ SendMessage(hdlg,WM_GETTEXT,(WPARAM)SIZEOF(sztext),(LPARAM)sztext);
BOOL at_end = (lstrlen(sztext) == (int)end);
@@ -638,7 +636,7 @@ LRESULT CALLBACK EditProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam)
}
SendMessage(hdlg,EM_REPLACESEL,0,(LPARAM)sztext);
- SendMessage(hdlg,WM_GETTEXT,(WPARAM)MAX_REGS(sztext),(LPARAM)sztext);
+ SendMessage(hdlg,WM_GETTEXT,(WPARAM)SIZEOF(sztext),(LPARAM)sztext);
}
CheckText(hdlg, sztext, !at_end);
@@ -664,7 +662,7 @@ LRESULT CALLBACK EditProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam)
}
else if (wparam == VK_DELETE)
{
- SendMessage(hdlg,WM_GETTEXT,(WPARAM)MAX_REGS(sztext),(LPARAM)sztext);
+ SendMessage(hdlg,WM_GETTEXT,(WPARAM)SIZEOF(sztext),(LPARAM)sztext);
CheckText(hdlg, sztext, TRUE);
}
@@ -765,7 +763,7 @@ static void FillButton(HWND hwndDlg, int dlgItem, TCHAR *name, TCHAR *key, HICON
if (key == NULL)
full = TranslateTS(name);
else
- mir_sntprintf(full = tmp, MAX_REGS(tmp), _T("%s (%s)"), TranslateTS(name), key);
+ mir_sntprintf(full = tmp, SIZEOF(tmp), _T("%s (%s)"), TranslateTS(name), key);
SendMessage(GetDlgItem(hwndDlg, dlgItem), BUTTONSETASFLATBTN, 0, 0);
SendMessage(GetDlgItem(hwndDlg, dlgItem), BUTTONADDTOOLTIP, (LPARAM) full, BATF_TCHAR);
@@ -780,7 +778,7 @@ static void FillCheckbox(HWND hwndDlg, int dlgItem, TCHAR *name, TCHAR *key)
if (key == NULL)
full = TranslateTS(name);
else
- mir_sntprintf(full = tmp, MAX_REGS(tmp), _T("%s (%s)"), TranslateTS(name), key);
+ mir_sntprintf(full = tmp, SIZEOF(tmp), _T("%s (%s)"), TranslateTS(name), key);
SendMessage(GetDlgItem(hwndDlg, dlgItem), WM_SETTEXT, 0, (LPARAM) full);
}
@@ -1049,7 +1047,7 @@ static INT_PTR CALLBACK MainDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
if (SendMessage(hEdit, EM_GETSEL, 0, 0) != -1)
SendMessage(hEdit, EM_REPLACESEL, 0, (LPARAM)_T(""));
- SendMessage(hEdit, WM_GETTEXT, (WPARAM)MAX_REGS(sztext), (LPARAM)sztext);
+ SendMessage(hEdit, WM_GETTEXT, (WPARAM)SIZEOF(sztext), (LPARAM)sztext);
// Fill combo
BOOL all = IsDlgButtonChecked(hwndDlg, IDC_SHOW_ALL_CONTACTS);
diff --git a/plugins/QuickContacts/src/stdafx.cpp b/plugins/QuickContacts/src/stdafx.cpp
new file mode 100644
index 0000000000..550c908371
--- /dev/null
+++ b/plugins/QuickContacts/src/stdafx.cpp
@@ -0,0 +1,18 @@
+/*
+Copyright (C) 2012-13 Miranda NG Project (http://miranda-ng.org)
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation version 2
+of the License.
+
+This program 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "commons.h" \ No newline at end of file