Example #1
0
// interface
void LoadActions()
{
	POPUPACTION actions[] =
	{
		{ sizeof(POPUPACTION), IcoLib_GetIcon(ICO_ACT_REPLY,0),		"General/Quick reply",			0},
		{ sizeof(POPUPACTION), IcoLib_GetIcon(ICO_ACT_MESS,0),		"General/Send message",			0},
		{ sizeof(POPUPACTION), IcoLib_GetIcon(ICO_ACT_INFO,0),		"General/User details",			0},
		{ sizeof(POPUPACTION), IcoLib_GetIcon(ICO_ACT_MENU,0),		"General/Contact menu",			0},
		{ sizeof(POPUPACTION), IcoLib_GetIcon(ICO_ACT_ADD,0),		"General/Add permanently",		0},
		{ sizeof(POPUPACTION), IcoLib_GetIcon(ICO_ACT_PIN,0),		"General/Pin popup",			0},
		{ sizeof(POPUPACTION), IcoLib_GetIcon(ICO_ACT_CLOSE,0),		"General/Dismiss popup",		0},
		{ sizeof(POPUPACTION), IcoLib_GetIcon(ICO_ACT_COPY,0),		"General/Copy to clipboard",	0},

//remove popup action
	#if defined(_DEBUG)
		{ sizeof(POPUPACTION), IcoLib_GetIcon(ICO_POPUP_ON,0),		"Popup Plus/Test action",			PAF_ENABLED},
		{ sizeof(POPUPACTION), IcoLib_GetIcon(ICO_ACT_CLOSE,0),		"Popup Plus/Second test action",	0},
		{ sizeof(POPUPACTION), LoadSkinnedIcon(SKINICON_OTHER_MIRANDA),		"Popup Plus/One more action",		PAF_ENABLED},
	#endif

	};

	for (int i = 0; i < SIZEOF(actions); ++i)
		RegisterAction(&actions[i]);
}
Example #2
0
    void Entity::Exec(const QString &action, const QString &param1, const QString &param2)
    {
        Action *act = RegisterAction(action);
        if (!HasReceivers(act))
            return;

        act->Trigger(param1, param2);
    }
Example #3
0
    void Entity::Exec(const QString &action, const QString &param1, const QString &param2, const QString &param3)
    {
        Action *act = RegisterAction(action);
        int receivers = act->receivers(SIGNAL(Triggered(const QString &, const QString &, const QString &, const QStringVector &)));
        if (!HasReceivers(act))
            return;

        act->Trigger(param1, param2, param3);
    }
Example #4
0
    void Entity::Exec(const QString &action, const QStringVector &params)
    {
        Action *act = RegisterAction(action);
        if (!HasReceivers(act))
            return;

        if (params.size() == 0)
            act->Trigger();
        else if (params.size() == 1)
            act->Trigger(params[0]);
        else if (params.size() == 2)
            act->Trigger(params[0], params[1]);
        else if (params.size() == 3)
            act->Trigger(params[0], params[1], params[2]);
        else if (params.size() >= 4)
            act->Trigger(params[0], params[1], params[2], params.mid(3));
    }
Example #5
0
CKeyBindings::CKeyBindings()
{
	fakeMetaKey = -1;
	userCommand = true;

	statefulCommands.insert("drawinmap");
	statefulCommands.insert("moveforward");
	statefulCommands.insert("moveback");
	statefulCommands.insert("moveright");
	statefulCommands.insert("moveleft");
	statefulCommands.insert("moveup");
	statefulCommands.insert("movedown");
	statefulCommands.insert("moveslow");
	statefulCommands.insert("movefast");

	RegisterAction("bind");
	RegisterAction("unbind");
	RegisterAction("unbindall");
	RegisterAction("unbindkeyset");
	RegisterAction("unbindaction");
	RegisterAction("keydebug");
	RegisterAction("fakemeta");
	RegisterAction("keyload");
	RegisterAction("keyreload");
	RegisterAction("keysave");
	RegisterAction("keyprint");
	RegisterAction("keysyms");
	RegisterAction("keycodes");
}
Example #6
0
	ShortcutManager& ShortcutManager::operator<< (const QPair<QString, QAction*>& pair)
	{
		RegisterAction (pair.first, pair.second);
		return *this;
	}
Example #7
0
CKeyBindings::CKeyBindings()
    : fakeMetaKey(1)
    , buildHotkeyMap(true)
    , debugEnabled(false)
    , keyChainTimeout(750)
{
    statefulCommands.insert("drawinmap");
    statefulCommands.insert("moveforward");
    statefulCommands.insert("moveback");
    statefulCommands.insert("moveright");
    statefulCommands.insert("moveleft");
    statefulCommands.insert("moveup");
    statefulCommands.insert("movedown");
    statefulCommands.insert("moveslow");
    statefulCommands.insert("movefast");

    RegisterAction("bind");
    RegisterAction("unbind");
    RegisterAction("unbindall");
    RegisterAction("unbindkeyset");
    RegisterAction("unbindaction");
    RegisterAction("keydebug");
    RegisterAction("fakemeta");
    RegisterAction("keyload");
    RegisterAction("keyreload");
    RegisterAction("keysave");
    RegisterAction("keyprint");
    RegisterAction("keysyms");
    RegisterAction("keycodes");

    configHandler->NotifyOnChange(this);
}
CActionSelByRect::CActionSelByRect() : ISelectFeatureTool(actionSelectByRect)
{
	RegisterAction(actionSelectByRect,this);
}
Example #9
0
CCameraHandler::CCameraHandler()
{
	CreateGlobalCams();

	camTransState.startFOV  = 90.0f;
	camTransState.timeStart =  0.0f;
	camTransState.timeEnd   =  0.0f;

	// FPS camera must always be the first one in the list
	camControllers.resize(CAMERA_MODE_LAST, nullptr);
	camControllers[CAMERA_MODE_FIRSTPERSON] = new CFPSController();
	camControllers[CAMERA_MODE_OVERHEAD   ] = new COverheadController();
	camControllers[CAMERA_MODE_SPRING     ] = new CSpringController();
	camControllers[CAMERA_MODE_ROTOVERHEAD] = new CRotOverheadController();
	camControllers[CAMERA_MODE_FREE       ] = new CFreeController();
	camControllers[CAMERA_MODE_OVERVIEW   ] = new COverviewController();

	for (unsigned int i = 0; i < camControllers.size(); i++) {
		nameModeMap[camControllers[i]->GetName()] = i;
	}

	const std::string& modeName = configHandler->GetString("CamModeName");

	if (!modeName.empty()) {
		currCamCtrlNum = GetModeIndex(modeName);
	} else {
		currCamCtrlNum = configHandler->GetInt("CamMode");
	}

	camTransState.timeFactor   = configHandler->GetFloat("CamTimeFactor");
	camTransState.timeExponent = configHandler->GetFloat("CamTimeExponent");

	RegisterAction("viewfps");
	RegisterAction("viewta");
	RegisterAction("viewspring");
	RegisterAction("viewrot");
	RegisterAction("viewfree");
	RegisterAction("viewov");
	RegisterAction("viewtaflip");

	RegisterAction("toggleoverview");
	RegisterAction("togglecammode");

	RegisterAction("viewsave");
	RegisterAction("viewload");

	SetCameraMode(currCamCtrlNum);
}
CActionZoomActualSize::CActionZoomActualSize() : IAction(actionZoomActualSize)
{
	RegisterAction(actionZoomActualSize,this);
}
Example #11
0
CCameraHandler::CCameraHandler()
{
	cameraTime = 0.0f;
	cameraTimeLeft = 0.0f;

	// FPS camera must always be the first one in the list
	camControllers.resize(CAMERA_MODE_LAST);
	camControllers[CAMERA_MODE_FIRSTPERSON] = new CFPSController();
	camControllers[CAMERA_MODE_OVERHEAD   ] = new COverheadController();
	camControllers[CAMERA_MODE_TOTALWAR   ] = new CTWController();
	camControllers[CAMERA_MODE_ROTOVERHEAD] = new CRotOverheadController();
	camControllers[CAMERA_MODE_FREE       ] = new CFreeController();
	camControllers[CAMERA_MODE_SMOOTH     ] = new SmoothController();
	camControllers[CAMERA_MODE_ORBIT      ] = new COrbitController();
	camControllers[CAMERA_MODE_OVERVIEW   ] = new COverviewController();

	for (unsigned int i = 0; i < camControllers.size(); i++) {
		nameMap[camControllers[i]->GetName()] = i;
	}

	int modeIndex;
	const std::string modeName = configHandler->GetString("CamModeName", "");
	if (!modeName.empty()) {
		modeIndex = GetModeIndex(modeName);
	} else {
		modeIndex = configHandler->Get("CamMode", 5);
	}

	const unsigned int mode =
		(unsigned int)std::max(0, std::min(modeIndex, (int)camControllers.size() - 1));

	currCamCtrlNum = mode;
	currCamCtrl = camControllers[currCamCtrlNum];

	const double z = 0.0; // casting problems...
	cameraTimeFactor   = std::max(z, atof(configHandler->GetString("CamTimeFactor",   "1.0").c_str()));
	cameraTimeExponent = std::max(z, atof(configHandler->GetString("CamTimeExponent", "4.0").c_str()));

	RegisterAction("viewfps");
	RegisterAction("viewta");
	RegisterAction("viewtw");
	RegisterAction("viewrot");
	RegisterAction("viewfree");
	RegisterAction("viewov");
	RegisterAction("viewlua");
	RegisterAction("vieworbit");

	RegisterAction("viewtaflip");

	RegisterAction("toggleoverview");
	RegisterAction("togglecammode");

	RegisterAction("viewsave");
	RegisterAction("viewload");
}
Example #12
0
 void Entity::ConnectAction(const QString &name, const QObject *receiver, const char *member)
 {
     Action *action = RegisterAction(name);
     assert(action);
     connect(action, SIGNAL(Triggered(const QString &, const QString &, const QString &, const QStringVector &)), receiver, member);
 }
Example #13
0
CActionFeatureInfo::CActionFeatureInfo():IAction(actionIdentifyFeature)
{
    RegisterAction(actionIdentifyFeature, this);

	m_dlg =NULL;
}
Example #14
0
CCameraHandler::CCameraHandler()
{
	cameraTimeStart = 0.0f;
	cameraTimeEnd   = 0.0f;
	startCam.fov    = 90.0f;

	// FPS camera must always be the first one in the list
	camControllers.resize(CAMERA_MODE_LAST);
	camControllers[CAMERA_MODE_FIRSTPERSON] = new CFPSController();
	camControllers[CAMERA_MODE_OVERHEAD   ] = new COverheadController();
	camControllers[CAMERA_MODE_TOTALWAR   ] = new CTWController();
	camControllers[CAMERA_MODE_ROTOVERHEAD] = new CRotOverheadController();
	camControllers[CAMERA_MODE_FREE       ] = new CFreeController();
	camControllers[CAMERA_MODE_SMOOTH     ] = new SmoothController();
	camControllers[CAMERA_MODE_ORBIT      ] = new COrbitController();
	camControllers[CAMERA_MODE_OVERVIEW   ] = new COverviewController();

	for (unsigned int i = 0; i < camControllers.size(); i++) {
		nameMap[camControllers[i]->GetName()] = i;
	}

	int modeIndex;
	const std::string modeName = configHandler->GetString("CamModeName");
	if (!modeName.empty()) {
		modeIndex = GetModeIndex(modeName);
	} else {
		modeIndex = configHandler->GetInt("CamMode");
	}

	currCamCtrlNum = modeIndex;
	currCamCtrl = camControllers[currCamCtrlNum];

	cameraTimeFactor   = configHandler->GetFloat("CamTimeFactor");
	cameraTimeExponent = configHandler->GetFloat("CamTimeExponent");

	RegisterAction("viewfps");
	RegisterAction("viewta");
	RegisterAction("viewtw");
	RegisterAction("viewrot");
	RegisterAction("viewfree");
	RegisterAction("viewov");
	RegisterAction("viewlua");
	RegisterAction("vieworbit");

	RegisterAction("viewtaflip");

	RegisterAction("toggleoverview");
	RegisterAction("togglecammode");

	RegisterAction("viewsave");
	RegisterAction("viewload");
}