Esempio n. 1
0
int RegisterPlugin::pluginDataFromGdb(struct UIdebugger_struct * debugger_struct)
{
	// TODO
	// insert here your switch(debugger_struct->iPluginCommand)

	// update register
	switch(debugger_struct->iPluginCommand)
	{
		case GET_REGISTER_VALUE:
		{
			// update QTableWidgetEx view
			if(debugger_struct->qsDataFromGdb.contains("eax"))
			{
				if(registerShowAll(debugger_struct->qsDataFromGdb))
					registerUpdate(debugger_struct->qsDataFromGdb);
				bNotify = false;
				return PLUGIN_TERMINED;
			}
			return PLUGIN_WAIT;
		}

		case SET_REGISTER_VALUE:	// user have change value of register
			return PLUGIN_NOTIFY;	// well notify all plug (and this plug !)

	}

	// TODO
	// insert here your  switch(debugger_struct->iCurrentCommand)
	
	// this plug ask values register when GDB is in breakpoint, next step , ....
	switch(debugger_struct->iCurrentCommand)
	{
		case DEBUGGER_NOTIFY:
			bNotify = true;	// just for change color of text
		case DEBUGGER_ON_BREAKPOINT:
		case DEBUGGER_STEP_OVER:
		case DEBUGGER_STEP_INTO:
		{
			debugger_struct_out.qsCurrentCommand.clear();
			//command send to GDB
			debugger_struct_out.qsCurrentCommand = "info register";//\n";
			// for GDB
			debugger_struct_out.iCurrentCommandType = PLUGIN_TO_GDB;
			// define user
			debugger_struct_out.iPluginCommand = GET_REGISTER_VALUE;
			// send command
			emit signalPluginAction(this, &debugger_struct_out);
			// end return 
			return PLUGIN_SEND_COMMAND;		
		}
	}
	// other plug termined
	return PLUGIN_TERMINED;
}
Esempio n. 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;
}
Esempio n. 3
0
void registerHandleEvents(SDL_Event *event){
	if(event->type == SDL_KEYDOWN){
		if(event->key.keysym.sym == SDLK_LSHIFT || event->key.keysym.sym == SDLK_RSHIFT){
			shiftDown = true;
		}
		if(event->key.keysym.sym == SDLK_TAB){
			if(shiftDown)
				regSelectionIdx--;
			else
				regSelectionIdx++;
		}
		if(event->key.keysym.sym == SDLK_DOWN){
			if(regSelectionIdx!=4) regSelectionIdx++;
		}
		if(event->key.keysym.sym == SDLK_UP){
			if(regSelectionIdx!=0) regSelectionIdx--;
		}
		regSelectionIdx = (regSelectionIdx + 5) % 5;		
		
		if(regSelectionIdx < 4){
			string temp = regData[regSelectionIdx];

			if(temp.size()<20 && (event->key.keysym.unicode >= (Uint16)' '))
				regData[regSelectionIdx] += (char)event->key.keysym.unicode;
			if((event->key.keysym.sym == SDLK_BACKSPACE)&&(regData[regSelectionIdx].size() != 0 ))
				regData[regSelectionIdx].erase( regData[regSelectionIdx].length() - 1 );
				
			if(regData[regSelectionIdx] != temp){
				string tmp;
				for(size_t i=0;i<regData[1].size();i++)
					tmp += '*';
				registerUpdate(regData[0],tmp,regData[2],regData[3],"Registrarse", "Registro");
			}
		}
	}
	if(event->type == SDL_KEYUP){
		if(event->key.keysym.sym == SDLK_LSHIFT || event->key.keysym.sym == SDLK_RSHIFT){
			shiftDown = false;
		}
		if(event->key.keysym.sym == SDLK_RETURN ||
		   event->key.keysym.sym == SDLK_KP_ENTER){
			registerSubmit();
		}
	}
	if(event->type == SDL_MOUSEBUTTONDOWN){
		int dx = event->button.x - 1024/2+256/2;
		int dy = event->button.y - 768/2+256/2;
		if(dx>83 && dy>43 && dx<244 && dy<67){
			regSelectionIdx = 0;
			
		}
		if(dx>83 && dy>86 && dx<244 && dy<110){
			regSelectionIdx = 1;
			
		}
		if(dx>83 && dy>129 && dx<244 && dy<153){
			regSelectionIdx = 2;
			
		}					
		if(dx>83 && dy>172 && dx<244 && dy<196){
			regSelectionIdx = 3;
			
		}	
		if(dx>93 && dy>223 && dx<163 && dy<244){
			regSelectionIdx = 4;
			
		}						
	}
	if(event->type == SDL_MOUSEBUTTONUP){
		int dx = event->button.x - 1024/2+256/2;
		int dy = event->button.y - 768/2+256/2;
		if(dx>93 && dy>223 && dx<163 && dy<244 && regSelectionIdx == 4){
			registerSubmit();
		}	
	}
}