summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/AutoShutdown/shutdown_10.vcxproj3
-rw-r--r--plugins/AutoShutdown/shutdown_10.vcxproj.filters3
-rw-r--r--plugins/AutoShutdown/shutdown_12.vcxproj3
-rw-r--r--plugins/AutoShutdown/shutdown_12.vcxproj.filters3
-rw-r--r--plugins/AutoShutdown/src/common.h2
-rw-r--r--plugins/AutoShutdown/src/utils.cpp67
-rw-r--r--plugins/AutoShutdown/src/utils.h6
-rw-r--r--plugins/FloatingContacts/src/main.cpp2
-rw-r--r--plugins/Utils/mir_fonts.cpp6
-rw-r--r--plugins/Utils/mir_fonts.h4
10 files changed, 21 insertions, 78 deletions
diff --git a/plugins/AutoShutdown/shutdown_10.vcxproj b/plugins/AutoShutdown/shutdown_10.vcxproj
index 03c80f4b87..6f5b364687 100644
--- a/plugins/AutoShutdown/shutdown_10.vcxproj
+++ b/plugins/AutoShutdown/shutdown_10.vcxproj
@@ -192,6 +192,9 @@
</Link>
</ItemDefinitionGroup>
<ItemGroup>
+ <ClCompile Include="..\Utils\mir_fonts.cpp">
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ </ClCompile>
<ClCompile Include="src\cpuusage.cpp" />
<ClCompile Include="src\frame.cpp" />
<ClCompile Include="src\stdafx.cpp">
diff --git a/plugins/AutoShutdown/shutdown_10.vcxproj.filters b/plugins/AutoShutdown/shutdown_10.vcxproj.filters
index ed72cb55b5..6935ea22ff 100644
--- a/plugins/AutoShutdown/shutdown_10.vcxproj.filters
+++ b/plugins/AutoShutdown/shutdown_10.vcxproj.filters
@@ -42,6 +42,9 @@
<ClCompile Include="src\stdafx.cpp">
<Filter>Source Files</Filter>
</ClCompile>
+ <ClCompile Include="..\Utils\mir_fonts.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="src\common.h">
diff --git a/plugins/AutoShutdown/shutdown_12.vcxproj b/plugins/AutoShutdown/shutdown_12.vcxproj
index 7667f2534f..262a7bbcd5 100644
--- a/plugins/AutoShutdown/shutdown_12.vcxproj
+++ b/plugins/AutoShutdown/shutdown_12.vcxproj
@@ -195,6 +195,9 @@
</Link>
</ItemDefinitionGroup>
<ItemGroup>
+ <ClCompile Include="..\Utils\mir_fonts.cpp">
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ </ClCompile>
<ClCompile Include="src\cpuusage.cpp" />
<ClCompile Include="src\frame.cpp" />
<ClCompile Include="src\stdafx.cpp">
diff --git a/plugins/AutoShutdown/shutdown_12.vcxproj.filters b/plugins/AutoShutdown/shutdown_12.vcxproj.filters
index 645304991a..8a65402039 100644
--- a/plugins/AutoShutdown/shutdown_12.vcxproj.filters
+++ b/plugins/AutoShutdown/shutdown_12.vcxproj.filters
@@ -42,6 +42,9 @@
<ClCompile Include="src\stdafx.cpp">
<Filter>Source Files</Filter>
</ClCompile>
+ <ClCompile Include="..\Utils\mir_fonts.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="src\common.h">
diff --git a/plugins/AutoShutdown/src/common.h b/plugins/AutoShutdown/src/common.h
index e2cd8a8264..3f46f175fa 100644
--- a/plugins/AutoShutdown/src/common.h
+++ b/plugins/AutoShutdown/src/common.h
@@ -58,6 +58,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <m_icolib.h>
#include <m_hotkeys.h>
+#include "../Utils/mir_fonts.h"
+
#include <m_weather.h>
#include <m_toptoolbar.h>
#include <m_shutdown.h>
diff --git a/plugins/AutoShutdown/src/utils.cpp b/plugins/AutoShutdown/src/utils.cpp
index 6a4a2cdb9b..28b5932079 100644
--- a/plugins/AutoShutdown/src/utils.cpp
+++ b/plugins/AutoShutdown/src/utils.cpp
@@ -202,73 +202,6 @@ BOOL GetFormatedDateTime(TCHAR *pszOut,int nSize,time_t timestamp,BOOL fShowDate
}
}
-/************************* Fonts & Colors *************************/
-
-int FontService_RegisterFont(const char *pszDbModule,const char *pszDbName,const TCHAR *pszSection,const TCHAR *pszDescription,const TCHAR* pszBackgroundGroup,const TCHAR* pszBackgroundName,int position,BOOL bAllowEffects,LOGFONT *plfDefault,COLORREF clrDefault)
-{
- FontIDT fid;
- memset(&fid, 0, sizeof(fid));
- fid.cbSize=sizeof(fid);
- mir_strncpy(fid.dbSettingsGroup,pszDbModule,sizeof(fid.dbSettingsGroup)); /* buffer safe */
- mir_strncpy(fid.prefix,pszDbName,sizeof(fid.prefix)); /* buffer safe */
- mir_tstrncpy(fid.group,pszSection,SIZEOF(fid.group)); /* buffer safe */
- mir_tstrncpy(fid.name,pszDescription,SIZEOF(fid.name)); /* buffer safe */
- mir_tstrncpy(fid.backgroundGroup,pszBackgroundGroup,SIZEOF(fid.backgroundGroup)); /* buffer safe */
- mir_tstrncpy(fid.backgroundName,pszBackgroundName,SIZEOF(fid.backgroundName)); /* buffer safe */
- fid.flags=FIDF_ALLOWREREGISTER;
- if (bAllowEffects) fid.flags|=FIDF_ALLOWEFFECTS;
- fid.order=position;
- if (plfDefault != NULL) {
- fid.flags|=FIDF_DEFAULTVALID;
- fid.deffontsettings.colour=clrDefault;
- fid.deffontsettings.size=(char)plfDefault->lfHeight;
- if (plfDefault->lfItalic) fid.deffontsettings.style|=DBFONTF_ITALIC;
- if (plfDefault->lfWeight != FW_NORMAL) fid.deffontsettings.style|=DBFONTF_BOLD;
- if (plfDefault->lfUnderline) fid.deffontsettings.style|=DBFONTF_UNDERLINE;
- if (plfDefault->lfStrikeOut) fid.deffontsettings.style|=DBFONTF_STRIKEOUT;
- fid.deffontsettings.charset=plfDefault->lfCharSet;
- mir_tstrncpy(fid.deffontsettings.szFace,plfDefault->lfFaceName,SIZEOF(fid.deffontsettings.szFace)); /* buffer safe */
- }
- FontRegisterT(&fid);
- return 0;
-}
-
-int FontService_GetFont(const TCHAR *pszSection,const TCHAR *pszDescription,COLORREF *pclr,LOGFONT *plf)
-{
- FontIDT fid;
- fid.cbSize=sizeof(fid);
- mir_tstrncpy(fid.group,pszSection,SIZEOF(fid.group)); /* buffer sfae */
- mir_tstrncpy(fid.name,pszDescription,SIZEOF(fid.name)); /* buffer safe */
- *pclr=(COLORREF)CallService(MS_FONT_GETT,(WPARAM)&fid,(LPARAM)plf); /* uses fallback font on error */
- return (int)*pclr==-1;
-}
-
-int FontService_RegisterColor(const char *pszDbModule,const char *pszDbName,const TCHAR *pszSection,const TCHAR *pszDescription,COLORREF clrDefault)
-{
- ColourIDT cid;
- memset(&cid, 0, sizeof(cid));
- cid.cbSize=sizeof(cid);
- cid.defcolour=clrDefault;
- mir_strncpy(cid.dbSettingsGroup,pszDbModule,sizeof(cid.dbSettingsGroup)); /* buffer safe */
- mir_strncpy(cid.setting,pszDbName,sizeof(cid.setting)); /* buffer safe */
- mir_tstrncpy(cid.group,pszSection,SIZEOF(cid.group)); /* buffer safe */
- mir_tstrncpy(cid.name,pszDescription,SIZEOF(cid.name)); /* buffer safe */
- ColourRegisterT(&cid);
- return 0;
-}
-
-int FontService_GetColor(const TCHAR *pszSection,const TCHAR *pszDescription,COLORREF *pclr)
-{
- ColourIDT cid;
-
- memset(&cid, 0, sizeof(cid));
- cid.cbSize = sizeof(cid);
- _tcsncpy_s(cid.group, pszSection, _TRUNCATE);
- _tcsncpy_s(cid.name, pszDescription, _TRUNCATE);
- *pclr = (COLORREF)CallService(MS_COLOUR_GETT, (WPARAM)&cid, 0);
- return (int)*pclr == -1;
-}
-
/************************* Skin ***********************************/
HANDLE IcoLib_AddIconRes(const char *pszDbName,const TCHAR *pszSection,const TCHAR *pszDesc,HINSTANCE hInst,WORD idRes,BOOL fLarge)
diff --git a/plugins/AutoShutdown/src/utils.h b/plugins/AutoShutdown/src/utils.h
index b2e65c7705..1c87078c92 100644
--- a/plugins/AutoShutdown/src/utils.h
+++ b/plugins/AutoShutdown/src/utils.h
@@ -34,12 +34,6 @@ BOOL TimeStampToSystemTime(time_t timestamp,SYSTEMTIME *st);
BOOL GetFormatedCountdown(TCHAR *pszOut,int nSize,time_t countdown);
BOOL GetFormatedDateTime(TCHAR *pszOut,int nSize,time_t timestamp,BOOL fShowDateEvenToday);
-/* Fonts & Colors */
-int FontService_RegisterFont(const char *pszDbModule,const char *pszDbName,const TCHAR *pszSection,const TCHAR *pszDescription,const TCHAR* pszBackgroundGroup,const TCHAR* pszBackgroundName,int position,BOOL bAllowEffects,LOGFONT *plfDefault,COLORREF clrDefault);
-int FontService_GetFont(const TCHAR *pszSection,const TCHAR *pszDescription,COLORREF *pclr,LOGFONT *plf);
-int FontService_RegisterColor(const char *pszDbModule,const char *pszDbName,const TCHAR *pszSection,const TCHAR *pszDescription,COLORREF clrDefault);
-int FontService_GetColor(const TCHAR *pszSection,const TCHAR *pszDescription,COLORREF *pclr);
-
/* Skin */
HANDLE IcoLib_AddIconRes(const char *pszDbName,const TCHAR *pszSection,const TCHAR *pszDesc,HINSTANCE hInst,WORD idRes,BOOL fLarge);
void AddHotkey();
diff --git a/plugins/FloatingContacts/src/main.cpp b/plugins/FloatingContacts/src/main.cpp
index 748f2b1530..a03968d55a 100644
--- a/plugins/FloatingContacts/src/main.cpp
+++ b/plugins/FloatingContacts/src/main.cpp
@@ -930,7 +930,7 @@ extern "C" int __declspec(dllexport) Load()
char szId[20];
mir_snprintf(szId, SIZEOF(szId), "Font%d", i);
- FontService_RegisterFont(MODULE, szId, LPGENT("Floating contacts"), s_fonts[i], i+1, false, &lf, defColor);
+ FontService_RegisterFont(MODULE, szId, LPGENT("Floating contacts"), NULL, NULL, s_fonts[i], i+1, false, &lf, defColor);
}
HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoded);
diff --git a/plugins/Utils/mir_fonts.cpp b/plugins/Utils/mir_fonts.cpp
index 768ac12363..c7af5c3088 100644
--- a/plugins/Utils/mir_fonts.cpp
+++ b/plugins/Utils/mir_fonts.cpp
@@ -6,7 +6,7 @@
#include "mir_fonts.h"
-int FontService_RegisterFont(const char *pszDbModule,const char *pszDbName,const TCHAR *pszSection,const TCHAR *pszDescription,int position,BOOL bAllowEffects,LOGFONT *plfDefault,COLORREF clrDefault)
+int FontService_RegisterFont(const char *pszDbModule, const char *pszDbName, const TCHAR *pszSection, const TCHAR *pszDescription, const TCHAR* pszBackgroundGroup, const TCHAR* pszBackgroundName, int position, BOOL bAllowEffects, LOGFONT *plfDefault, COLORREF clrDefault)
{
FontIDT fid;
memset(&fid, 0, sizeof(fid));
@@ -15,7 +15,9 @@ int FontService_RegisterFont(const char *pszDbModule,const char *pszDbName,const
mir_strncpy(fid.prefix,pszDbName,sizeof(fid.prefix)); /* buffer safe */
mir_tstrncpy(fid.group,pszSection,SIZEOF(fid.group)); /* buffer safe */
mir_tstrncpy(fid.name,pszDescription,SIZEOF(fid.name)); /* buffer safe */
- fid.flags=FIDF_ALLOWREREGISTER;
+ mir_tstrncpy(fid.backgroundGroup, pszBackgroundGroup, SIZEOF(fid.backgroundGroup)); /* buffer safe */
+ mir_tstrncpy(fid.backgroundName, pszBackgroundName, SIZEOF(fid.backgroundName)); /* buffer safe */
+ fid.flags = FIDF_ALLOWREREGISTER;
if(bAllowEffects) fid.flags|=FIDF_ALLOWEFFECTS;
fid.order=position;
if(plfDefault!=NULL) {
diff --git a/plugins/Utils/mir_fonts.h b/plugins/Utils/mir_fonts.h
index 46528c51c1..10acb6399e 100644
--- a/plugins/Utils/mir_fonts.h
+++ b/plugins/Utils/mir_fonts.h
@@ -1,6 +1,6 @@
-int FontService_RegisterFont(const char *pszDbModule,const char *pszDbName,const TCHAR *pszSection,const TCHAR *pszDescription,int position,BOOL bAllowEffects,LOGFONT *plfDefault,COLORREF clrDefault);
-int FontService_GetFont(const TCHAR *pszSection,const TCHAR *pszDescription,COLORREF *pclr,LOGFONT *plf);
+int FontService_RegisterFont(const char *pszDbModule, const char *pszDbName, const TCHAR *pszSection, const TCHAR *pszDescription, const TCHAR* pszBackgroundGroup, const TCHAR* pszBackgroundName, int position, BOOL bAllowEffects, LOGFONT *plfDefault, COLORREF clrDefault);
+int FontService_GetFont(const TCHAR *pszSection, const TCHAR *pszDescription, COLORREF *pclr, LOGFONT *plf);
int FontService_RegisterColor(const char *pszDbModule,const char *pszDbName,const TCHAR *pszSection,const TCHAR *pszDescription,COLORREF clrDefault);
int FontService_GetColor(const TCHAR *pszSection,const TCHAR *pszDescription,COLORREF *pclr);