diff options
Diffstat (limited to 'plugins/CSList/src')
| -rw-r--r-- | plugins/CSList/src/Version.h | 10 | ||||
| -rw-r--r-- | plugins/CSList/src/cslist.cpp | 17 | ||||
| -rw-r--r-- | plugins/CSList/src/cslist.h | 71 | ||||
| -rw-r--r-- | plugins/CSList/src/resource.h | 1 | ||||
| -rw-r--r-- | plugins/CSList/src/stdafx.cpp | 18 | 
5 files changed, 48 insertions, 69 deletions
diff --git a/plugins/CSList/src/Version.h b/plugins/CSList/src/Version.h index f9fe5b93b7..a201b60c97 100644 --- a/plugins/CSList/src/Version.h +++ b/plugins/CSList/src/Version.h @@ -4,16 +4,8 @@  #define __BUILD_NUM					0
  #define __FILEVERSION_STRING		__MAJOR_VERSION,__MINOR_VERSION,__RELEASE_NUM,__BUILD_NUM
 -#define __FILEVERSION_DOTS			__MAJOR_VERSION.__MINOR_VERSION.__RELEASE_NUM.__BUILD_NUM
 -#define __STRINGIFY_IMPL(x)			#x
 -#define __STRINGIFY(x)				__STRINGIFY_IMPL(x)
 -#define __VERSION_STRING			__STRINGIFY(__FILEVERSION_DOTS)
 -
 -
 -
 -#define __PLUGIN_NAME            "Custom Status List mod"
 -#define __INTERNAL_NAME          "CSList"
 +#define __PLUGIN_NAME            "Custom status list"
  #define __FILENAME               "CSList.dll"
  #define __DESCRIPTION            "This plugin offers simple management functions to keep your extra statuses on one place."
  #define __AUTHOR                 "Mataes, jarvis"
 diff --git a/plugins/CSList/src/cslist.cpp b/plugins/CSList/src/cslist.cpp index ee3d6ccad1..bf2f093749 100644 --- a/plugins/CSList/src/cslist.cpp +++ b/plugins/CSList/src/cslist.cpp @@ -45,7 +45,7 @@ PLUGININFOEX pluginInfoEx =  	__AUTHORWEB,
  	UNICODE_AWARE,
  	// {C8CC7414-6507-4AF6-925A-83C1D2F7BE8C}
 -	{ 0xc8cc7414, 0x6507, 0x4af6, { 0x92, 0x5a, 0x83, 0xc1, 0xd2, 0xf7, 0xbe, 0x8c } }
 +	{0xc8cc7414, 0x6507, 0x4af6, {0x92, 0x5a, 0x83, 0xc1, 0xd2, 0xf7, 0xbe, 0x8c}}
  };
  // ====[ MAIN ]===============================================================
 @@ -140,7 +140,7 @@ extern "C" __declspec(dllexport) int Load()  	for (int i=0; i < SIZEOF(forms); i++) {
  		char szSettingName[64];
 -		mir_snprintf(szSettingName, SIZEOF(szSettingName), "%s_%s", __INTERNAL_NAME, forms[i].pszIconIcoLib);
 +		mir_snprintf(szSettingName, SIZEOF(szSettingName), "%s_%s", MODNAME, forms[i].pszIconIcoLib);
  		sid.pszName = szSettingName;
  		sid.ptszDescription = forms[i].ptszDescr;
 @@ -312,6 +312,15 @@ CSWindow::CSWindow(char *protoName)  	m_filterString = NULL;
  }
 +void __fastcall SAFE_FREE(void** p)
 +{
 +	if (*p)
 +	{
 +		free(*p);
 +		*p = NULL;
 +	}
 +}
 +
  CSWindow::~CSWindow()
  {
  	delete m_itemslist;
 @@ -372,8 +381,8 @@ void CSWindow::initButtons()  void CSWindow::loadWindowPosition()
  {
 -	if ( getByte( "RememberWindowPosition", DEFAULT_REMEMBER_WINDOW_POSITION ))
 -		Utils_RestoreWindowPosition(m_handle,NULL,__INTERNAL_NAME,"Position");
 +	if (getByte("RememberWindowPosition", DEFAULT_REMEMBER_WINDOW_POSITION))
 +		Utils_RestoreWindowPosition(m_handle, NULL, MODNAME, "Position");
  }
  void CSWindow::toggleEmptyListMessage()
 diff --git a/plugins/CSList/src/cslist.h b/plugins/CSList/src/cslist.h index a8324f1c1f..60af6dcfe8 100644 --- a/plugins/CSList/src/cslist.h +++ b/plugins/CSList/src/cslist.h @@ -22,16 +22,6 @@    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 -  ============================================================================
 -
 -  File name      : $URL$
 -  Revision       : $Rev$
 -  Last change on : $Date$
 -  Last change by : $Author$
 -
 -  ============================================================================
 -
 -
    DESCRIPTION:
    Offers List of your Custom Statuses.
 @@ -43,44 +33,34 @@  #ifndef __CSLIST_H
  #define __CSLIST_H 1
 -
  #define WINVER          0x501
  #define _WIN32_WINNT    0x501
  #define _WIN32_IE	    0x600
 -#define MIRANDA_VER   0x0A00
 -
 -#pragma warning( disable: 4996 )
 -#pragma comment( lib, "comctl32.lib")
 +#define _CRT_SECURE_NO_WARNINGS
  #include <windows.h>
 -#include <commctrl.h>
 -#include <tchar.h>
 -#include <win2k.h>
  #include <newpluginapi.h>
  #include <m_database.h>
 -#include <m_utils.h>
  #include <m_system_cpp.h>
  #include <m_langpack.h>
 -#include <m_clist.h>
  #include <m_clistint.h>
 -#include <m_genmenu.h>
 -#include <m_skin.h>
  #include <m_icolib.h>
 -#include <m_protocols.h>
  #include <m_protosvc.h>
  #include <m_xstatus.h>
  #include <m_options.h>
  #include <m_hotkeys.h>
 -#include <m_variables.h>
 -// ====[ BASIC DEFINITIONS ]==================================================
 +#include <m_variables.h>
  #include "resource.h"
  #include "version.h"
 +// ====[ BASIC DEFINITIONS ]==================================================
 +
  #define MODULENAME	       LPGEN("Custom Status List")
 +#define MODNAME		"CSList"
  // ====[ LIMITS ]=============================================================
 @@ -109,15 +89,15 @@    #define ListView_SetSelectionMark( x, y )     0
  #endif
 -#define getByte( setting, error )           DBGetContactSettingByte( NULL, __INTERNAL_NAME, setting, error )
 -#define setByte( setting, value )           DBWriteContactSettingByte( NULL, __INTERNAL_NAME, setting, value )
 -#define getWord( setting, error )           DBGetContactSettingWord( NULL, __INTERNAL_NAME, setting, error )
 -#define setWord( setting, value )           DBWriteContactSettingWord( NULL, __INTERNAL_NAME, setting, value )
 -#define getDword( setting, error )          DBGetContactSettingDword( NULL, __INTERNAL_NAME, setting, error )
 -#define setDword( setting, value )          DBWriteContactSettingDword( NULL, __INTERNAL_NAME, setting, value )
 -#define getTString( setting, dest )         DBGetContactSettingTString( NULL, __INTERNAL_NAME, setting, dest )
 -#define setTString( setting, value )        DBWriteContactSettingTString( NULL, __INTERNAL_NAME, setting, value )
 -#define deleteSetting( setting )            DBDeleteContactSetting( NULL, __INTERNAL_NAME, setting )
 +#define getByte(setting, error)           db_get_b(NULL, MODNAME, setting, error)
 +#define setByte(setting, value)           db_set_b(NULL, MODNAME, setting, value)
 +#define getWord(setting, error)           db_get_w(NULL, MODNAME, setting, error)
 +#define setWord(setting, value)           db_set_w(NULL, MODNAME, setting, value)
 +#define getDword(setting, error)          db_get_dw(NULL, MODNAME, setting, error)
 +#define setDword(setting, value)          db_set_dw(NULL, MODNAME, setting, value)
 +#define getTString(setting, dest)         db_get_ts(NULL, MODNAME, setting, dest)
 +#define setTString(setting, value)        db_set_ts(NULL, MODNAME, setting, value)
 +#define deleteSetting(setting)            db_unset(NULL, MODNAME, setting)
  // --
  typedef void (__cdecl *pForAllProtosFunc)( char*, void *);
 @@ -385,8 +365,8 @@ struct CSWindow  	void __inline saveWindowPosition( HWND hwnd )
  	{
 -		if ( getByte( "RememberWindowPosition", DEFAULT_REMEMBER_WINDOW_POSITION ) == TRUE )
 -			Utils_SaveWindowPosition(hwnd,NULL,__INTERNAL_NAME,"Position");
 +		if (getByte("RememberWindowPosition", DEFAULT_REMEMBER_WINDOW_POSITION) == TRUE)
 +			Utils_SaveWindowPosition(hwnd, NULL, MODNAME, "Position");
  	}
  };
 @@ -423,13 +403,6 @@ void IitIcoLib();  void RegisterHotkeys(char buf[200], TCHAR* accName, int Number);
  void SetStatus(WORD code, StatusItem* item, char *protoName);
 -// ====[ INIT STUFF ]=========================================================
 -
 -extern "C" __declspec( dllexport ) PLUGININFOEX* MirandaPluginInfoEx( DWORD );
 -
 -extern "C" __declspec( dllexport ) int Load(void);
 -extern "C" __declspec( dllexport ) int Unload( void );
 -
  // ====[ PROCEDURES ]=========================================================
  INT_PTR CALLBACK CSWindowProc( HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam );
 @@ -437,16 +410,4 @@ INT_PTR CALLBACK CSAMWindowProc( HWND hwnd, UINT message, WPARAM wparam, LPARAM  INT_PTR CALLBACK CSRNWindowProc( HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam );
  INT_PTR CALLBACK CSOptionsProc( HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam );
 -// ====[ HELPERS ]============================================================
 -
 -void __fastcall SAFE_FREE(void** p)
 -{
 -	if (*p)
 -	{
 -		free(*p);
 -		*p = NULL;
 -	}
 -}
 -
 -
  #endif /* __CSLIST_H */
 diff --git a/plugins/CSList/src/resource.h b/plugins/CSList/src/resource.h index 65eb286097..9d7068ac4d 100644 --- a/plugins/CSList/src/resource.h +++ b/plugins/CSList/src/resource.h @@ -13,7 +13,6 @@  #define IDI_REMOVE                      124
  #define IDI_FAVOURITE                   125
  #define IDI_UNDO                        126
 -#define IDI_GLOBAL                      127
  #define IDI_FILTER                      128
  #define IDI_CLOSE                       129
  #define IDI_UNSET                       130
 diff --git a/plugins/CSList/src/stdafx.cpp b/plugins/CSList/src/stdafx.cpp new file mode 100644 index 0000000000..a2d91a6a7f --- /dev/null +++ b/plugins/CSList/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 "cslist.h"
\ No newline at end of file  | 
