diff options
-rw-r--r-- | commonheaders.h | 2 | ||||
-rw-r--r-- | icons.cpp | 60 | ||||
-rw-r--r-- | icons/secured.ico | bin | 2550 -> 2550 bytes | |||
-rw-r--r-- | icons/unsecured.ico | bin | 2550 -> 2550 bytes | |||
-rw-r--r-- | init.cpp | 2 | ||||
-rw-r--r-- | new_gpg.rc | 10 | ||||
-rw-r--r-- | new_gpg.vcproj | 79 | ||||
-rw-r--r-- | options.cpp | 1 | ||||
-rw-r--r-- | resource.h | 4 | ||||
-rw-r--r-- | utilities.cpp | 1 |
10 files changed, 154 insertions, 5 deletions
diff --git a/commonheaders.h b/commonheaders.h index a1f1883..698a90e 100644 --- a/commonheaders.h +++ b/commonheaders.h @@ -21,6 +21,7 @@ #include <io.h> #include <errno.h> #include <time.h> +#include <uxtheme.h> #include <iostream> #include <map> @@ -51,6 +52,7 @@ using std::fstream; #include <m_jabber.h> #include <m_message.h> #include <m_cluiframes.h> +#include <m_icolib.h> #include "m_extraicons.h" #include "m_metacontacts.h" #include "resource.h" @@ -16,6 +16,66 @@ #include "commonheaders.h"
+HANDLE IconLibDefine(TCHAR* desc, TCHAR* section, char* ident, HICON icon, char* def_file, int def_idx, int size) +{ + SKINICONDESC sid = {0}; + HANDLE hIcon; + + if(!size) + size = 16; + + sid.cbSize = SKINICONDESC_SIZE; + sid.ptszSection = section; + sid.ptszDescription = desc; + sid.flags = SIDF_TCHAR; + + sid.pszName = ident; + sid.pszDefaultFile = def_file; + sid.iDefaultIndex = def_idx; + sid.hDefaultIcon = icon; + sid.cx = sid.cy = size; + + hIcon = (HANDLE)CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid); + + return hIcon; +} +
+
+void InitIconLib() +{ + extern HINSTANCE hInst; + char lib[MAX_PATH]; + GetModuleFileNameA(hInst, lib, MAX_PATH); + TCHAR *module = mir_a2t(szGPGModuleName); + + IconLibDefine(_T("Secured"), module, "secured", NULL, lib, -IDI_SECURED,0); + IconLibDefine(_T("Unsecured"), module, "unsecured", NULL, lib, -IDI_UNSECURED,0); + mir_free(module); +} + + + + + +HICON IconLibGetIcon(const char* ident) +{ + return (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)ident); +} + + + +void IconLibReleaseIcon(const char* ident) +{ + CallService(MS_SKIN2_RELEASEICON, 0, (LPARAM)ident); +} + + + +HANDLE IconLibHookIconsChanged(MIRANDAHOOK hook) +{ + return HookEvent(ME_SKIN2_ICONSCHANGED, hook); +} +
// обновляет иконки в clist и в messagew
void ShowStatusIcon(HANDLE hContact,bool enabled) {
diff --git a/icons/secured.ico b/icons/secured.ico Binary files differindex 8b42e2c..8d84167 100644 --- a/icons/secured.ico +++ b/icons/secured.ico diff --git a/icons/unsecured.ico b/icons/unsecured.ico Binary files differindex 53209bc..567367b 100644 --- a/icons/unsecured.ico +++ b/icons/unsecured.ico @@ -155,12 +155,14 @@ static int OnModulesLoaded(WPARAM wParam,LPARAM lParam) int onIconPressed(WPARAM wParam, LPARAM lParam);
int onExtraImageListRebuilding(WPARAM, LPARAM);
int onExtraImageApplying(WPARAM wParam, LPARAM);
+ void InitIconLib();
void InitCheck();
void FirstRun();
FirstRun();
InitCheck();
+ InitIconLib();
bIsMiranda09 = (DWORD)CallService(MS_SYSTEM_GETVERSION, 0, 0) >= 0x00090100?true:false;
bMetaContacts = ServiceExists(MS_MC_GETMETACONTACT);
@@ -221,6 +221,16 @@ BEGIN END
#endif // APSTUDIO_INVOKED
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Icon
+//
+
+// Icon with lowest ID value placed first to ensure application icon
+// remains consistent on all systems.
+IDI_SECURED ICON "icons\\secured.ico"
+IDI_UNSECURED ICON "icons\\unsecured.ico"
#endif // русский resources
/////////////////////////////////////////////////////////////////////////////
diff --git a/new_gpg.vcproj b/new_gpg.vcproj index f4c9fa1..f195b1a 100644 --- a/new_gpg.vcproj +++ b/new_gpg.vcproj @@ -156,8 +156,9 @@ MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
- UsePrecompiledHeader="0"
+ UsePrecompiledHeader="2"
PrecompiledHeaderThrough="commonheaders.h"
+ PrecompiledHeaderFile="c:\temp\new_gpg.pch"
AssemblerListingLocation=".\Debug/"
ObjectFile=".\Debug/"
ProgramDataBaseFileName=".\Debug/"
@@ -618,14 +619,38 @@ <File
RelativePath=".\clist.cpp"
>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="2"
+ />
+ </FileConfiguration>
</File>
<File
RelativePath=".\gpg_wrapper.cpp"
>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="2"
+ />
+ </FileConfiguration>
</File>
<File
RelativePath=".\icons.cpp"
>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="2"
+ />
+ </FileConfiguration>
</File>
<File
RelativePath=".\init.cpp"
@@ -635,7 +660,7 @@ >
<Tool
Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"
+ UsePrecompiledHeader="1"
PrecompiledHeaderThrough="commonheaders.h"
/>
</FileConfiguration>
@@ -643,6 +668,14 @@ <File
RelativePath=".\jabber_account.cpp"
>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="2"
+ />
+ </FileConfiguration>
</File>
<File
RelativePath=".\main.cpp"
@@ -652,29 +685,69 @@ >
<Tool
Name="VCCLCompilerTool"
- UsePrecompiledHeader="0"
+ UsePrecompiledHeader="2"
/>
</FileConfiguration>
</File>
<File
RelativePath=".\messages.cpp"
>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="2"
+ />
+ </FileConfiguration>
</File>
<File
RelativePath=".\metacontacts.cpp"
>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="2"
+ />
+ </FileConfiguration>
</File>
<File
RelativePath=".\options.cpp"
>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="2"
+ />
+ </FileConfiguration>
</File>
<File
RelativePath=".\srmm.cpp"
>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="2"
+ />
+ </FileConfiguration>
</File>
<File
RelativePath=".\utilities.cpp"
>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="2"
+ />
+ </FileConfiguration>
</File>
</Filter>
<Filter
diff --git a/options.cpp b/options.cpp index 734a591..8f64c98 100644 --- a/options.cpp +++ b/options.cpp @@ -15,7 +15,6 @@ // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "commonheaders.h" -#include <uxtheme.h> extern HINSTANCE hInst; @@ -12,6 +12,8 @@ #define IDD_KEY_GEN 109
#define IDD_LOAD_EXISTING_KEY 110
#define IDD_KEY_PASSWD 111
+#define IDI_SECURED 112
+#define IDI_UNSECURED 113
#define IDC_SET_BIN_PATH 1016
#define IDC_SET_HOME_DIR 1017
#define IDC_BIN_PATH 1018
@@ -63,7 +65,7 @@ //
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NEXT_RESOURCE_VALUE 112
+#define _APS_NEXT_RESOURCE_VALUE 114
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1052
#define _APS_NEXT_SYMED_VALUE 101
diff --git a/utilities.cpp b/utilities.cpp index de7c3ff..6f5a654 100644 --- a/utilities.cpp +++ b/utilities.cpp @@ -490,3 +490,4 @@ bool isContactSecured(HANDLE hContact) return true; return false; } + |