diff options
Diffstat (limited to 'src/core/miranda.h')
-rw-r--r-- | src/core/miranda.h | 166 |
1 files changed, 84 insertions, 82 deletions
diff --git a/src/core/miranda.h b/src/core/miranda.h index 3488c4ddd7..8f747ee86b 100644 --- a/src/core/miranda.h +++ b/src/core/miranda.h @@ -21,6 +21,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
+#define OPTIONPAGE_OLD_SIZE offsetof(OPTIONSDIALOGPAGE,hLangpack)
+
#define NEWSTR_ALLOCA(A) (A == NULL)?NULL:strcpy((char*)alloca(strlen(A)+1), A)
#define NEWTSTR_ALLOCA(A) (A == NULL)?NULL:_tcscpy((TCHAR*)alloca((_tcslen(A)+1)* sizeof(TCHAR)), A)
@@ -39,8 +41,8 @@ extern pfnMyGetMonitorInfo MyGetMonitorInfo; typedef HRESULT (STDAPICALLTYPE *pfnSHAutoComplete)(HWND, DWORD);
extern pfnSHAutoComplete shAutoComplete;
-typedef HRESULT (STDAPICALLTYPE *pfnSHGetSpecialFolderPathA)(HWND, LPSTR, int, BOOL );
-typedef HRESULT (STDAPICALLTYPE *pfnSHGetSpecialFolderPathW)(HWND, LPWSTR, int, BOOL );
+typedef HRESULT (STDAPICALLTYPE *pfnSHGetSpecialFolderPathA)(HWND, LPSTR, int, BOOL);
+typedef HRESULT (STDAPICALLTYPE *pfnSHGetSpecialFolderPathW)(HWND, LPWSTR, int, BOOL);
extern pfnSHGetSpecialFolderPathA shGetSpecialFolderPathA;
extern pfnSHGetSpecialFolderPathW shGetSpecialFolderPathW;
@@ -58,19 +60,19 @@ extern pfnAnimateWindow animateWindow; typedef BOOL (WINAPI * pfnSetLayeredWindowAttributes) (HWND, COLORREF, BYTE, DWORD);
extern pfnSetLayeredWindowAttributes setLayeredWindowAttributes;
-typedef HTHEME ( STDAPICALLTYPE *pfnOpenThemeData )( HWND, LPCWSTR );
-typedef HRESULT ( STDAPICALLTYPE *pfnIsThemeBackgroundPartiallyTransparent )( HTHEME, int, int );
-typedef HRESULT ( STDAPICALLTYPE *pfnDrawThemeParentBackground )( HWND, HDC, const RECT * );
-typedef HRESULT ( STDAPICALLTYPE *pfnDrawThemeBackground )( HTHEME, HDC, int, int, const RECT *, const RECT * );
-typedef HRESULT ( STDAPICALLTYPE *pfnDrawThemeText)( HTHEME, HDC, int, int, LPCWSTR, int, DWORD, DWORD, const RECT *);
-typedef HRESULT ( STDAPICALLTYPE *pfnDrawThemeTextEx)( HTHEME, HDC, int, int, LPCWSTR, int, DWORD, LPRECT, const struct _DTTOPTS * );
-typedef HRESULT ( STDAPICALLTYPE *pfnGetThemeBackgroundContentRect)( HTHEME, HDC, int, int, LPCRECT, LPRECT );
-typedef HRESULT ( STDAPICALLTYPE *pfnGetThemeFont)( HTHEME, HDC, int, int, int, LOGFONT * );
-typedef HRESULT ( STDAPICALLTYPE *pfnCloseThemeData )( HTHEME );
-typedef HRESULT ( STDAPICALLTYPE *pfnEnableThemeDialogTexture )( HWND hwnd, DWORD dwFlags );
-typedef HRESULT ( STDAPICALLTYPE *pfnSetWindowTheme )( HWND, LPCWSTR, LPCWSTR );
-typedef HRESULT ( STDAPICALLTYPE *pfnSetWindowThemeAttribute )( HWND, enum WINDOWTHEMEATTRIBUTETYPE, PVOID, DWORD );
-typedef BOOL ( STDAPICALLTYPE *pfnIsThemeActive )();
+typedef HTHEME (STDAPICALLTYPE *pfnOpenThemeData)(HWND, LPCWSTR);
+typedef HRESULT (STDAPICALLTYPE *pfnIsThemeBackgroundPartiallyTransparent)(HTHEME, int, int);
+typedef HRESULT (STDAPICALLTYPE *pfnDrawThemeParentBackground)(HWND, HDC, const RECT *);
+typedef HRESULT (STDAPICALLTYPE *pfnDrawThemeBackground)(HTHEME, HDC, int, int, const RECT *, const RECT *);
+typedef HRESULT (STDAPICALLTYPE *pfnDrawThemeText)(HTHEME, HDC, int, int, LPCWSTR, int, DWORD, DWORD, const RECT *);
+typedef HRESULT (STDAPICALLTYPE *pfnDrawThemeTextEx)(HTHEME, HDC, int, int, LPCWSTR, int, DWORD, LPRECT, const struct _DTTOPTS *);
+typedef HRESULT (STDAPICALLTYPE *pfnGetThemeBackgroundContentRect)(HTHEME, HDC, int, int, LPCRECT, LPRECT);
+typedef HRESULT (STDAPICALLTYPE *pfnGetThemeFont)(HTHEME, HDC, int, int, int, LOGFONT *);
+typedef HRESULT (STDAPICALLTYPE *pfnCloseThemeData)(HTHEME);
+typedef HRESULT (STDAPICALLTYPE *pfnEnableThemeDialogTexture)(HWND hwnd, DWORD dwFlags);
+typedef HRESULT (STDAPICALLTYPE *pfnSetWindowTheme)(HWND, LPCWSTR, LPCWSTR);
+typedef HRESULT (STDAPICALLTYPE *pfnSetWindowThemeAttribute)(HWND, enum WINDOWTHEMEATTRIBUTETYPE, PVOID, DWORD);
+typedef BOOL (STDAPICALLTYPE *pfnIsThemeActive)();
typedef HRESULT (STDAPICALLTYPE *pfnBufferedPaintInit)(void);
typedef HRESULT (STDAPICALLTYPE *pfnBufferedPaintUninit)(void);
typedef HANDLE (STDAPICALLTYPE *pfnBeginBufferedPaint)(HDC, RECT *, BP_BUFFERFORMAT, BP_PAINTPARAMS *, HDC *);
@@ -98,8 +100,8 @@ extern pfnGetBufferedPaintBits getBufferedPaintBits; extern ITaskbarList3 * pTaskbarInterface;
-typedef HRESULT ( STDAPICALLTYPE *pfnDwmExtendFrameIntoClientArea )( HWND hwnd, const MARGINS *margins );
-typedef HRESULT ( STDAPICALLTYPE *pfnDwmIsCompositionEnabled )( BOOL * );
+typedef HRESULT (STDAPICALLTYPE *pfnDwmExtendFrameIntoClientArea)(HWND hwnd, const MARGINS *margins);
+typedef HRESULT (STDAPICALLTYPE *pfnDwmIsCompositionEnabled)(BOOL *);
extern pfnDwmExtendFrameIntoClientArea dwmExtendFrameIntoClientArea;
extern pfnDwmIsCompositionEnabled dwmIsCompositionEnabled;
@@ -111,18 +113,18 @@ extern LPFN_WSAADDRESSTOSTRINGA MyWSAAddressToString; /**** file.c ***************************************************************************/
-void PushFileEvent( HANDLE hContact, HANDLE hdbe, LPARAM lParam );
+void PushFileEvent(HANDLE hContact, HANDLE hdbe, LPARAM lParam);
/**** memory.c *************************************************************************/
#ifdef _STATIC
-void* mir_alloc( size_t );
-void* mir_calloc( size_t );
-void* mir_realloc( void* ptr, size_t );
-void mir_free( void* ptr );
-char* mir_strdup( const char* str );
-WCHAR* mir_wstrdup( const WCHAR* str );
-char* mir_strndup( const char* str, size_t len );
+void* mir_alloc(size_t);
+void* mir_calloc(size_t);
+void* mir_realloc(void* ptr, size_t);
+void mir_free(void* ptr);
+char* mir_strdup(const char* str);
+WCHAR* mir_wstrdup(const WCHAR* str);
+char* mir_strndup(const char* str, size_t len);
int mir_snprintf(char *buffer, size_t count, const char* fmt, ...);
int mir_sntprintf(TCHAR *buffer, size_t count, const TCHAR* fmt, ...);
@@ -132,7 +134,7 @@ int mir_vsntprintf(TCHAR *buffer, size_t count, const TCHAR* fmt, va_list va) WCHAR* mir_a2u_cp(const char* src, int codepage);
WCHAR* mir_a2u(const char* src);
char* mir_u2a_cp(const wchar_t* src, int codepage);
-char* mir_u2a( const wchar_t* src);
+char* mir_u2a(const wchar_t* src);
#endif
/**** miranda.c ************************************************************************/
@@ -144,19 +146,19 @@ extern pfnExceptionFilter pMirandaExceptFilter; /**** modules.c ************************************************************************/
int CallPluginEventHook(HINSTANCE hInst, HANDLE hEvent, WPARAM wParam, LPARAM lParam);
-void KillModuleEventHooks( HINSTANCE );
-void KillModuleServices( HINSTANCE );
+void KillModuleEventHooks(HINSTANCE);
+void KillModuleServices(HINSTANCE);
-void KillObjectEventHooks( void* pObject );
-void KillObjectServices( void* pObject );
-void KillObjectThreads( void* pObject );
+void KillObjectEventHooks(void* pObject);
+void KillObjectServices(void* pObject);
+void KillObjectThreads(void* pObject);
/**** utf.c ****************************************************************************/
-char* Utf8Decode( char* str, wchar_t** ucs2 );
-char* Utf8DecodeCP( char* str, int codepage, wchar_t** ucs2 );
+char* Utf8Decode(char* str, wchar_t** ucs2);
+char* Utf8DecodeCP(char* str, int codepage, wchar_t** ucs2);
-wchar_t* Utf8DecodeUcs2( const char* str );
+wchar_t* Utf8DecodeUcs2(const char* str);
__forceinline char* Utf8DecodeA(const char* src)
{
@@ -166,10 +168,10 @@ __forceinline char* Utf8DecodeA(const char* src) }
-char* Utf8Encode( const char* str );
-char* Utf8EncodeCP( const char* src, int codepage );
+char* Utf8Encode(const char* str);
+char* Utf8EncodeCP(const char* src, int codepage);
-char* Utf8EncodeUcs2( const wchar_t* str );
+char* Utf8EncodeUcs2(const wchar_t* str);
int Ucs2toUtf8Len(const wchar_t *src);
@@ -180,13 +182,13 @@ int Ucs2toUtf8Len(const wchar_t *src); int LangPackGetDefaultCodePage();
int LangPackGetDefaultLocale();
-TCHAR* LangPackPcharToTchar( const char* pszStr );
+TCHAR* LangPackPcharToTchar(const char* pszStr);
char* LangPackTranslateString(struct LangPackMuuid* pUuid, const char *szEnglish, const int W);
TCHAR* LangPackTranslateStringT(int hLangpack, const TCHAR* tszEnglish);
unsigned int __fastcall hash(const void * key, unsigned int len);
-#pragma optimize( "gt", on )
+#pragma optimize("gt", on)
__inline unsigned int hashstr(const char * key)
{
if (key == NULL) return 0;
@@ -200,14 +202,14 @@ __inline unsigned int hashstr(const wchar_t * key) const unsigned int len = (unsigned int)wcslen((const wchar_t*)key);
return hash(key, len * sizeof(wchar_t));
}
-#pragma optimize( "", on )
+#pragma optimize("", on)
/**** path.c ***************************************************************************/
int pathToAbsolute(const char *pSrc, char *pOut, char* base);
-void CreatePathToFile( char* wszFilePath );
+void CreatePathToFile(char* wszFilePath);
int CreateDirectoryTree(const char *szDir);
-void CreatePathToFileW( WCHAR* wszFilePath );
+void CreatePathToFileW(WCHAR* wszFilePath);
int CreateDirectoryTreeW(const WCHAR *szDir);
int pathToAbsoluteW(const TCHAR *pSrc, TCHAR *pOut, TCHAR* base);
#define pathToAbsoluteT pathToAbsoluteW
@@ -216,17 +218,17 @@ int pathToAbsoluteW(const TCHAR *pSrc, TCHAR *pOut, TCHAR* base); /**** skin2icons.c *********************************************************************/
-HANDLE IcoLib_AddNewIcon( SKINICONDESC* sid );
-HICON IcoLib_GetIcon( const char* pszIconName, bool big );
-HICON IcoLib_GetIconByHandle( HANDLE hItem, bool big );
-HANDLE IcoLib_IsManaged( HICON hIcon );
-int IcoLib_ReleaseIcon( HICON hIcon, char* szIconName, bool big );
+HANDLE IcoLib_AddNewIcon(SKINICONDESC* sid);
+HICON IcoLib_GetIcon(const char* pszIconName, bool big);
+HICON IcoLib_GetIconByHandle(HANDLE hItem, bool big);
+HANDLE IcoLib_IsManaged(HICON hIcon);
+int IcoLib_ReleaseIcon(HICON hIcon, char* szIconName, bool big);
/**** skinicons.c **********************************************************************/
-HICON LoadSkinProtoIcon( const char* szProto, int status, bool big = false );
-HICON LoadSkinIcon( int idx, bool big = false );
-HANDLE GetSkinIconHandle( int idx );
+HICON LoadSkinProtoIcon(const char* szProto, int status, bool big = false);
+HICON LoadSkinIcon(int idx, bool big = false);
+HANDLE GetSkinIconHandle(int idx);
HICON LoadIconEx(HINSTANCE hInstance, LPCTSTR lpIconName, BOOL bShared);
int ImageList_AddIcon_NotShared(HIMAGELIST hIml, LPCTSTR szResource);
@@ -255,7 +257,7 @@ extern const int statusModeList[ MAX_STATUS_COUNT ]; extern const int skinIconStatusList[ MAX_STATUS_COUNT ];
extern const int skinIconStatusFlags[ MAX_STATUS_COUNT ];
-int TryProcessDoubleClick( HANDLE hContact );
+int TryProcessDoubleClick(HANDLE hContact);
/**** protocols.c ***********************************************************************/
@@ -266,31 +268,31 @@ int TryProcessDoubleClick( HANDLE hContact ); extern LIST<PROTOACCOUNT> accounts;
-PROTOACCOUNT* __fastcall Proto_GetAccount( const char* accName );
-PROTOACCOUNT* __fastcall Proto_GetAccount( HANDLE hContact );
-PROTOCOLDESCRIPTOR* __fastcall Proto_IsProtocolLoaded( const char* szProtoName );
+PROTOACCOUNT* __fastcall Proto_GetAccount(const char* accName);
+PROTOACCOUNT* __fastcall Proto_GetAccount(HANDLE hContact);
+PROTOCOLDESCRIPTOR* __fastcall Proto_IsProtocolLoaded(const char* szProtoName);
-bool __fastcall Proto_IsAccountEnabled( PROTOACCOUNT* pa );
-bool __fastcall Proto_IsAccountLocked( PROTOACCOUNT* pa );
+bool __fastcall Proto_IsAccountEnabled(PROTOACCOUNT* pa);
+bool __fastcall Proto_IsAccountLocked(PROTOACCOUNT* pa);
-PROTO_INTERFACE* AddDefaultAccount( const char* szProtoName );
-int FreeDefaultAccount( PROTO_INTERFACE* ppi );
+PROTO_INTERFACE* AddDefaultAccount(const char* szProtoName);
+int FreeDefaultAccount(PROTO_INTERFACE* ppi);
-BOOL ActivateAccount( PROTOACCOUNT* pa );
-void EraseAccount( const char* pszProtoName );
-void DeactivateAccount( PROTOACCOUNT* pa, bool bIsDynamic, bool bErase );
-void UnloadAccount( PROTOACCOUNT* pa, bool bIsDynamic, bool bErase );
-void OpenAccountOptions( PROTOACCOUNT* pa );
+BOOL ActivateAccount(PROTOACCOUNT* pa);
+void EraseAccount(const char* pszProtoName);
+void DeactivateAccount(PROTOACCOUNT* pa, bool bIsDynamic, bool bErase);
+void UnloadAccount(PROTOACCOUNT* pa, bool bIsDynamic, bool bErase);
+void OpenAccountOptions(PROTOACCOUNT* pa);
-void LoadDbAccounts( void );
-void WriteDbAccounts( void );
+void LoadDbAccounts(void);
+void WriteDbAccounts(void);
-INT_PTR CallProtoServiceInt( HANDLE hContact, const char* szModule, const char* szService, WPARAM, LPARAM );
-INT_PTR CallContactService( HANDLE hContact, const char *szProtoService, WPARAM, LPARAM );
+INT_PTR CallProtoServiceInt(HANDLE hContact, const char* szModule, const char* szService, WPARAM, LPARAM);
+INT_PTR CallContactService(HANDLE hContact, const char *szProtoService, WPARAM, LPARAM);
-__inline static INT_PTR CallProtoService( const char* szModule, const char* szService, WPARAM wParam, LPARAM lParam )
+__inline static INT_PTR CallProtoService(const char* szModule, const char* szService, WPARAM wParam, LPARAM lParam)
{
- return CallProtoServiceInt( NULL, szModule, szService, wParam, lParam );
+ return CallProtoServiceInt(NULL, szModule, szService, wParam, lParam);
}
/**** utils.c **************************************************************************/
@@ -305,7 +307,7 @@ __inline char* lrtrimp(char* str) { return ltrimp(rtrim(str)); }; bool __fastcall wildcmp(char * name, char * mask);
void HotkeyToName(TCHAR *buf, int size, BYTE shift, BYTE key);
-WORD GetHotkeyValue( INT_PTR idHotkey );
+WORD GetHotkeyValue(INT_PTR idHotkey);
HBITMAP ConvertIconToBitmap(HICON hIcon, HIMAGELIST hIml, int iconId);
@@ -315,10 +317,10 @@ private: wchar_t* m_body;
public:
- StrConvUT( const char* pSrc ) :
- m_body( mir_a2u( pSrc )) {}
+ StrConvUT(const char* pSrc) :
+ m_body(mir_a2u(pSrc)) {}
- ~StrConvUT() { mir_free( m_body ); }
+ ~StrConvUT() { mir_free(m_body); }
operator const wchar_t* () const { return m_body; }
};
@@ -328,18 +330,18 @@ private: char* m_body;
public:
- StrConvAT( const wchar_t* pSrc ) :
- m_body( mir_u2a( pSrc )) {}
+ StrConvAT(const wchar_t* pSrc) :
+ m_body(mir_u2a(pSrc)) {}
- ~StrConvAT() { mir_free( m_body ); }
+ ~StrConvAT() { mir_free(m_body); }
operator const char* () const { return m_body; }
- operator const wchar_t* () const { return ( wchar_t* )m_body; } // type cast to fake the interface definition
- operator const LPARAM () const { return ( LPARAM )m_body; }
+ operator const wchar_t* () const { return (wchar_t*)m_body; } // type cast to fake the interface definition
+ operator const LPARAM () const { return (LPARAM)m_body; }
};
-#define StrConvT( x ) StrConvUT( x )
-#define StrConvTu( x ) x
-#define StrConvA( x ) StrConvAT( x )
-#define StrConvU( x ) x
+#define StrConvT(x) StrConvUT(x)
+#define StrConvTu(x) x
+#define StrConvA(x) StrConvAT(x)
+#define StrConvU(x) x
|