예제 #1
0
static void RegisterFonts()
{
	ColourIDT colourid = { sizeof(colourid) };
	strncpy(colourid.dbSettingsGroup, CHAT_MODULE, sizeof(colourid.dbSettingsGroup));
	_tcsncpy(colourid.group, LPGENT("Chat module"), _countof(colourid.group));

	strncpy(colourid.setting, "ColorLogBG", _countof(colourid.setting));
	_tcsncpy(colourid.name, LPGENT("Group chat log background"), _countof(colourid.name));
	colourid.defcolour = GetSysColor(COLOR_WINDOW);
	ColourRegisterT(&colourid);

	strncpy(colourid.setting, "ColorMessageBG", _countof(colourid.setting));
	_tcsncpy(colourid.name, LPGENT("Message background"), _countof(colourid.name));
	colourid.defcolour = GetSysColor(COLOR_WINDOW);
	ColourRegisterT(&colourid);

	strncpy(colourid.setting, "ColorNicklistBG", _countof(colourid.setting));
	_tcsncpy(colourid.name, LPGENT("Nick list background"), _countof(colourid.name));
	colourid.defcolour = GetSysColor(COLOR_WINDOW);
	ColourRegisterT(&colourid);

	strncpy(colourid.setting, "ColorNicklistLines", _countof(colourid.setting));
	_tcsncpy(colourid.name, LPGENT("Nick list lines"), _countof(colourid.name));
	colourid.defcolour = GetSysColor(COLOR_INACTIVEBORDER);
	ColourRegisterT(&colourid);

	strncpy(colourid.setting, "ColorNicklistSelectedBG", _countof(colourid.setting));
	_tcsncpy(colourid.name, LPGENT("Nick list background (selected)"), _countof(colourid.name));
	colourid.defcolour = GetSysColor(COLOR_HIGHLIGHT);
	ColourRegisterT(&colourid);
}
예제 #2
0
void cfg::FS_RegisterFonts()
{
	ColourIDT 	colourid;
	FontIDT    	fid = {0};
	char 		szTemp[50];
	DBVARIANT 	dbv;
	int 		j = 0;

	fid.cbSize = sizeof(fid);
	wcsncpy(fid.group, L"Contact List", _countof(fid.group));
	strncpy(fid.dbSettingsGroup, "CLC", 5);
	fid.flags = FIDF_DEFAULTVALID | FIDF_ALLOWEFFECTS | FIDF_APPENDNAME | FIDF_SAVEPOINTSIZE;
	wcsncpy(fid.backgroundGroup, L"Contact List", _countof(fid.backgroundGroup));
	while(_tagFSINFO[j].name != 0) {
		if(FONTID_EVENTAREA == _tagFSINFO[j].id)
			wcsncpy(fid.backgroundName, L"Event area background", _countof(fid.backgroundName));
		else if(FONTID_FRAMETITLE == _tagFSINFO[j].id)
			wcsncpy(fid.backgroundName, L"Frame title background", _countof(fid.backgroundName));
		else if(FONTID_GROUPCOUNTS == _tagFSINFO[j].id || FONTID_GROUPS == _tagFSINFO[j].id)
			_tcsncpy(fid.backgroundName, L"Group header background", _countof(fid.backgroundName));
		else
			wcsncpy(fid.backgroundName, L"List background", _countof(fid.backgroundName));

		mir_snprintf(szTemp, sizeof(szTemp), "Font%d", _tagFSINFO[j].id);
		strncpy(fid.prefix, szTemp, sizeof(fid.prefix));
		fid.order = _tagFSINFO[j].id;
		wcsncpy(fid.name, _tagFSINFO[j].name, 60);
		_snprintf(szTemp, sizeof(szTemp), "Font%dCol", _tagFSINFO[j].id);
		fid.deffontsettings.colour = (COLORREF)cfg::getDword("CLC", szTemp, GetSysColor(COLOR_WINDOWTEXT));

		_snprintf(szTemp, sizeof(szTemp), "Font%dSize", _tagFSINFO[j].id);
		fid.deffontsettings.size = (BYTE)cfg::getByte("CLC", szTemp, 8);

		_snprintf(szTemp, sizeof(szTemp), "Font%dSty", _tagFSINFO[j].id);
		fid.deffontsettings.style = cfg::getByte("CLC", szTemp, 0);
		_snprintf(szTemp, sizeof(szTemp), "Font%dSet", _tagFSINFO[j].id);
		fid.deffontsettings.charset = cfg::getByte("CLC", szTemp, DEFAULT_CHARSET);
		_snprintf(szTemp, sizeof(szTemp), "Font%dName", _tagFSINFO[j].id);
		if(cfg::getString(NULL, "CLC", szTemp, &dbv))
			lstrcpyn(fid.deffontsettings.szFace, L"Tahoma", LF_FACESIZE);
		else {
			lstrcpyn(fid.deffontsettings.szFace, dbv.ptszVal, LF_FACESIZE);
			mir_free(dbv.ptszVal);
		}
		FontRegisterT(&fid);
		j++;
	}

	colourid.order = 0;
	strncpy(colourid.dbSettingsGroup, "CLC", sizeof(colourid.dbSettingsGroup));
	colourid.cbSize = sizeof(ColourIDT);
	mir_sntprintf(colourid.group, _countof(colourid.group), L"%s", L"Contact List");
	for (int i = 0; i < _countof(_clrs); i++) {
		colourid.order = _clrs[i].order;
		mir_snprintf(colourid.setting, sizeof(colourid.setting), "%s", _clrs[i].szSetting);
		mir_sntprintf(colourid.name, _countof(colourid.name), L"%s", _clrs[i].tszName);
		colourid.defcolour = (_clrs[i].def & 0xff000000 ? GetSysColor(_clrs[i].def & 0x00ffffff) : _clrs[i].def);
		ColourRegisterT(&colourid);
	}
}
예제 #3
0
static int OnModulesLoaded(WPARAM, LPARAM)
{
	HookEvent(ME_TTB_MODULELOADED, g_OnToolbarInit);

	bSecureIM = (ServiceExists("SecureIM/IsContactSecured"));
	bMirOTR = (int)GetModuleHandle(_T("mirotr.dll"));
	bNewGPG = (int)GetModuleHandle(_T("new_gpg.dll"));
	#ifdef _WIN64
		bPlatform = 1;
	#else
		bPlatform = 0;
	#endif

	// file associations manager plugin support
	if (ServiceExists(MS_ASSOCMGR_ADDNEWURLTYPE)) {
		CreateServiceFunction("JABBER/*" JS_PARSE_XMPP_URI, g_SvcParseXmppUri);
		AssocMgr_AddNewUrlTypeT("xmpp:", TranslateT("Jabber Link Protocol"), hInst, IDI_JABBER, "JABBER/*" JS_PARSE_XMPP_URI, 0);
	}

	// init fontservice for info frame
	FontIDT fontid = {0};
	fontid.cbSize = sizeof(fontid);
	_tcsncpy(fontid.group, LPGENT("Jabber"), SIZEOF(fontid.group));
	strncpy(fontid.dbSettingsGroup, GLOBAL_SETTING_MODULE, SIZEOF(fontid.dbSettingsGroup));
	_tcsncpy(fontid.backgroundGroup, _T("Jabber"), SIZEOF(fontid.backgroundGroup));
	_tcsncpy(fontid.backgroundName,_T("Background"), SIZEOF(fontid.backgroundName));
	fontid.flags = FIDF_DEFAULTVALID;

	fontid.deffontsettings.charset = DEFAULT_CHARSET;
	fontid.deffontsettings.colour = GetSysColor(COLOR_WINDOWTEXT);
	fontid.deffontsettings.size = -11;
	lstrcpyn(fontid.deffontsettings.szFace, _T("MS Shell Dlg"), SIZEOF(fontid.deffontsettings.szFace));
	fontid.deffontsettings.style = 0;

	_tcsncpy(fontid.name, LPGENT("Frame title"), SIZEOF(fontid.name));
	strncpy(fontid.prefix, "fntFrameTitle", SIZEOF(fontid.prefix));
	fontid.deffontsettings.style = DBFONTF_BOLD;
	FontRegisterT(&fontid);

	_tcsncpy(fontid.name, LPGENT("Frame text"), SIZEOF(fontid.name));
	strncpy(fontid.prefix, "fntFrameClock", SIZEOF(fontid.prefix));
	fontid.deffontsettings.style = 0;
	FontRegisterT(&fontid);

	ColourIDT colourid = {0};
	colourid.cbSize = sizeof(colourid);
	_tcsncpy(colourid.group, _T("Jabber"), SIZEOF(colourid.group));
	strncpy(colourid.dbSettingsGroup, GLOBAL_SETTING_MODULE, SIZEOF(colourid.dbSettingsGroup));

	_tcsncpy(colourid.name, _T("Background"), SIZEOF(colourid.name));
	strncpy(colourid.setting, "clFrameBack", SIZEOF(colourid.setting));
	colourid.defcolour = GetSysColor(COLOR_WINDOW);
	ColourRegisterT(&colourid);

	// Init extra icons
	hExtraActivity = ExtraIcon_Register("activity", LPGEN("Jabber Activity"), "jabber_dancing");
	hExtraMood = ExtraIcon_Register("mood", LPGEN("Jabber Mood"), "jabber_contemplative");
	return 0;
}
예제 #4
0
파일: utils.cpp 프로젝트: 0xmono/miranda-ng
int FontService_RegisterColor(const char *pszDbModule,const char *pszDbName,const TCHAR *pszSection,const TCHAR *pszDescription,COLORREF clrDefault)
{
	ColourIDT cid;
	ZeroMemory(&cid,sizeof(cid));
	cid.cbSize=sizeof(cid);
	cid.defcolour=clrDefault;
	lstrcpynA(cid.dbSettingsGroup,pszDbModule,sizeof(cid.dbSettingsGroup)); /* buffer safe */
	lstrcpynA(cid.setting,pszDbName,sizeof(cid.setting)); /* buffer safe */
	lstrcpyn(cid.group,pszSection,SIZEOF(cid.group)); /* buffer safe */
	lstrcpyn(cid.name,pszDescription,SIZEOF(cid.name)); /* buffer safe */
	ColourRegisterT(&cid);
	return 0;
}
예제 #5
0
파일: Main.cpp 프로젝트: kmdtukl/miranda-ng
void CreateFrame()
{
	if (!ServiceExists(MS_CLIST_FRAMES_ADDFRAME))
		return;

	WNDCLASS wndclass = { 0 };
	wndclass.style = 0;
	wndclass.lpfnWndProc = FrameWindowProc;
	wndclass.cbClsExtra = 0;
	wndclass.cbWndExtra = 0;
	wndclass.hInstance = hInst;
	wndclass.hIcon = NULL;
	wndclass.hCursor = LoadCursor(NULL, IDC_ARROW);
	wndclass.hbrBackground = 0;
	wndclass.lpszMenuName = NULL;
	wndclass.lpszClassName = _T("BassInterfaceFrame");
	RegisterClass(&wndclass);

	hwnd_plugin = CreateWindow(_T("BassInterfaceFrame"), TranslateT("Bass Interface"),
		WS_CHILD | WS_CLIPCHILDREN, 0, 0, 10, 10, pcli->hwndContactList, NULL, hInst, NULL);

	CLISTFrame Frame = { sizeof(CLISTFrame) };
	Frame.tname = TranslateT("Bass Interface");
	Frame.hWnd = hwnd_plugin;
	Frame.align = alBottom;
	Frame.Flags = F_TCHAR | F_VISIBLE | F_SHOWTB | F_SHOWTBTIP;
	Frame.height = 22;
	Frame.hIcon = Skin_LoadIcon(SKINICON_OTHER_FRAME);
	frame_id = (HANDLE)CallService(MS_CLIST_FRAMES_ADDFRAME, (WPARAM)&Frame, 0);

	ColourIDT colourid = { 0 };
	colourid.cbSize = sizeof(ColourIDT);
	mir_strcpy(colourid.dbSettingsGroup, ModuleName);
	mir_strcpy(colourid.setting, "ColorFrame");
	mir_tstrcpy(colourid.name, LPGENT("Frame background"));
	mir_tstrcpy(colourid.group, _T(ModuleName));
	colourid.defcolour = GetSysColor(COLOR_3DFACE);
	ColourRegisterT(&colourid);

	HookEvent(ME_COLOUR_RELOAD, ReloadColors);
	ReloadColors(0, 0);
}
예제 #6
0
int AlarmWinModulesLoaded(WPARAM, LPARAM)
{
	title_font_id.cbSize = sizeof(FontIDT);
	mir_tstrcpy(title_font_id.group, LPGENT("Alarms"));
	mir_tstrcpy(title_font_id.name, LPGENT("Title"));
	mir_strcpy(title_font_id.dbSettingsGroup, MODULE);
	mir_strcpy(title_font_id.prefix, "FontTitle");
	mir_tstrcpy(title_font_id.backgroundGroup,LPGENT("Alarms"));
	mir_tstrcpy(title_font_id.backgroundName,LPGENT("Background"));
	title_font_id.flags = 0;
	title_font_id.order = 0;
	FontRegisterT(&title_font_id);

	window_font_id.cbSize = sizeof(FontIDT);
	mir_tstrcpy(window_font_id.group, LPGENT("Alarms"));
	mir_tstrcpy(window_font_id.name, LPGENT("Window"));
	mir_strcpy(window_font_id.dbSettingsGroup, MODULE);
	mir_strcpy(window_font_id.prefix, "FontWindow");
	mir_tstrcpy(window_font_id.backgroundGroup,LPGENT("Alarms"));
	mir_tstrcpy(window_font_id.backgroundName,LPGENT("Background"));
	window_font_id.flags = 0;
	window_font_id.order = 1;
	FontRegisterT(&window_font_id);

	bk_colour_id.cbSize = sizeof(ColourIDT);
	mir_strcpy(bk_colour_id.dbSettingsGroup, MODULE);
	mir_tstrcpy(bk_colour_id.group, LPGENT("Alarms"));
	mir_tstrcpy(bk_colour_id.name, LPGENT("Background"));
	mir_strcpy(bk_colour_id.setting, "BkColour");
	bk_colour_id.defcolour = GetSysColor(COLOR_3DFACE);
	bk_colour_id.flags = 0;
	bk_colour_id.order = 0;

	ColourRegisterT(&bk_colour_id);

	ReloadFonts(0, 0);
	HookEvent(ME_FONT_RELOAD, ReloadFonts);
	return 0;
}
예제 #7
0
파일: yapp.cpp 프로젝트: Seldom/miranda-ng
static void InitFonts()
{
    font_id_firstline.cbSize = sizeof(FontIDT);
    font_id_firstline.flags = FIDF_ALLOWEFFECTS;
    mir_tstrcpy(font_id_firstline.group, LPGENT("Popups"));
    mir_tstrcpy(font_id_firstline.name, LPGENT("First line"));
    mir_strcpy(font_id_firstline.dbSettingsGroup, MODULE);
    mir_strcpy(font_id_firstline.prefix, "FontFirst");
    mir_tstrcpy(font_id_firstline.backgroundGroup, _T("Popups"));
    mir_tstrcpy(font_id_firstline.backgroundName, _T("Background"));
    font_id_firstline.order = 0;
    FontRegisterT(&font_id_firstline);

    font_id_secondline.cbSize = sizeof(FontIDT);
    font_id_secondline.flags = FIDF_ALLOWEFFECTS;
    mir_tstrcpy(font_id_secondline.group, LPGENT("Popups"));
    mir_tstrcpy(font_id_secondline.name, LPGENT("Second line"));
    mir_strcpy(font_id_secondline.dbSettingsGroup, MODULE);
    mir_strcpy(font_id_secondline.prefix, "FontSecond");
    mir_tstrcpy(font_id_secondline.backgroundGroup, _T("Popups"));
    mir_tstrcpy(font_id_secondline.backgroundName, _T("Background"));
    font_id_secondline.order = 1;
    FontRegisterT(&font_id_secondline);

    font_id_time.cbSize = sizeof(FontIDT);
    font_id_time.flags = FIDF_ALLOWEFFECTS;
    mir_tstrcpy(font_id_time.group, LPGENT("Popups"));
    mir_tstrcpy(font_id_time.name, LPGENT("Time"));
    mir_strcpy(font_id_time.dbSettingsGroup, MODULE);
    mir_strcpy(font_id_time.prefix, "FontTime");
    mir_tstrcpy(font_id_time.backgroundGroup, _T("Popups"));
    mir_tstrcpy(font_id_time.backgroundName, _T("Background"));
    font_id_time.order = 2;
    FontRegisterT(&font_id_time);

    colour_id_bg.cbSize = sizeof(ColourIDT);
    mir_tstrcpy(colour_id_bg.group, LPGENT("Popups"));
    mir_tstrcpy(colour_id_bg.name, LPGENT("Background"));
    mir_strcpy(colour_id_bg.dbSettingsGroup, MODULE);
    mir_strcpy(colour_id_bg.setting, "ColourBg");
    colour_id_bg.defcolour = GetSysColor(COLOR_3DSHADOW);
    colour_id_bg.order = 0;
    ColourRegisterT(&colour_id_bg);

    colour_id_border.cbSize = sizeof(ColourIDT);
    mir_tstrcpy(colour_id_border.group, LPGENT("Popups"));
    mir_tstrcpy(colour_id_border.name, LPGENT("Border"));
    mir_strcpy(colour_id_border.dbSettingsGroup, MODULE);
    mir_strcpy(colour_id_border.setting, "ColourBorder");
    colour_id_border.defcolour = RGB(0, 0, 0);
    colour_id_border.order = 1;
    ColourRegisterT(&colour_id_border);

    colour_id_sidebar.cbSize = sizeof(ColourIDT);
    mir_tstrcpy(colour_id_sidebar.group, LPGENT("Popups"));
    mir_tstrcpy(colour_id_sidebar.name, LPGENT("Sidebar"));
    mir_strcpy(colour_id_sidebar.dbSettingsGroup, MODULE);
    mir_strcpy(colour_id_sidebar.setting, "ColourSidebar");
    colour_id_sidebar.defcolour = RGB(128, 128, 128);
    colour_id_sidebar.order = 2;
    ColourRegisterT(&colour_id_sidebar);

    colour_id_titleunderline.cbSize = sizeof(ColourIDT);
    mir_tstrcpy(colour_id_titleunderline.group, LPGENT("Popups"));
    mir_tstrcpy(colour_id_titleunderline.name, LPGENT("Title underline"));
    mir_strcpy(colour_id_titleunderline.dbSettingsGroup, MODULE);
    mir_strcpy(colour_id_titleunderline.setting, "ColourTitleUnderline");
    colour_id_titleunderline.defcolour = GetSysColor(COLOR_3DSHADOW);
    colour_id_titleunderline.order = 3;
    ColourRegisterT(&colour_id_titleunderline);

    ReloadFont(0, 0);
}
예제 #8
0
static int OnSystemModulesLoaded(WPARAM wParam,LPARAM lParam)
{
	CreateServiceFunction(MS_CONSOLE_SHOW_HIDE, ShowHideConsole);

	FontIDT fid = {0};
	fid.cbSize = sizeof(fid);
	_tcscpy(fid.group,_T("Console"));
	_tcscpy(fid.name,TranslateT("Text"));
	strcpy(fid.dbSettingsGroup,"Console");
	strcpy(fid.prefix,"ConsoleFont");
	_tcscpy(fid.backgroundGroup,_T("Console"));
	_tcscpy(fid.backgroundName,_T("Background"));
	fid.flags = FIDF_DEFAULTVALID;
	fid.deffontsettings.charset = DEFAULT_CHARSET;
	fid.deffontsettings.colour = RGB(0, 0, 0);
	fid.deffontsettings.size = 10;
	fid.deffontsettings.style = 0;
	_tcsncpy(fid.deffontsettings.szFace, _T("Courier"), LF_FACESIZE);
	FontRegisterT(&fid);

	HookEvent(ME_FONT_RELOAD,OnFontChange);

	ColourIDT cid = {0};
	cid.cbSize=sizeof(cid);
	_tcscpy(cid.group,_T("Console"));
	_tcscpy(cid.name,_T("Background"));
	strcpy(cid.dbSettingsGroup,"Console");
	strcpy(cid.setting,"BgColor");
	cid.defcolour = RGB(255,255,255);
	ColourRegisterT(&cid);

	HookEvent(ME_COLOUR_RELOAD, OnColourChange);

	HOTKEYDESC hkd = {0};
	hkd.cbSize = sizeof(hkd);
	hkd.pszName = "Console_Show_Hide";
	hkd.pszDescription = LPGEN("Show/Hide Console");
	hkd.pszSection = "Main";
	hkd.pszService = MS_CONSOLE_SHOW_HIDE;
	hkd.DefHotKey = HOTKEYCODE(HOTKEYF_EXT, 'C');
	Hotkey_Register(&hkd);

	if (hwndConsole && IsWindow(hwndConsole))
	{
		HookEvent(ME_TTB_MODULELOADED, OnTTBLoaded);

		CLISTMENUITEM mi = { sizeof(mi) };
		mi.flags = CMIF_TCHAR;
		mi.hIcon = hIcons[0];
		mi.ptszPopupName = LPGENT("&Help");
		mi.popupPosition = 2000090000;
		mi.position = 1000000000;
		mi.ptszName = (IsWindowVisible(hwndConsole)) ? LPGENT("Hide Console") : LPGENT("Show Console");
		mi.pszService = MS_CONSOLE_SHOW_HIDE;
		hMenu = Menu_AddMainMenuItem(&mi);

		OnFontChange(0,0);
		OnColourChange(0,0);

		if (db_get_b(NULL,"Console","ShowAtStart",0) || db_get_b(NULL,"Console","Show",1))
			ShowConsole(1);
		else
			ShowConsole(0);
	}

	return 0;
}
예제 #9
0
파일: font.cpp 프로젝트: 0xmono/miranda-ng
void InitFonts() {
	// Fonts
	FontIDT fid = {0};
	fid.cbSize = sizeof(FontIDT);
	lstrcpyn(fid.group, _T(PU_FNT_AND_COLOR), SIZEOF(fid.group));
	strncpy(fid.dbSettingsGroup, PU_FNT_AND_COLOR_DB, SIZEOF(fid.dbSettingsGroup));
	fid.flags = FIDF_DEFAULTVALID;
	fid.deffontsettings.charset = DEFAULT_CHARSET;
	fid.deffontsettings.size = -11;
	lstrcpyn(fid.backgroundGroup, _T(PU_FNT_AND_COLOR), SIZEOF(fid.backgroundGroup));
	lstrcpyn(fid.backgroundName, PU_COL_BACK_NAME, SIZEOF(fid.backgroundName));
	lstrcpyn(fid.deffontsettings.szFace, _T("Tahoma"), SIZEOF(fid.deffontsettings.szFace));

	lstrcpyn(fid.name, _T(PU_FNT_NAME_TITLE), SIZEOF(fid.name));
	mir_snprintf(fid.prefix, sizeof(fid.prefix), PU_FNT_PREFIX, PU_FNT_NAME_TITLE);
	fid.deffontsettings.style  = DBFONTF_BOLD;
	fid.deffontsettings.colour = RGB(0, 0, 0);
	FontRegisterT(&fid);

	lstrcpyn(fid.name, _T(PU_FNT_NAME_CLOCK), SIZEOF(fid.name));
	mir_snprintf(fid.prefix, sizeof(fid.prefix), PU_FNT_PREFIX, PU_FNT_NAME_CLOCK);
	//fid.deffontsettings.style  = DBFONTF_BOLD;
	//fid.deffontsettings.colour = RGB(0, 0, 0);
	FontRegisterT(&fid);

	lstrcpyn(fid.name, _T(PU_FNT_NAME_TEXT), SIZEOF(fid.name));
	mir_snprintf(fid.prefix, sizeof(fid.prefix), PU_FNT_PREFIX, PU_FNT_NAME_TEXT);
	fid.deffontsettings.style  = 0;
	//fid.deffontsettings.colour = RGB(0, 0, 0);
	FontRegisterT(&fid);

	lstrcpyn(fid.name, _T(PU_FNT_NAME_ACTION), SIZEOF(fid.name));
	mir_snprintf(fid.prefix, sizeof(fid.prefix), PU_FNT_PREFIX, PU_FNT_NAME_ACTION);
	fid.flags = FIDF_DEFAULTVALID | FIDF_ALLOWEFFECTS;
	//fid.deffontsettings.style = 0;
	fid.deffontsettings.colour = RGB(0, 0, 255);
	FontRegisterT(&fid);

	lstrcpyn(fid.name, _T(PU_FNT_NAME_HOVERED_ACTION), SIZEOF(fid.name));
	mir_snprintf(fid.prefix, sizeof(fid.prefix), PU_FNT_PREFIX, PU_FNT_NAME_HOVERED_ACTION);
	fid.deffontsettings.style = DBFONTF_UNDERLINE;
	//fid.deffontsettings.colour = RGB(0, 0, 255);
	FontRegisterT(&fid);

	ColourIDT cid = {0};
	cid.cbSize = sizeof(ColourIDT);
	lstrcpyn(cid.group, _T(PU_FNT_AND_COLOR), SIZEOF(cid.group));
	strncpy(cid.dbSettingsGroup, PU_FNT_AND_COLOR_DB, SIZEOF(cid.dbSettingsGroup));

	lstrcpyn(cid.name, PU_COL_BACK_NAME, SIZEOF(cid.name));
	strncpy(cid.setting, PU_COL_BACK_SETTING, SIZEOF(cid.setting));
	cid.defcolour = SETTING_BACKCOLOUR_DEFAULT;
	ColourRegisterT(&cid);

	lstrcpyn(cid.name, PU_COL_AVAT_NAME, SIZEOF(cid.name));
	strncpy(cid.setting, PU_COL_AVAT_SETTING, SIZEOF(cid.setting));
	cid.defcolour = SETTING_TEXTCOLOUR_DEFAULT;
	ColourRegisterT(&cid);

	ReloadFonts();
}
예제 #10
0
void InitFonts()
{
	colourBg.cbSize = sizeof(ColourIDT);
	mir_tstrcpy(colourBg.group, LPGENT("Tooltips"));
	mir_tstrcpy(colourBg.name, LPGENT("Background"));
	mir_strcpy(colourBg.dbSettingsGroup, MODULE);
	mir_strcpy(colourBg.setting, "ColourBg");
	colourBg.defcolour = RGB(219, 219, 219);
	colourBg.order = 0;
	ColourRegisterT(&colourBg);

	colourBorder.cbSize = sizeof(ColourIDT);
	mir_tstrcpy(colourBorder.group, LPGENT("Tooltips"));
	mir_tstrcpy(colourBorder.name, LPGENT("Border"));
	mir_strcpy(colourBorder.dbSettingsGroup, MODULE);
	mir_strcpy(colourBorder.setting, "BorderCol");
	colourBorder.defcolour = 0;
	colourBorder.order = 0;
	ColourRegisterT(&colourBorder);

	colourAvatarBorder.cbSize = sizeof(ColourIDT);
	mir_tstrcpy(colourAvatarBorder.group, LPGENT("Tooltips"));
	mir_tstrcpy(colourAvatarBorder.name, LPGENT("Avatar border"));
	mir_strcpy(colourAvatarBorder.dbSettingsGroup, MODULE);
	mir_strcpy(colourAvatarBorder.setting, "AvBorderCol");
	colourAvatarBorder.defcolour = 0;
	colourAvatarBorder.order = 0;
	ColourRegisterT(&colourAvatarBorder);

	colourDivider.cbSize = sizeof(ColourIDT);
	mir_tstrcpy(colourDivider.group, LPGENT("Tooltips"));
	mir_tstrcpy(colourDivider.name, LPGENT("Dividers"));
	mir_strcpy(colourDivider.dbSettingsGroup, MODULE);
	mir_strcpy(colourDivider.setting, "DividerCol");
	colourDivider.defcolour = 0;
	colourDivider.order = 0;
	ColourRegisterT(&colourDivider);

	colourSidebar.cbSize = sizeof(ColourIDT);
	mir_tstrcpy(colourSidebar.group, LPGENT("Tooltips"));
	mir_tstrcpy(colourSidebar.name, LPGENT("Sidebar"));
	mir_strcpy(colourSidebar.dbSettingsGroup, MODULE);
	mir_strcpy(colourSidebar.setting, "SidebarCol");
	colourSidebar.defcolour = RGB(192, 192, 192);
	colourSidebar.order = 0;
	ColourRegisterT(&colourSidebar);

	fontTitle.cbSize = sizeof(FontIDT);
	fontTitle.flags = FIDF_ALLOWEFFECTS;
	mir_tstrcpy(fontTitle.group, LPGENT("Tooltips"));
	mir_tstrcpy(fontTitle.name, LPGENT("Title"));
	mir_strcpy(fontTitle.dbSettingsGroup, MODULE);
	mir_strcpy(fontTitle.prefix, "FontFirst");
	mir_tstrcpy(fontTitle.backgroundGroup, LPGENT("Tooltips"));
	mir_tstrcpy(fontTitle.backgroundName, LPGENT("Background"));
	fontTitle.order = 0;

	fontTitle.deffontsettings.charset = DEFAULT_CHARSET;
	fontTitle.deffontsettings.size = -14;
	fontTitle.deffontsettings.style = DBFONTF_BOLD;
	fontTitle.deffontsettings.colour = RGB(255, 0, 0);
	fontTitle.flags |= FIDF_DEFAULTVALID;

	fontLabels.cbSize = sizeof(FontIDT);
	fontLabels.flags = FIDF_ALLOWEFFECTS;
	mir_tstrcpy(fontLabels.group, LPGENT("Tooltips"));
	mir_tstrcpy(fontLabels.name, LPGENT("Labels"));
	mir_strcpy(fontLabels.dbSettingsGroup, MODULE);
	mir_strcpy(fontLabels.prefix, "FontLabels");
	mir_tstrcpy(fontLabels.backgroundGroup, LPGENT("Tooltips"));
	mir_tstrcpy(fontLabels.backgroundName, LPGENT("Background"));
	fontLabels.order = 1;

	fontLabels.deffontsettings.charset = DEFAULT_CHARSET;
	fontLabels.deffontsettings.size = -12;
	fontLabels.deffontsettings.style = DBFONTF_ITALIC;
	fontLabels.deffontsettings.colour = RGB(128, 128, 128);
	fontLabels.flags |= FIDF_DEFAULTVALID;

	fontValues.cbSize = sizeof(FontIDT);
	fontValues.flags = FIDF_ALLOWEFFECTS;
	mir_tstrcpy(fontValues.group, LPGENT("Tooltips"));
	mir_tstrcpy(fontValues.name, LPGENT("Values"));
	mir_strcpy(fontValues.dbSettingsGroup, MODULE);
	mir_strcpy(fontValues.prefix, "FontValues");
	mir_tstrcpy(fontValues.backgroundGroup, LPGENT("Tooltips"));
	mir_tstrcpy(fontValues.backgroundName, LPGENT("Background"));
	fontValues.order = 2;

	fontValues.deffontsettings.charset = DEFAULT_CHARSET;
	fontValues.deffontsettings.size = -12;
	fontValues.deffontsettings.style = 0;
	fontValues.deffontsettings.colour = RGB(0, 0, 0);
	fontValues.flags |= FIDF_DEFAULTVALID;

	fontTrayTitle.cbSize = sizeof(FontIDT);
	fontTrayTitle.flags = FIDF_ALLOWEFFECTS;
	mir_tstrcpy(fontTrayTitle.group, LPGENT("Tooltips"));
	mir_tstrcpy(fontTrayTitle.name, LPGENT("Tray title"));
	mir_strcpy(fontTrayTitle.dbSettingsGroup, MODULE);
	mir_strcpy(fontTrayTitle.prefix, "FontTrayTitle");
	mir_tstrcpy(fontTrayTitle.backgroundGroup, LPGENT("Tooltips"));
	mir_tstrcpy(fontTrayTitle.backgroundName, LPGENT("Background"));
	fontTrayTitle.order = 0;

	fontTrayTitle.deffontsettings.charset = DEFAULT_CHARSET;
	fontTrayTitle.deffontsettings.size = -14;
	fontTrayTitle.deffontsettings.style = DBFONTF_BOLD;
	fontTrayTitle.deffontsettings.colour = RGB(0, 0, 0);
	fontTrayTitle.flags |= FIDF_DEFAULTVALID;

	FontRegisterT(&fontTitle);
	FontRegisterT(&fontLabels);
	FontRegisterT(&fontValues);
	FontRegisterT(&fontTrayTitle);

	hReloadFonts = HookEvent(ME_FONT_RELOAD, ReloadFont);
}
예제 #11
0
void RegisterFontServiceFonts()
{
    char szTemp[100];
    LOGFONT lf;
    FontIDT fid = { 0 };
    ColourIDT cid = { 0 };

    fid.cbSize = sizeof(FontIDT);
    cid.cbSize = sizeof(ColourIDT);

    strncpy(fid.dbSettingsGroup, FONTMODULE, _countof(fid.dbSettingsGroup));

    for (int i = 0; i < _countof(IM_fontOptionsList); i++) {
        fid.flags = FIDF_DEFAULTVALID | FIDF_ALLOWEFFECTS;
        LoadMsgDlgFont(FONTSECTION_IM, i, &lf, &fontOptionsList[i].colour, FONTMODULE);
        mir_snprintf(szTemp, "Font%d", i);
        strncpy(fid.prefix, szTemp, _countof(fid.prefix));
        fid.order = i;
        _tcsncpy(fid.name, fontOptionsList[i].szDescr, _countof(fid.name));
        fid.deffontsettings.colour = fontOptionsList[i].colour;
        fid.deffontsettings.size = (char)lf.lfHeight;
        fid.deffontsettings.style = (lf.lfWeight >= FW_BOLD ? FONTF_BOLD : 0) | (lf.lfItalic ? FONTF_ITALIC : 0);
        fid.deffontsettings.charset = lf.lfCharSet;
        fid.flags = fid.flags & ~FIDF_CLASSMASK | (fid.deffontsettings.style&FONTF_BOLD ? FIDF_CLASSHEADER : FIDF_CLASSGENERAL);
        _tcsncpy(fid.deffontsettings.szFace, lf.lfFaceName, LF_FACESIZE);
        _tcsncpy(fid.backgroundGroup, LPGENT("Message Sessions") _T("/") LPGENT("Single Messaging"), _countof(fid.backgroundGroup));
        _tcsncpy(fid.group, LPGENT("Message Sessions") _T("/") LPGENT("Single Messaging"), _countof(fid.group));
        switch (i) {
        case MSGFONTID_MYMSG:
        case 1:
        case MSGFONTID_MYNAME:
        case MSGFONTID_MYTIME:
        case 21:
            _tcsncpy(fid.backgroundName, LPGENT("Outgoing background"), _countof(fid.backgroundName));
            break;
        case 8:
        case 9:
        case 12:
        case 13:
            _tcsncpy(fid.backgroundName, LPGENT("Outgoing background(old)"), _countof(fid.backgroundName));
            break;
        case 10:
        case 11:
        case 14:
        case 15:
            _tcsncpy(fid.backgroundName, LPGENT("Incoming background(old)"), _countof(fid.backgroundName));
            break;
        case MSGFONTID_MESSAGEAREA:
            _tcsncpy(fid.group, LPGENT("Message Sessions"), _countof(fid.group));
            _tcsncpy(fid.backgroundGroup, LPGENT("Message Sessions"), _countof(fid.backgroundGroup));
            _tcsncpy(fid.backgroundName, LPGENT("Input area background"), _countof(fid.backgroundName));
            fid.flags |= FIDF_DISABLESTYLES;
            fid.flags &= ~FIDF_ALLOWEFFECTS;
            break;
        case 17:
            _tcsncpy(fid.backgroundName, LPGENT("Status background"), _countof(fid.backgroundName));
            break;
        case 18:
            _tcsncpy(fid.backgroundGroup, LPGENT("Message Sessions"), _countof(fid.backgroundGroup));
            _tcsncpy(fid.backgroundName, LPGENT("Log background"), _countof(fid.backgroundName));
            break;
        case 19:
            _tcsncpy(fid.backgroundName, _T(""), _countof(fid.backgroundName));
            break;
        default:
            _tcsncpy(fid.backgroundName, LPGENT("Incoming background"), _countof(fid.backgroundName));
            break;
        }
        FontRegisterT(&fid);
    }

    fontOptionsList = IP_fontOptionsList;
    fid.flags = FIDF_DEFAULTVALID | FIDF_ALLOWEFFECTS;
    _tcsncpy(fid.group, LPGENT("Message Sessions") _T("/") LPGENT("Info Panel"), _countof(fid.group));
    _tcsncpy(fid.backgroundGroup, LPGENT("Message Sessions") _T("/") LPGENT("Info Panel"), _countof(fid.backgroundGroup));
    _tcsncpy(fid.backgroundName, LPGENT("Fields background"), _countof(fid.backgroundName));
    for (int i = 0; i < IPFONTCOUNT; i++) {
        LoadMsgDlgFont(FONTSECTION_IP, i + 100, &lf, &fontOptionsList[i].colour, FONTMODULE);
        mir_snprintf(szTemp, "Font%d", i + 100);
        strncpy(fid.prefix, szTemp, _countof(fid.prefix));
        fid.order = i + 100;
        _tcsncpy(fid.name, fontOptionsList[i].szDescr, _countof(fid.name));
        fid.deffontsettings.colour = fontOptionsList[i].colour;
        fid.deffontsettings.size = (char)lf.lfHeight;
        fid.deffontsettings.style = (lf.lfWeight >= FW_BOLD ? FONTF_BOLD : 0) | (lf.lfItalic ? FONTF_ITALIC : 0);
        fid.deffontsettings.charset = lf.lfCharSet;
        fid.flags = fid.flags & ~FIDF_CLASSMASK | (fid.deffontsettings.style&FONTF_BOLD ? FIDF_CLASSHEADER : FIDF_CLASSGENERAL);
        fid.deffontsettings.charset = lf.lfCharSet;
        _tcsncpy(fid.deffontsettings.szFace, lf.lfFaceName, LF_FACESIZE);
        if (i == IPFONTCOUNT - 1) {
            _tcsncpy(fid.backgroundGroup, _T(""), _countof(fid.backgroundGroup));
            _tcsncpy(fid.backgroundName, _T(""), _countof(fid.backgroundName));
            _tcsncpy(fid.group, LPGENT("Message Sessions"), _countof(fid.group));
        }
        FontRegisterT(&fid);
    }

    _tcsncpy(cid.group, LPGENT("Message Sessions") _T("/") LPGENT("Group chats"), _countof(cid.group));
    strncpy(cid.dbSettingsGroup, CHAT_MODULE, _countof(cid.dbSettingsGroup));
    for (int i = 0; i <= 7; i++) {
        mir_snprintf(szTemp, "NickColor%d", i);
        _tcsncpy(cid.name, chatcolorsnames[i], _countof(cid.name));
        cid.order = i + 1;
        strncpy(cid.setting, szTemp, _countof(cid.setting));
        switch (i) {
        case 5:
            cid.defcolour = GetSysColor(COLOR_HIGHLIGHT);
            break;
        case 6:
            cid.defcolour = GetSysColor(COLOR_HIGHLIGHTTEXT);
            break;
        default:
            cid.defcolour = RGB(0, 0, 0);
            break;
        }
        ColourRegisterT(&cid);
    }
    cid.order++;
    _tcsncpy_s(cid.name, LPGENT("Nick list background"), _TRUNCATE);
    strncpy_s(cid.setting, "ColorNicklistBG", _TRUNCATE);
    cid.defcolour = SRMSGDEFSET_BKGCOLOUR;
    ColourRegisterT(&cid);

    cid.order++;
    _tcsncpy_s(cid.name, LPGENT("Group chat log background"), _TRUNCATE);
    strncpy_s(cid.setting, "ColorLogBG", _TRUNCATE);
    ColourRegisterT(&cid);

    // static colors (info panel, tool bar background etc...)
    strncpy(fid.dbSettingsGroup, FONTMODULE, _countof(fid.dbSettingsGroup));
    strncpy(cid.dbSettingsGroup, FONTMODULE, _countof(fid.dbSettingsGroup));

    for (int i = 0; i < _countof(_clrs); i++) {
        cid.order = _clrs[i].order;
        _tcsncpy(cid.group, _clrs[i].tszGroup, _countof(fid.group));
        _tcsncpy(cid.name, _clrs[i].tszName, _countof(cid.name));
        strncpy(cid.setting, _clrs[i].szSetting, _countof(cid.setting));
        if (_clrs[i].def & 0xff000000)
            cid.defcolour = GetSysColor(_clrs[i].def & 0x000000ff);
        else
            cid.defcolour = _clrs[i].def;
        ColourRegisterT(&cid);
    }

    strncpy(cid.dbSettingsGroup, SRMSGMOD_T, _countof(fid.dbSettingsGroup));

    // text and background colors for tabs
    for (int i = 0; i < _countof(_tabclrs); i++) {
        cid.order = _tabclrs[i].order;
        _tcsncpy(cid.group, _tabclrs[i].tszGroup, _countof(fid.group));
        _tcsncpy(cid.name, _tabclrs[i].tszName, _countof(cid.name));
        strncpy(cid.setting, _tabclrs[i].szSetting, _countof(cid.setting));
        if (_tabclrs[i].def & 0xff000000)
            cid.defcolour = GetSysColor(_tabclrs[i].def & 0x000000ff);
        else
            cid.defcolour = _tabclrs[i].def;

        ColourRegisterT(&cid);
    }
}