diff options
Diffstat (limited to 'plugins/NewStory/src/fonts.cpp')
-rw-r--r-- | plugins/NewStory/src/fonts.cpp | 63 |
1 files changed, 31 insertions, 32 deletions
diff --git a/plugins/NewStory/src/fonts.cpp b/plugins/NewStory/src/fonts.cpp index f454fdc976..0db756187b 100644 --- a/plugins/NewStory/src/fonts.cpp +++ b/plugins/NewStory/src/fonts.cpp @@ -1,40 +1,40 @@ -#include "headers.h" +#include "stdafx.h" MyColourID colors[] = { - {0, {sizeof(ColourID), MODULETITLE, "Incoming Messages", MODULENAME, "ColorMsgIn", 0, RGB(0xff, 0xff, 0xff), 0}}, - {0, {sizeof(ColourID), MODULETITLE, "Outgoing Messages", MODULENAME, "ColorMsgOut", 0, RGB(0xff, 0xff, 0xff), 1}}, + {0, {MODULETITLE, "Incoming Messages", MODULENAME, "ColorMsgIn", 0, RGB(0xff, 0xff, 0xff), 0}}, + {0, {MODULETITLE, "Outgoing Messages", MODULENAME, "ColorMsgOut", 0, RGB(0xff, 0xff, 0xff), 1}}, - {0, {sizeof(ColourID), MODULETITLE, "Incoming Files", MODULENAME, "ColorFileIn", 0, RGB(0xff, 0xff, 0xff), 2}}, - {0, {sizeof(ColourID), MODULETITLE, "Outgoing Files", MODULENAME, "ColorFileOut", 0, RGB(0xff, 0xff, 0xff), 3}}, + {0, {MODULETITLE, "Incoming Files", MODULENAME, "ColorFileIn", 0, RGB(0xff, 0xff, 0xff), 2}}, + {0, {MODULETITLE, "Outgoing Files", MODULENAME, "ColorFileOut", 0, RGB(0xff, 0xff, 0xff), 3}}, - {0, {sizeof(ColourID), MODULETITLE, "Incoming URLs", MODULENAME, "ColorURLIn", 0, RGB(0xff, 0xff, 0xff), 4}}, - {0, {sizeof(ColourID), MODULETITLE, "Outgoing URLs", MODULENAME, "ColorURLOut", 0, RGB(0xff, 0xff, 0xff), 5}}, + {0, {MODULETITLE, "Incoming URLs", MODULENAME, "ColorURLIn", 0, RGB(0xff, 0xff, 0xff), 4}}, + {0, {MODULETITLE, "Outgoing URLs", MODULENAME, "ColorURLOut", 0, RGB(0xff, 0xff, 0xff), 5}}, - {0, {sizeof(ColourID), MODULETITLE, "Status changes", MODULENAME, "ColorStatus", 0, RGB(0xff, 0xff, 0xff), 6}}, + {0, {MODULETITLE, "Status changes", MODULENAME, "ColorStatus", 0, RGB(0xff, 0xff, 0xff), 6}}, - {0, {sizeof(ColourID), MODULETITLE, "Other Outgoing Events", MODULENAME, "ColorOut", 0, RGB(0xff, 0xff, 0xff), 7}}, - {0, {sizeof(ColourID), MODULETITLE, "Other Incoming Events", MODULENAME, "ColorIn", 0, RGB(0xff, 0xff, 0xff), 8}}, + {0, {MODULETITLE, "Other Outgoing Events", MODULENAME, "ColorOut", 0, RGB(0xff, 0xff, 0xff), 7}}, + {0, {MODULETITLE, "Other Incoming Events", MODULENAME, "ColorIn", 0, RGB(0xff, 0xff, 0xff), 8}}, - {0, {sizeof(ColourID), MODULETITLE, "Selected Items", MODULENAME, "ColorSel", 0, RGB(0x60, 0x60, 0x60), 9}}, - {0, {sizeof(ColourID), MODULETITLE, "Selected Items (Text)", MODULENAME, "ColorSelTxt", 0, RGB(0xff, 0xff, 0xff), 10}} + {0, {MODULETITLE, "Selected Items", MODULENAME, "ColorSel", 0, RGB(0x60, 0x60, 0x60), 9}}, + {0, {MODULETITLE, "Selected Items (Text)", MODULENAME, "ColorSelTxt", 0, RGB(0xff, 0xff, 0xff), 10}} }; MyFontID fonts[] = { - {0, 0, 0, {sizeof(FontID), MODULETITLE, "Incoming Messages", MODULENAME, "FontMsgIn", 0, {0}, 0}}, - {0, 0, 0, {sizeof(FontID), MODULETITLE, "Outgoing Messages", MODULENAME, "FontMsgOut", 0, {0}, 1}}, + {0, 0, 0, {MODULETITLE, "Incoming Messages", MODULENAME, "FontMsgIn", 0, {0}, 0}}, + {0, 0, 0, {MODULETITLE, "Outgoing Messages", MODULENAME, "FontMsgOut", 0, {0}, 1}}, - {0, 0, 0, {sizeof(FontID), MODULETITLE, "Incoming Files", MODULENAME, "FontFileIn", 0, {0}, 2}}, - {0, 0, 0, {sizeof(FontID), MODULETITLE, "Outgoing Files", MODULENAME, "FontFileOut", 0, {0}, 3}}, + {0, 0, 0, {MODULETITLE, "Incoming Files", MODULENAME, "FontFileIn", 0, {0}, 2}}, + {0, 0, 0, {MODULETITLE, "Outgoing Files", MODULENAME, "FontFileOut", 0, {0}, 3}}, - {0, 0, 0, {sizeof(FontID), MODULETITLE, "Incoming URLs", MODULENAME, "FontURLIn", 0, {0}, 4}}, - {0, 0, 0, {sizeof(FontID), MODULETITLE, "Outgoing URLs", MODULENAME, "FontURLOut", 0, {0}, 5}}, + {0, 0, 0, {MODULETITLE, "Incoming URLs", MODULENAME, "FontURLIn", 0, {0}, 4}}, + {0, 0, 0, {MODULETITLE, "Outgoing URLs", MODULENAME, "FontURLOut", 0, {0}, 5}}, - {0, 0, 0, {sizeof(FontID), MODULETITLE, "Status changes", MODULENAME, "FontStatus", 0, {0}, 6}}, + {0, 0, 0, {MODULETITLE, "Status changes", MODULENAME, "FontStatus", 0, {0}, 6}}, - {0, 0, 0, {sizeof(FontID), MODULETITLE, "Other Outgoing Events", MODULENAME, "FontOut", 0, {0}, 7}}, - {0, 0, 0, {sizeof(FontID), MODULETITLE, "Other Incoming Events", MODULENAME, "FontIn", 0, {0}, 8}} + {0, 0, 0, {MODULETITLE, "Other Outgoing Events", MODULENAME, "FontOut", 0, {0}, 7}}, + {0, 0, 0, {MODULETITLE, "Other Incoming Events", MODULENAME, "FontIn", 0, {0}, 8}} // {sizeof(FontID), MODULETITLE, "Default Text", MODULENAME, "FontDef", FIDF_SAVEPOINTSIZE, {0}, 0}, // {sizeof(FontID), MODULETITLE, "Selected Item", MODULENAME, "FontSel", FIDF_SAVEPOINTSIZE, {0}, 1} @@ -44,12 +44,10 @@ int evtFontsChanged(WPARAM, LPARAM) { int i; for (i = 0; i < COLOR_COUNT; i++) - { - colors[i].cl = (COLORREF)CallService(MS_COLOUR_GET, (WPARAM)&colors[i].info, 0); - } - for (i = 0; i < FONT_COUNT; i++) - { - fonts[i].cl = (COLORREF)CallService(MS_FONT_GET, (WPARAM)&fonts[i].info, (LPARAM)fonts[i].lf); + colors[i].cl = Colour_Get(colors[i].info.group, colors[i].info.name); + + for (i = 0; i < FONT_COUNT; i++) { + fonts[i].cl = (COLORREF)Font_Get(fonts[i].info, fonts[i].lf); DeleteObject(fonts[i].hfnt); fonts[i].hfnt = CreateFontIndirectA(fonts[i].lf); } @@ -59,7 +57,7 @@ int evtFontsChanged(WPARAM, LPARAM) void InitFonts() { - bool isFSInstalled = ServiceExists(MS_FONT_GET) ? true : false; + bool isFSInstalled = /*ServiceExists(MS_FONT_GET) ? */true/* : false*/; int i; // damn msvc can't handle for(int i...) correctly! =( @@ -70,14 +68,15 @@ void InitFonts() { for (i = 0; i < COLOR_COUNT; i++) { - CallService(MS_COLOUR_REGISTER, (WPARAM)&colors[i].info, 0); - colors[i].cl = (COLORREF)CallService(MS_COLOUR_GET, (WPARAM)&colors[i].info, 0); + g_plugin.addColor(&colors[i].info); + colors[i].cl = Colour_Get(colors[i].info.group, colors[i].info.name); } for (i = 0; i < FONT_COUNT; i++) { - CallService(MS_FONT_REGISTER, (WPARAM)&fonts[i].info, 0); + //CallService(MS_FONT_REGISTER, (WPARAM)&fonts[i].info, 0); + g_plugin.addFont(&fonts[i].info); fonts[i].lf = (LOGFONTA *)malloc(sizeof(LOGFONTA)); - fonts[i].cl = (COLORREF)CallService(MS_FONT_GET, (WPARAM)&fonts[i].info, (LPARAM)fonts[i].lf); + fonts[i].cl = (COLORREF)Font_Get(fonts[i].info, fonts[i].lf); fonts[i].hfnt = CreateFontIndirectA(fonts[i].lf); //MessageBox(0, fonts[i].lf->lfFaceName, _T(""), MB_OK); } |