summaryrefslogtreecommitdiff
path: root/plugins/NewStory/src/fonts.cpp
diff options
context:
space:
mode:
authoraunsane <aunsane@gmail.com>2018-10-06 01:05:46 +0300
committeraunsane <aunsane@gmail.com>2018-10-06 01:05:46 +0300
commit74d0eac304a0ea26a7c28b26452f373b2dce0fea (patch)
tree4820dbbb96f8552f98e29c7dd403a1b8ff2fadb6 /plugins/NewStory/src/fonts.cpp
parent520a255f25c64b2fb89d2f3559449b2e308c1175 (diff)
NewStory: porting to ng (not complete)
Diffstat (limited to 'plugins/NewStory/src/fonts.cpp')
-rw-r--r--plugins/NewStory/src/fonts.cpp63
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);
}