summaryrefslogtreecommitdiff
path: root/src/modules/fonts
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/fonts')
-rw-r--r--src/modules/fonts/FontOptions.cpp24
-rw-r--r--src/modules/fonts/FontService.cpp2
-rw-r--r--src/modules/fonts/services.cpp57
3 files changed, 19 insertions, 64 deletions
diff --git a/src/modules/fonts/FontOptions.cpp b/src/modules/fonts/FontOptions.cpp
index 12291fb933..34267a1ca6 100644
--- a/src/modules/fonts/FontOptions.cpp
+++ b/src/modules/fonts/FontOptions.cpp
@@ -84,11 +84,7 @@ typedef struct DrawTextWithEffectParam_tag
#define MS_DRAW_TEXT_WITH_EFFECTA "Modern/SkinEngine/DrawTextWithEffectA"
#define MS_DRAW_TEXT_WITH_EFFECTW "Modern/SkinEngine/DrawTextWithEffectW"
-#ifdef _UNICODE
- #define MS_DRAW_TEXT_WITH_EFFECT MS_DRAW_TEXT_WITH_EFFECTW
-#else
- #define MS_DRAW_TEXT_WITH_EFFECT MS_DRAW_TEXT_WITH_EFFECTA
-#endif
+#define MS_DRAW_TEXT_WITH_EFFECT MS_DRAW_TEXT_WITH_EFFECTW
// Helper
int __inline DrawTextWithEffect( HDC hdc, LPCTSTR lpchText, int cchText, RECT * lprc, UINT dwDTFormat, FONTEFFECT * pEffect )
@@ -164,13 +160,9 @@ BOOL ExportSettings(HWND hwndDlg, TCHAR *filename, OBJLIST<TFontID>& flist, OBJL
else
mir_snprintf( buff, SIZEOF(buff), "%s=s", F.prefix );
- #if defined( _UNICODE )
- WideCharToMultiByte(code_page, 0, F.value.szFace, -1, abuff, 1024, 0, 0);
- abuff[1023]=0;
- strcat( buff, abuff );
- #else
- strcat( buff, F.value.szFace );
- #endif
+ WideCharToMultiByte(code_page, 0, F.value.szFace, -1, abuff, 1024, 0, 0);
+ abuff[1023]=0;
+ strcat( buff, abuff );
WriteLine(fhand, buff);
mir_snprintf(buff, SIZEOF(buff), "%sSize=b", F.prefix);
@@ -559,11 +551,9 @@ static void sttSaveFontData(HWND hwndDlg, TFontID &F)
mir_snprintf(str, SIZEOF(str), "%s", F.prefix);
if ( DBWriteContactSettingTString( NULL, F.dbSettingsGroup, str, F.value.szFace )) {
- #if defined( _UNICODE )
- char buff[1024];
- WideCharToMultiByte(code_page, 0, F.value.szFace, -1, buff, 1024, 0, 0);
- DBWriteContactSettingString(NULL, F.dbSettingsGroup, str, buff);
- #endif
+ char buff[1024];
+ WideCharToMultiByte(code_page, 0, F.value.szFace, -1, buff, 1024, 0, 0);
+ DBWriteContactSettingString(NULL, F.dbSettingsGroup, str, buff);
}
mir_snprintf(str, SIZEOF(str), "%sSize", F.prefix);
diff --git a/src/modules/fonts/FontService.cpp b/src/modules/fonts/FontService.cpp
index 7b19e962f4..050661aefb 100644
--- a/src/modules/fonts/FontService.cpp
+++ b/src/modules/fonts/FontService.cpp
@@ -80,7 +80,6 @@ int LoadFontserviceModule( void )
CreateServiceFunction(MS_EFFECT_REGISTER, RegisterEffect);
CreateServiceFunction(MS_EFFECT_GET, GetEffect);
-#if defined( _UNICODE )
CreateServiceFunction(MS_FONT_REGISTERW, RegisterFontW);
CreateServiceFunction(MS_FONT_GETW, GetFontW);
@@ -89,7 +88,6 @@ int LoadFontserviceModule( void )
CreateServiceFunction(MS_EFFECT_REGISTERW, RegisterEffectW);
CreateServiceFunction(MS_EFFECT_GETW, GetEffectW);
-#endif
hFontReloadEvent = CreateHookableEvent(ME_FONT_RELOAD);
hColourReloadEvent = CreateHookableEvent(ME_COLOUR_RELOAD);
diff --git a/src/modules/fonts/services.cpp b/src/modules/fonts/services.cpp
index 1ffed036c2..e53c0f0b43 100644
--- a/src/modules/fonts/services.cpp
+++ b/src/modules/fonts/services.cpp
@@ -26,7 +26,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
COLORREF GetColorFromDefault(COLORREF cl);
-#if defined( _UNICODE )
+
void ConvertFontSettings( FontSettings* fs, TFontSettings* fsw)
{
fsw->colour = fs->colour;
@@ -104,7 +104,6 @@ void ConvertLOGFONT(LOGFONTW *lfw, LOGFONTA *lfa)
WideCharToMultiByte( code_page, 0, lfw->lfFaceName, -1, lfa->lfFaceName, LF_FACESIZE, 0, 0);
}
-#endif
static void GetDefaultFontSetting(LOGFONT* lf, COLORREF* colour)
{
@@ -301,22 +300,16 @@ static int sttRegisterFontWorker( TFontID* font_id )
return 0;
}
-#if defined( _UNICODE )
INT_PTR RegisterFontW(WPARAM wParam, LPARAM )
{
return sttRegisterFontWorker(( TFontID* )wParam );
}
-#endif
INT_PTR RegisterFont(WPARAM wParam, LPARAM)
{
- #if defined( _UNICODE )
- TFontID temp;
- ConvertFontID(( FontID* )wParam, &temp );
- return sttRegisterFontWorker( &temp );
- #else
- return sttRegisterFontWorker(( TFontID* )wParam );
- #endif
+ TFontID temp;
+ ConvertFontID(( FontID* )wParam, &temp );
+ return sttRegisterFontWorker( &temp );
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -341,12 +334,10 @@ static int sttGetFontWorker( TFontID* font_id, LOGFONT* lf )
return (int)colour;
}
-#if defined( _UNICODE )
INT_PTR GetFontW(WPARAM wParam, LPARAM lParam)
{
return sttGetFontWorker(( TFontID* )wParam, ( LOGFONT* )lParam );
}
-#endif
INT_PTR GetFont(WPARAM wParam, LPARAM lParam)
{
@@ -386,22 +377,16 @@ static int sttRegisterColourWorker( TColourID* colour_id )
return 0;
}
-#if defined( _UNICODE )
INT_PTR RegisterColourW(WPARAM wParam, LPARAM)
{
return sttRegisterColourWorker(( TColourID* )wParam );
}
-#endif
INT_PTR RegisterColour(WPARAM wParam, LPARAM)
{
- #if defined( _UNICODE )
- TColourID temp;
- ConvertColourID(( ColourID* )wParam, &temp );
- return sttRegisterColourWorker( &temp );
- #else
- return sttRegisterColourWorker(( TColourID* )wParam );
- #endif
+ TColourID temp;
+ ConvertColourID(( ColourID* )wParam, &temp );
+ return sttRegisterColourWorker( &temp );
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -420,22 +405,16 @@ static int sttGetColourWorker( TColourID* colour_id )
return -1;
}
-#if defined( _UNICODE )
INT_PTR GetColourW(WPARAM wParam, LPARAM)
{
return sttGetColourWorker(( TColourID* )wParam );
}
-#endif
INT_PTR GetColour(WPARAM wParam, LPARAM)
{
- #if defined( _UNICODE )
- TColourID temp;
- ConvertColourID(( ColourID* )wParam, &temp );
- return sttGetColourWorker( &temp );
- #else
- return sttGetColourWorker(( TColourID* )wParam );
- #endif
+ TColourID temp;
+ ConvertColourID(( ColourID* )wParam, &temp );
+ return sttGetColourWorker( &temp );
}
@@ -475,22 +454,16 @@ static int sttRegisterEffectWorker( TEffectID* effect_id )
return 0;
}
-#if defined( _UNICODE )
INT_PTR RegisterEffectW(WPARAM wParam, LPARAM lParam)
{
return sttRegisterEffectWorker(( TEffectID* )wParam );
}
-#endif
INT_PTR RegisterEffect(WPARAM wParam, LPARAM lParam)
{
-#if defined( _UNICODE )
- TEffectID temp;
+ TEffectID temp;
ConvertEffectID(( EffectID* )wParam, &temp );
return sttRegisterEffectWorker( &temp );
-#else
- return sttRegisterEffectWorker(( TEffectID* )wParam );
-#endif
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -515,20 +488,14 @@ static int sttGetEffectWorker( TEffectID* effect_id, FONTEFFECT* effect )
return (int)FALSE;
}
-#if defined( _UNICODE )
INT_PTR GetEffectW(WPARAM wParam, LPARAM lParam)
{
return sttGetEffectWorker(( TEffectID* )wParam, ( FONTEFFECT* )lParam );
}
-#endif
INT_PTR GetEffect(WPARAM wParam, LPARAM lParam)
{
-#if defined( _UNICODE )
- TEffectID temp;
+ TEffectID temp;
ConvertEffectID((EffectID *)wParam, &temp);
return sttGetEffectWorker( &temp, ( FONTEFFECT* )lParam );
-#else
- return sttGetEffectWorker(( TEffectID* )wParam, ( FONTEFFECT* )lParam );
-#endif
}