Example #1
0
int ModulesLoaded(WPARAM, LPARAM)
{
    MNotifyGetLink();

    if (ServiceExists(MS_HPP_EG_WINDOW))
        lstPopupHistory.SetRenderer(RENDER_HISTORYPP);

    HookEvent(ME_FONT_RELOAD, ReloadFont);
    HookEvent(ME_TTB_MODULELOADED, TTBLoaded);

    LoadModuleDependentOptions();

    if (GetModuleHandle(_T("neweventnotify")))
        ignore_gpd_passed_addy = true;

    return 0;
}
Example #2
0
int ModulesLoaded(WPARAM wParam, LPARAM lParam) {
	MNotifyGetLink();

	if (ServiceExists(MS_HPP_EG_WINDOW))
	{
		lstPopupHistory.SetRenderer(RENDER_HISTORYPP);
	}

	if(ServiceExists(MS_UPDATE_REGISTER)) {
		// register with updater
		Update update = {0};
		char szVersion[16];

		update.cbSize = sizeof(Update);

		update.szComponentName = pluginInfo.shortName;
		update.pbVersion = (BYTE *)CreateVersionString(pluginInfo.version, szVersion);
		update.cpbVersion = (int)strlen((char *)update.pbVersion);
		update.szBetaChangelogURL = "https://server.scottellis.com.au/wsvn/mim_plugs/yapp/?op=log&rev=0&sc=0&isdir=1";

		update.szUpdateURL = UPDATER_AUTOREGISTER;
		
		// these are the three lines that matter - the archive, the page containing the version string, and the text (or data) 
		// before the version that we use to locate it on the page
		// (note that if the update URL and the version URL point to standard file listing entries, the backend xml
		// data will be used to check for updates rather than the actual web page - this is not true for beta urls)
#ifdef _WIN64
		update.szBetaUpdateURL = "http://www.scottellis.com.au/miranda_plugins/yapp_x64.zip";
#endif
		update.szBetaVersionURL = "http://www.scottellis.com.au/miranda_plugins/ver_yapp.html";
		update.pbBetaVersionPrefix = (BYTE *)"YAPP version ";
		
		update.cpbBetaVersionPrefix = (int)strlen((char *)update.pbBetaVersionPrefix);

		CallService(MS_UPDATE_REGISTER, 0, (WPARAM)&update);
	}

#ifdef _UNICODE
	if(ServiceExists(MS_FONT_REGISTERW)) 
	{
		font_id_firstlinew.cbSize = sizeof(FontIDW);
		font_id_firstlinew.flags = FIDF_ALLOWEFFECTS;
		_tcscpy(font_id_firstlinew.group, _T("Popups"));
		_tcscpy(font_id_firstlinew.name, _T("First line"));
		strcpy(font_id_firstlinew.dbSettingsGroup, MODULE);
		strcpy(font_id_firstlinew.prefix, "FontFirst");
		font_id_firstlinew.order = 0;

		font_id_secondlinew.cbSize = sizeof(FontIDW);
		font_id_secondlinew.flags = FIDF_ALLOWEFFECTS;
		_tcscpy(font_id_secondlinew.group, _T("Popups"));
		_tcscpy(font_id_secondlinew.name, _T("Second line"));
		strcpy(font_id_secondlinew.dbSettingsGroup, MODULE);
		strcpy(font_id_secondlinew.prefix, "FontSecond");
		font_id_secondlinew.order = 1;

		font_id_timew.cbSize = sizeof(FontIDW);
		font_id_timew.flags = FIDF_ALLOWEFFECTS;
		_tcscpy(font_id_timew.group, _T("Popups"));
		_tcscpy(font_id_timew.name, _T("Time"));
		strcpy(font_id_timew.dbSettingsGroup, MODULE);
		strcpy(font_id_timew.prefix, "FontTime");
		font_id_timew.order = 2;

		CallService(MS_FONT_REGISTERW, (WPARAM)&font_id_firstlinew, 0);
		CallService(MS_FONT_REGISTERW, (WPARAM)&font_id_secondlinew, 0);
		CallService(MS_FONT_REGISTERW, (WPARAM)&font_id_timew, 0);
		
		colour_id_bgw.cbSize = sizeof(ColourIDW);
		_tcscpy(colour_id_bgw.group, _T("Popups"));
		_tcscpy(colour_id_bgw.name, _T("Background"));
		strcpy(colour_id_bgw.dbSettingsGroup, MODULE);
		strcpy(colour_id_bgw.setting, "ColourBg");
		colour_id_bgw.defcolour = GetSysColor(COLOR_3DSHADOW);
		colour_id_bgw.order = 0;

		colour_id_borderw.cbSize = sizeof(ColourIDW);
		_tcscpy(colour_id_borderw.group, _T("Popups"));
		_tcscpy(colour_id_borderw.name, _T("Border"));
		strcpy(colour_id_borderw.dbSettingsGroup, MODULE);
		strcpy(colour_id_borderw.setting, "ColourBorder");
		colour_id_borderw.defcolour = RGB(0, 0, 0);
		colour_id_borderw.order = 1;

		colour_id_sidebarw.cbSize = sizeof(ColourIDW);
		_tcscpy(colour_id_sidebarw.group, _T("Popups"));
		_tcscpy(colour_id_sidebarw.name, _T("Sidebar"));
		strcpy(colour_id_sidebarw.dbSettingsGroup, MODULE);
		strcpy(colour_id_sidebarw.setting, "ColourSidebar");
		colour_id_sidebarw.defcolour = RGB(128, 128, 128);
		colour_id_sidebarw.order = 2;

		colour_id_titleunderlinew.cbSize = sizeof(ColourIDW);
		_tcscpy(colour_id_titleunderlinew.group, _T("Popups"));
		_tcscpy(colour_id_titleunderlinew.name, _T("Title underline"));
		strcpy(colour_id_titleunderlinew.dbSettingsGroup, MODULE);
		strcpy(colour_id_titleunderlinew.setting, "ColourTitleUnderline");
		colour_id_titleunderlinew.defcolour = GetSysColor(COLOR_3DSHADOW);
		colour_id_titleunderlinew.order = 3;

		CallService(MS_COLOUR_REGISTERW, (WPARAM)&colour_id_bgw, 0);
		CallService(MS_COLOUR_REGISTERW, (WPARAM)&colour_id_borderw, 0);
		CallService(MS_COLOUR_REGISTERW, (WPARAM)&colour_id_sidebarw, 0);
		CallService(MS_COLOUR_REGISTERW, (WPARAM)&colour_id_titleunderlinew, 0);
		
		ReloadFont(0, 0);

		hEventReloadFont = HookEvent(ME_FONT_RELOAD, ReloadFont);
	} 
	else 
#endif
		if(ServiceExists(MS_FONT_REGISTER)) 
	{
		font_id_firstline.cbSize = sizeof(FontID);
		font_id_firstline.flags = FIDF_ALLOWEFFECTS;
		strcpy(font_id_firstline.group, "Popups");
		strcpy(font_id_firstline.name, "First line");
		strcpy(font_id_firstline.dbSettingsGroup, MODULE);
		strcpy(font_id_firstline.prefix, "FontFirst");
		font_id_firstline.order = 0;

		font_id_secondline.cbSize = sizeof(FontID);
		font_id_secondline.flags = FIDF_ALLOWEFFECTS;
		strcpy(font_id_secondline.group, "Popups");
		strcpy(font_id_secondline.name, "Second line");
		strcpy(font_id_secondline.dbSettingsGroup, MODULE);
		strcpy(font_id_secondline.prefix, "FontSecond");
		font_id_secondline.order = 1;

		font_id_time.cbSize = sizeof(FontID);
		font_id_time.flags = FIDF_ALLOWEFFECTS;
		strcpy(font_id_time.group, "Popups");
		strcpy(font_id_time.name, "Time");
		strcpy(font_id_time.dbSettingsGroup, MODULE);
		strcpy(font_id_time.prefix, "FontTime");
		font_id_time.order = 2;

		CallService(MS_FONT_REGISTER, (WPARAM)&font_id_firstline, 0);
		CallService(MS_FONT_REGISTER, (WPARAM)&font_id_secondline, 0);
		CallService(MS_FONT_REGISTER, (WPARAM)&font_id_time, 0);
		
		colour_id_bg.cbSize = sizeof(ColourID);
		strcpy(colour_id_bg.group, "Popups");
		strcpy(colour_id_bg.name, "Background");
		strcpy(colour_id_bg.dbSettingsGroup, MODULE);
		strcpy(colour_id_bg.setting, "ColourBg");
		colour_id_bg.defcolour = GetSysColor(COLOR_3DSHADOW);
		colour_id_bg.order = 0;

		colour_id_border.cbSize = sizeof(ColourID);
		strcpy(colour_id_border.group, "Popups");
		strcpy(colour_id_border.name, "Border");
		strcpy(colour_id_border.dbSettingsGroup, MODULE);
		strcpy(colour_id_border.setting, "ColourBorder");
		colour_id_border.defcolour = RGB(0, 0, 0);
		colour_id_border.order = 1;

		colour_id_sidebar.cbSize = sizeof(ColourID);
		strcpy(colour_id_sidebar.group, "Popups");
		strcpy(colour_id_sidebar.name, "Sidebar");
		strcpy(colour_id_sidebar.dbSettingsGroup, MODULE);
		strcpy(colour_id_sidebar.setting, "ColourSidebar");
		colour_id_sidebar.defcolour = RGB(128, 128, 128);
		colour_id_sidebar.order = 2;

		colour_id_titleunderline.cbSize = sizeof(ColourID);
		strcpy(colour_id_titleunderline.group, "Popups");
		strcpy(colour_id_titleunderline.name, "Title underline");
		strcpy(colour_id_titleunderline.dbSettingsGroup, MODULE);
		strcpy(colour_id_titleunderline.setting, "ColourTitleUnderline");
		colour_id_titleunderline.defcolour = GetSysColor(COLOR_3DSHADOW);
		colour_id_titleunderline.order = 3;

		CallService(MS_COLOUR_REGISTER, (WPARAM)&colour_id_bg, 0);
		CallService(MS_COLOUR_REGISTER, (WPARAM)&colour_id_border, 0);
		CallService(MS_COLOUR_REGISTER, (WPARAM)&colour_id_sidebar, 0);
		CallService(MS_COLOUR_REGISTER, (WPARAM)&colour_id_titleunderline, 0);
		
		ReloadFont(0, 0);

		hEventReloadFont = HookEvent(ME_FONT_RELOAD, ReloadFont);
	} else {
		LOGFONT lf = {0};
		lf.lfCharSet = DEFAULT_CHARSET;
		lf.lfHeight = -14;
		lf.lfWeight = FW_BOLD;
		hFontFirstLine = CreateFontIndirect(&lf);

		lf.lfHeight = -12;
		lf.lfWeight = 0;
		hFontSecondLine = CreateFontIndirect(&lf);

		lf.lfHeight = -8;
		lf.lfWeight = 0;
		hFontTime = CreateFontIndirect(&lf);
	}
	
	LoadModuleDependentOptions(); 

	if(GetModuleHandle(_T("neweventnotify")))
	{
		ignore_gpd_passed_addy = true;
	}

	return 0;
}