Exemple #1
0
//menu
//Function which makes the initializations
static int ModulesLoaded(WPARAM,LPARAM)
{
    //check if History++ is installed
    gbHppInstalled = ServiceExists(MS_HPP_GETVERSION) && ServiceExists(MS_HPP_EG_WINDOW) &&
                     (CallService(MS_HPP_GETVERSION, 0, 0) >= PLUGIN_MAKE_VERSION(1,5,0,112));
    //check if MText plugin is installed
    if (MText.Register) {
        htuText = MText.Register("Popup Plus/Text", MTEXT_FANCY_DEFAULT);
        htuTitle	= MText.Register("Popup Plus/Title",MTEXT_FANCY_DEFAULT);
    }
    else htuTitle = htuText = NULL;

    // init meta contacts
    INT_PTR ptr = CallService(MS_MC_GETPROTOCOLNAME, 0, 0);
    if (ptr != CALLSERVICE_NOTFOUND)
        gszMetaProto = (LPCSTR)ptr;

    //check if OptionLoaded
    if (!OptionLoaded)
        LoadOptions();

    //Uninstalling purposes
    if (ServiceExists("PluginSweeper/Add"))
        CallService("PluginSweeper/Add", (WPARAM)Translate(MODULNAME), (LPARAM)MODULNAME);

    //load fonts / create hook
    InitFonts();
    HookEvent(ME_FONT_RELOAD, FontsChanged);

    //load actions and notifications
    LoadActions();
    LoadNotifications();
    //hook TopToolBar
    HookEvent(ME_TTB_MODULELOADED, TTBLoaded);
    //Folder plugin support
    folderId = FoldersRegisterCustomPathT(LPGEN("Skins"), LPGEN("Popup Plus"), MIRANDA_PATHT _T("\\Skins\\Popup"));
    //load skin
    skins.load(_T("dir"));
    const PopupSkin *skin;
    if (skin = skins.getSkin(PopupOptions.SkinPack)) {
        mir_free(PopupOptions.SkinPack);
        PopupOptions.SkinPack = mir_tstrdup(skin->getName());
        skin->loadOpts();
    }
    //init PopupEfects
    PopupEfectsInitialize();
    //MessageAPI support
    SrmmMenu_Load();
    //Hotkey
    LoadHotkey();

    gbPopupLoaded = TRUE;
    return 0;
}
Exemple #2
0
//menu
//Function which makes the initializations
static int ModulesLoaded(WPARAM wParam,LPARAM lParam)
{
	//check if 'Icon Library Manager' and 'FontService' exist (load icon and font later)
	if (!ServiceExists(MS_FONT_REGISTER) || !ServiceExists(MS_SKIN2_ADDICON)) {
		LPTSTR msg = TranslateTS(
			_T("This version of Popup Plus requires\r\n")
			_T("'Icon Library Manager' and 'FontService'\r\n")
			_T("modules.\r\n")
			_T("\r\n")
			_T("You always can download them at\r\n")
			_T("http://addons.miranda-im.org/\r\n")
			_T("\r\n")
			_T("Do you want to visit Miranda IM homepage now?\r\n") );
		if (MessageBox(NULL, msg, _T("Popup Plus Error"), MB_YESNO|MB_ICONSTOP) == IDYES)
			ShellExecute(NULL, _T("open"), _T("http://addons.miranda-im.org/"), NULL, NULL, SW_SHOWNORMAL);
		return 0;
	}

	//check if History++ is installed
	gbHppInstalled = ServiceExists(MS_HPP_GETVERSION) && ServiceExists(MS_HPP_EG_WINDOW) &&
		(CallService(MS_HPP_GETVERSION, 0, 0) >= PLUGIN_MAKE_VERSION(1,5,0,112));
	//check if MText plugin is installed
	if (MText.Register) {
		htuText		= MText.Register("PopUp Plus/Text", MTEXT_FANCY_DEFAULT);
		htuTitle	= MText.Register("PopUp Plus/Title",MTEXT_FANCY_DEFAULT);
	}
	else {
		htuTitle = htuText = NULL;
	}
	// init meta contacts
	INT_PTR ptr = CallService(MS_MC_GETPROTOCOLNAME, 0, 0);
	if (ptr != CALLSERVICE_NOTFOUND) {
		gszMetaProto = (LPCSTR)ptr;
	}

	//check if OptionLoaded
	if(!OptionLoaded){
		LoadOptions();
	}
/*/deprecatet stuff
	notifyLink = ServiceExists(MS_NOTIFY_GETLINK) ? (MNOTIFYLINK *)CallService(MS_NOTIFY_GETLINK, 0, 0) : NULL;
	LoadNotifyImp();
	hNotifyOptionsInitialize = HookEvent(ME_NOTIFY_OPT_INITIALISE, NotifyOptionsInitialize);

	HookEvent(ME_CONTACTSETTINGS_INITIALISE, ContactSettingsInitialise);
*/
	//Uninstalling purposes
	if (ServiceExists("PluginSweeper/Add")) {
		CallService("PluginSweeper/Add",(WPARAM)Translate(MODULNAME),(LPARAM)MODULNAME);
	}
	//load fonts / create hook
	InitFonts();
	hFontsChanged = HookEvent(ME_FONT_RELOAD,FontsChanged);

	//load actions and notifications
	LoadActions();
	LoadNotifications();
	//hook TopToolBar
	hTTBLoaded = HookEvent(ME_TTB_MODULELOADED, TTBLoaded);
	//Folder plugin support
	LPTSTR pszPath = mir_a2t(MIRANDA_PATH "\\Skins\\PopUp");
	folderId = FoldersRegisterCustomPathT(MODULNAME_LONG, "Skins", pszPath);
	mir_free(pszPath);
	//load skin
	skins.load(_T("dir"));
	const PopupSkin *skin;
	if (skin = skins.getSkin(PopUpOptions.SkinPack)) {
		mir_free(PopUpOptions.SkinPack);
		PopUpOptions.SkinPack = mir_tstrdup(skin->getName());
		skin->loadOpts();
	}
	//init PopupEfects
	PopupEfectsInitialize();
	//MessageAPI support
	SrmmMenu_Load();
	//Hotkey
	LoadHotkey();
	//Modern Toolbar support
	if(ServiceExists(MS_TB_ADDBUTTON)) {
		hTBLoaded = HookEvent(ME_TB_MODULELOADED, ToolbarSet);
		ToolbarSet(0,0);
	}
	//Updater support
	if(ServiceExists(MS_UPDATE_REGISTER)) registerUpdate();

	gbPopupLoaded = TRUE;
	return 0;
}