From 2e8ba48abab7276a23078b28a9120cbb27eda1b9 Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Sun, 2 Aug 2015 11:49:20 +0000 Subject: ListeningTo: common project git-svn-id: http://svn.miranda-ng.org/main/trunk@14815 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/ListeningTo/src/commons.h | 118 ---------------------------- plugins/ListeningTo/src/listeningto.cpp | 2 +- plugins/ListeningTo/src/music.cpp | 2 +- plugins/ListeningTo/src/music.h | 2 +- plugins/ListeningTo/src/options.cpp | 2 +- plugins/ListeningTo/src/options.h | 2 +- plugins/ListeningTo/src/players/foobar.cpp | 2 +- plugins/ListeningTo/src/players/generic.cpp | 2 +- plugins/ListeningTo/src/players/itunes.cpp | 2 +- plugins/ListeningTo/src/players/mradio.cpp | 2 +- plugins/ListeningTo/src/players/player.cpp | 2 +- plugins/ListeningTo/src/players/watrack.cpp | 2 +- plugins/ListeningTo/src/players/winamp.cpp | 2 +- plugins/ListeningTo/src/players/wmp.cpp | 2 +- plugins/ListeningTo/src/stdafx.cpp | 18 ----- plugins/ListeningTo/src/stdafx.cxx | 18 +++++ plugins/ListeningTo/src/stdafx.h | 118 ++++++++++++++++++++++++++++ 17 files changed, 149 insertions(+), 149 deletions(-) delete mode 100644 plugins/ListeningTo/src/commons.h delete mode 100644 plugins/ListeningTo/src/stdafx.cpp create mode 100644 plugins/ListeningTo/src/stdafx.cxx create mode 100644 plugins/ListeningTo/src/stdafx.h (limited to 'plugins/ListeningTo/src') diff --git a/plugins/ListeningTo/src/commons.h b/plugins/ListeningTo/src/commons.h deleted file mode 100644 index 6f7c04d010..0000000000 --- a/plugins/ListeningTo/src/commons.h +++ /dev/null @@ -1,118 +0,0 @@ -/* -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 __COMMONS_H__ -# define __COMMONS_H__ - -#define _CRT_SECURE_NO_WARNINGS -#define _CRT_NONSTDC_NO_DEPRECATE - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include "..\utils\mir_options.h" -#include "..\utils\mir_buffer.h" -#include "..\utils\utf8_helpers.h" - -#include "music.h" -#include "resource.h" -#include "options.h" -#include "Version.h" - -// Prototypes /////////////////////////////////////////////////////////////////////////// - -// Service called by the main menu -#define MS_LISTENINGTO_MAINMENU "ListeningTo/MainMenu" - -// Service called by toptoolbar -#define MS_LISTENINGTO_TTB "ListeningTo/TopToolBar" - -// Services called by hotkeys -#define MS_LISTENINGTO_HOTKEYS_ENABLE "ListeningTo/HotkeysEnable" -#define MS_LISTENINGTO_HOTKEYS_DISABLE "ListeningTo/HotkeysDisable" -#define MS_LISTENINGTO_HOTKEYS_TOGGLE "ListeningTo/HotkeysToggle" - -#define MODULE_NAME "ListeningTo" - - -// Global Variables -extern HINSTANCE hInst; -extern BOOL loaded; - -#define MIR_FREE(_X_) { mir_free(_X_); _X_ = NULL; } - -#define MIN_TIME_BEETWEEN_SETS 10000 // ms - - -void RebuildMenu(); -void StartTimer(); - -struct ProtocolInfo -{ - char proto[128]; - TCHAR account[128]; - HGENMENU hMenu; - int old_xstatus; - TCHAR old_xstatus_name[1024]; - TCHAR old_xstatus_message[1024]; -}; - -ProtocolInfo *GetProtoInfo(char *proto); -int m_log(const TCHAR *function, const TCHAR *fmt, ...); - - -static bool IsEmpty(const char *str) -{ - return str == NULL || str[0] == 0; -} -static bool IsEmpty(const WCHAR *str) -{ - return str == NULL || str[0] == 0; -} - -#define DUP(_X_) ( IsEmpty(_X_) ? NULL : mir_tstrdup(_X_)) -#define DUPD(_X_, _DEF_) ( IsEmpty(_X_) ? mir_tstrdup(_DEF_) : mir_tstrdup(_X_)) -#define U2T(_X_) ( IsEmpty(_X_) ? NULL : mir_u2t(_X_)) -#define U2TD(_X_, _DEF_) ( IsEmpty(_X_) ? mir_u2t(_DEF_) : mir_u2t(_X_)) - - -#endif // __COMMONS_H__ diff --git a/plugins/ListeningTo/src/listeningto.cpp b/plugins/ListeningTo/src/listeningto.cpp index c1472b79cb..6c6007e8fe 100644 --- a/plugins/ListeningTo/src/listeningto.cpp +++ b/plugins/ListeningTo/src/listeningto.cpp @@ -17,7 +17,7 @@ not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "commons.h" +#include "stdafx.h" CLIST_INTERFACE *pcli; int hLangpack; diff --git a/plugins/ListeningTo/src/music.cpp b/plugins/ListeningTo/src/music.cpp index 2495c09bfd..ca630a8a8c 100644 --- a/plugins/ListeningTo/src/music.cpp +++ b/plugins/ListeningTo/src/music.cpp @@ -17,7 +17,7 @@ not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "commons.h" +#include "stdafx.h" Player *players[NUM_PLAYERS]; static LISTENINGTOINFO current = {0}; diff --git a/plugins/ListeningTo/src/music.h b/plugins/ListeningTo/src/music.h index ded7c92ea6..2ec93e7f53 100644 --- a/plugins/ListeningTo/src/music.h +++ b/plugins/ListeningTo/src/music.h @@ -22,7 +22,7 @@ Boston, MA 02111-1307, USA. # define __MUSIC_H__ -#include "commons.h" +#include "stdafx.h" // Players diff --git a/plugins/ListeningTo/src/options.cpp b/plugins/ListeningTo/src/options.cpp index 81e1257b20..722300ee90 100644 --- a/plugins/ListeningTo/src/options.cpp +++ b/plugins/ListeningTo/src/options.cpp @@ -17,7 +17,7 @@ not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "commons.h" +#include "stdafx.h" // Prototypes ///////////////////////////////////////////////////////////////////////////////////// diff --git a/plugins/ListeningTo/src/options.h b/plugins/ListeningTo/src/options.h index 8c14185eb3..0aff9030fd 100644 --- a/plugins/ListeningTo/src/options.h +++ b/plugins/ListeningTo/src/options.h @@ -22,7 +22,7 @@ Boston, MA 02111-1307, USA. # define __OPTIONS_H__ -#include "commons.h" +#include "stdafx.h" #include diff --git a/plugins/ListeningTo/src/players/foobar.cpp b/plugins/ListeningTo/src/players/foobar.cpp index bcb42dbf3f..2b27f8d7a7 100644 --- a/plugins/ListeningTo/src/players/foobar.cpp +++ b/plugins/ListeningTo/src/players/foobar.cpp @@ -17,7 +17,7 @@ not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "..\commons.h" +#include "..\stdafx.h" static TCHAR *wcs[] = { _T("{DA7CD0DE-1602-45e6-89A1-C2CA151E008E}/1"), // Foobar 0.9.1 diff --git a/plugins/ListeningTo/src/players/generic.cpp b/plugins/ListeningTo/src/players/generic.cpp index 72ee921605..cc0ecae708 100644 --- a/plugins/ListeningTo/src/players/generic.cpp +++ b/plugins/ListeningTo/src/players/generic.cpp @@ -17,7 +17,7 @@ not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "..\commons.h" +#include "..\stdafx.h" static LRESULT CALLBACK ReceiverWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); diff --git a/plugins/ListeningTo/src/players/itunes.cpp b/plugins/ListeningTo/src/players/itunes.cpp index b0b5fc5e21..af479f22c8 100644 --- a/plugins/ListeningTo/src/players/itunes.cpp +++ b/plugins/ListeningTo/src/players/itunes.cpp @@ -18,7 +18,7 @@ Boston, MA 02111-1307, USA. */ -#include "..\commons.h" +#include "..\stdafx.h" extern "C" { #include "iTunesCOMInterface_i.c" diff --git a/plugins/ListeningTo/src/players/mradio.cpp b/plugins/ListeningTo/src/players/mradio.cpp index c3921dc188..54dd45a8d1 100644 --- a/plugins/ListeningTo/src/players/mradio.cpp +++ b/plugins/ListeningTo/src/players/mradio.cpp @@ -17,7 +17,7 @@ not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "..\commons.h" +#include "..\stdafx.h" MRadio::MRadio() { diff --git a/plugins/ListeningTo/src/players/player.cpp b/plugins/ListeningTo/src/players/player.cpp index aea9eed1ba..f87818a90b 100644 --- a/plugins/ListeningTo/src/players/player.cpp +++ b/plugins/ListeningTo/src/players/player.cpp @@ -17,7 +17,7 @@ not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "..\commons.h" +#include "..\stdafx.h" extern void HasNewListeningInfo(); diff --git a/plugins/ListeningTo/src/players/watrack.cpp b/plugins/ListeningTo/src/players/watrack.cpp index eab20cf7c5..4af891b39a 100644 --- a/plugins/ListeningTo/src/players/watrack.cpp +++ b/plugins/ListeningTo/src/players/watrack.cpp @@ -17,7 +17,7 @@ not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "..\commons.h" +#include "..\stdafx.h" static WATrack *instance = NULL; diff --git a/plugins/ListeningTo/src/players/winamp.cpp b/plugins/ListeningTo/src/players/winamp.cpp index 6ce85ab775..c3e08a02af 100644 --- a/plugins/ListeningTo/src/players/winamp.cpp +++ b/plugins/ListeningTo/src/players/winamp.cpp @@ -17,7 +17,7 @@ not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "..\commons.h" +#include "..\stdafx.h" static TCHAR *wcs[] = { _T("Winamp v1.x") diff --git a/plugins/ListeningTo/src/players/wmp.cpp b/plugins/ListeningTo/src/players/wmp.cpp index ad3bf87886..7dc2c6fff0 100644 --- a/plugins/ListeningTo/src/players/wmp.cpp +++ b/plugins/ListeningTo/src/players/wmp.cpp @@ -17,7 +17,7 @@ not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "..\commons.h" +#include "..\stdafx.h" #define WMP_WINDOWCLASS _T("MsnMsgrUIManager") diff --git a/plugins/ListeningTo/src/stdafx.cpp b/plugins/ListeningTo/src/stdafx.cpp deleted file mode 100644 index a1f3bfd522..0000000000 --- a/plugins/ListeningTo/src/stdafx.cpp +++ /dev/null @@ -1,18 +0,0 @@ -/* -Copyright (C) 2012-15 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 . -*/ - -#include "commons.h" \ No newline at end of file diff --git a/plugins/ListeningTo/src/stdafx.cxx b/plugins/ListeningTo/src/stdafx.cxx new file mode 100644 index 0000000000..6fb37564b7 --- /dev/null +++ b/plugins/ListeningTo/src/stdafx.cxx @@ -0,0 +1,18 @@ +/* +Copyright (C) 2012-15 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 . +*/ + +#include "stdafx.h" \ No newline at end of file diff --git a/plugins/ListeningTo/src/stdafx.h b/plugins/ListeningTo/src/stdafx.h new file mode 100644 index 0000000000..6f7c04d010 --- /dev/null +++ b/plugins/ListeningTo/src/stdafx.h @@ -0,0 +1,118 @@ +/* +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 __COMMONS_H__ +# define __COMMONS_H__ + +#define _CRT_SECURE_NO_WARNINGS +#define _CRT_NONSTDC_NO_DEPRECATE + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include "..\utils\mir_options.h" +#include "..\utils\mir_buffer.h" +#include "..\utils\utf8_helpers.h" + +#include "music.h" +#include "resource.h" +#include "options.h" +#include "Version.h" + +// Prototypes /////////////////////////////////////////////////////////////////////////// + +// Service called by the main menu +#define MS_LISTENINGTO_MAINMENU "ListeningTo/MainMenu" + +// Service called by toptoolbar +#define MS_LISTENINGTO_TTB "ListeningTo/TopToolBar" + +// Services called by hotkeys +#define MS_LISTENINGTO_HOTKEYS_ENABLE "ListeningTo/HotkeysEnable" +#define MS_LISTENINGTO_HOTKEYS_DISABLE "ListeningTo/HotkeysDisable" +#define MS_LISTENINGTO_HOTKEYS_TOGGLE "ListeningTo/HotkeysToggle" + +#define MODULE_NAME "ListeningTo" + + +// Global Variables +extern HINSTANCE hInst; +extern BOOL loaded; + +#define MIR_FREE(_X_) { mir_free(_X_); _X_ = NULL; } + +#define MIN_TIME_BEETWEEN_SETS 10000 // ms + + +void RebuildMenu(); +void StartTimer(); + +struct ProtocolInfo +{ + char proto[128]; + TCHAR account[128]; + HGENMENU hMenu; + int old_xstatus; + TCHAR old_xstatus_name[1024]; + TCHAR old_xstatus_message[1024]; +}; + +ProtocolInfo *GetProtoInfo(char *proto); +int m_log(const TCHAR *function, const TCHAR *fmt, ...); + + +static bool IsEmpty(const char *str) +{ + return str == NULL || str[0] == 0; +} +static bool IsEmpty(const WCHAR *str) +{ + return str == NULL || str[0] == 0; +} + +#define DUP(_X_) ( IsEmpty(_X_) ? NULL : mir_tstrdup(_X_)) +#define DUPD(_X_, _DEF_) ( IsEmpty(_X_) ? mir_tstrdup(_DEF_) : mir_tstrdup(_X_)) +#define U2T(_X_) ( IsEmpty(_X_) ? NULL : mir_u2t(_X_)) +#define U2TD(_X_, _DEF_) ( IsEmpty(_X_) ? mir_u2t(_DEF_) : mir_u2t(_X_)) + + +#endif // __COMMONS_H__ -- cgit v1.2.3