示例#1
0
	ModuleInput::ModuleInput() : ModuleBase("Input")
	{
		VarInputRawInput = AddVariableInt("RawInput", "rawinput", "Enables raw mouse input with no acceleration applied", eCommandFlagsArchived, 1, VariableInputRawInputUpdate);
		VarInputRawInput->ValueIntMin = 0;
		VarInputRawInput->ValueIntMax = 1;

		AddCommand("Bind", "bind", "Binds a command to a key", eCommandFlagsNone, CommandBind, { "key", "[+]command", "arguments" });
		Patches::Input::RegisterDefaultInputHandler(KeyboardUpdated);

		AddCommand("UIButtonPress", "ui_btn_press", "Emulates a gamepad button press on UI menus", eCommandFlagsNone, CommandUIButtonPress, { "btnCode The code of the button to press" });

		CommandBindControllerAction = AddCommand("ControllerAction", "controller", "Binds an in-game action to a controller button", eCommandFlagsNone, ::CommandBindControllerAction, { "action The name of the action to bind", "button The button name" });
		CommandBindKeyboardAction = AddCommand("KeyboardAction", "keyboard", "Binds an in-game action to keyboard keys or mouse buttons", eCommandFlagsNone, ::CommandBindKeyboardAction, { "action The name of the action to bind", "[primary] The primary key name", "[secondary] The secondary key name" });

#ifdef _DEBUG
		AddCommand("DebugBindings", "debugbindings", "Dumps the input bindings table", eCommandFlagsNone, CommandDumpBindings);
#endif

		VarControllerSensitivityX = AddVariableFloat("ControllerSensitivityX", "xsens", "Horizontal controller look sensitivity", eCommandFlagsArchived, 120, VariableControllerSensitivityXUpdated);
		VarControllerSensitivityY = AddVariableFloat("ControllerSensitivityY", "ysens", "Vertical controller look sensitivity", eCommandFlagsArchived, 60, VariableControllerSensitivityYUpdated);

		LoadDefaultBindings();
		BuildSettingsMenu();

		// Default command bindings (TODO: port bind saving code from recode)
		commandBindings[eKeyCodeA].command = { "ui_btn_press", "0" };      // A
		commandBindings[eKeyCodeB].command = { "ui_btn_press", "1" };      // B
		commandBindings[eKeyCodeEnd].command = { "ui_btn_press", "1" };    // B
		commandBindings[eKeyCodeHome].command = { "ui_btn_press", "2" };   // X
	}
示例#2
0
static void DoOneObject( char *obj )
/**********************************/
// process a single object file
{
    bool    l_paren = false;
    bool    r_paren = false;
    char    *end;


    /* Find the end of the string. */
    end = LastStringChar( obj );

    /* The way Microsoft handles overlay syntax is pretty bizarre... */

    /* First remove surrounding parentheses, if present. */
    if( *obj == '(' ) {
        l_paren = true;
        ++obj;
    }
    if( *end == ')' ) {
        r_paren = true;
        *end-- = '\0';
    }
    /* Only then process options. */
    DoOptions( obj );

    /* Now look for a right parenthesis *again*. */
    end = LastStringChar( obj );
    if( *end == ')' ) {
        if( r_paren )
            Error( "nested right parentheses" );
        r_paren = true;
        *end-- = '\0';
    }
    /* Conditionally open an overlay. */
    if( l_paren ) {
        char    *sect;

        if( OverlayLevel )
            Error( "nested left parentheses" );

        sect = MemAlloc( 8 );
        memcpy( sect, "section", 8 );
        AddCommand( sect , OVERLAY_SLOT, true );
        ++OverlayLevel;
    }
    /* If anything is left, add it to the list of object files. */
    if( *obj ) {
        char    *name;

        name = FileName( obj, strlen( obj ), OBJECT_SLOT, false );
        AddCommand( name, OverlayLevel ? OVERLAY_SLOT : OBJECT_SLOT, false );
    }
    /* Conditionally close the current overlay. */
    if( r_paren ) {
        if( !OverlayLevel )
            Error( "unmatched right parenthesis" );
        --OverlayLevel;
    }
}
示例#3
0
// Called once, when the plugin is to initialize
PLUGIN_API VOID InitializePlugin(VOID)
{
	bzsrchhandle = CreateMutex(NULL, FALSE, NULL);
    DebugSpewAlways("Initializing MQ2Bzsrch");

    LoadMQ2Plugin("MQ2ItemDisplay");
    HMODULE h = LoadLibrary("MQ2ItemDisplay.dll");
    if (!h) {
        pg_Item = NULL;
    }
    else {
        pg_Item = (ITEMINFO *)GetProcAddress(h, "g_Item");
    }
    FreeLibrary(h);

    // Add commands, macro parameters, hooks, etc.
    AddCommand("/bzsrch",BzSrchMe);
    AddCommand("/breset",BzSrchMe);
    AddCommand("/mq2bzsrch",MQ2BzSrch);
    //AddCommand("/pricecheck",bzpc);
    AddMQ2Data("Bazaar",dataBazaar);              // cc - added, but not using TLO yet

    EzDetour(CBazaarSearchWnd__HandleBazaarMsg,&BzSrchHook::BzDetour,&BzSrchHook::BzTrampoline);
    pBazaarType = new MQ2BazaarType;
    pBazaarItemType = new MQ2BazaarItemType;
}
示例#4
0
文件: Main.c 项目: byterj/IRW_1.4
int InitPlugin(void)
{
	if(Inited == TRUE)
		return FALSE;

	Inited = TRUE;

	AddCommand("info", Command_Info);
	AddCommand("tileinfo", Command_TileInfo);

	/* not quite sure if this is needed */
	/* InitCommonControls(); */
	LayersWnd = CreateDialog(DLLInst, MAKEINTRESOURCE(DIALOG_LAYERINFO), GetMainTabWindow(), (DLGPROC)LayersDlgProc);
	PlayersWnd = CreateDialog(DLLInst, MAKEINTRESOURCE(DIALOG_PLAYERINFO), GetMainTabWindow(), (DLGPROC)PlayersDlgProc);

	if(LayersWnd == NULL || PlayersWnd == NULL)
		MBOut("INFO PLUGIN", "Could not create the dialog"); 
	else
	{
		AddTab(LayersWnd, "Layers", FALSE);
		AddTab(PlayersWnd, "Players", FALSE);
	}

	return TRUE;
}
示例#5
0
//--------------------------------------------------------------------------
/// Default constructor for NextGenLayerManager.
//--------------------------------------------------------------------------
ModernAPILayerManager::ModernAPILayerManager() :
    mbInCapturePlayer(false),
    mbTraceTriggeredFromKeypress(false),
    m_captureType(CaptureType_LinkedTrace),
    m_captureCount(1)
{
    // Command that collects a CPU and GPU trace from the same frame.
    AddCommand(CONTENT_TEXT, "FrameCaptureWithSave", "FrameCaptureWithSave", "FrameCaptureWithSave", NO_DISPLAY, NO_INCLUDE, mCmdFrameCaptureWithSave);

    // Command to set the session name
    AddCommand(CONTENT_TEXT, "SetSessionName", "SetSessionName", "SetSessionName.txt", DISPLAY, INCLUDE, mCmdSetSessionName);
    mCmdSetSessionName.SetEditableContentAutoReply(false);

    // Command to set the project name
    AddCommand(CONTENT_TEXT, "SetProjectName", "SetProjectName", "SetProjectName.txt", DISPLAY, INCLUDE, mCmdSetProjectName);
    mCmdSetProjectName.SetEditableContentAutoReply(false);

#if ENABLE_TRACE_ON_KEYPRESS
    // Bind the keyboard's keypress callback to our virtual "OnKeyPressed" function. We can override if wherever we need to use it.
    std::function<void(int, WPARAM, LPARAM)> onKeyPressedHandler =
        std::bind(&ModernAPILayerManager::OnKeyPressed, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3);

    osKeyboardListener::Instance().SetOnKbPressedCallback(onKeyPressedHandler);
#endif // ENABLE_TRACE_ON_KEYPRESS
}
示例#6
0
	DllExclusive void FactoryCommandSupplier::AddCommandsToUnit(Unit* unit)
	{
		auto commands = unit->GetCommands();
		FactoryOpenDoorsCommand* openDoors(xNew1(FactoryOpenDoorsCommand, unit));
		FactoryCloseDoorsCommand* closeDoors(xNew1(FactoryCloseDoorsCommand, unit));
		commands->AddCommand(GetTypeId<FactoryOpenDoorsCommand>(), openDoors, 0);
		commands->AddCommand(GetTypeId<FactoryCloseDoorsCommand>(), closeDoors, 0);
	}
示例#7
0
// Init this application. Register your
// commands, reactors...
void InitApplication()
{
	// NOTE: DO NOT edit the following lines.
	//{{AFX_ARX_INIT
	AddCommand("ASDK", "BLOCKVIEW", "BVIEW", ACRX_CMD_MODAL, AsdkBlockView);
	AddCommand("ASDK", "CONFIGGS", "CONFIGGS", ACRX_CMD_TRANSPARENT | ACRX_CMD_USEPICKSET, AsdkConfigGS);
	//}}AFX_ARX_INIT
}
示例#8
0
void CCommandSystem::RegisterCommands()
{
	AddCommand("/q", Util::Quit);

	// Funkcje do zarz¹dzania zasobami. TODO! Dodanie sprawdzania czy zasób istnieje etc.
	AddCommand("/loadresource", LoadRes);
	AddCommand("/unloadresource", UnLoadRes);
	AddCommand("/restartresource", ReStartRes);
}
示例#9
0
mmConsole::mmClient::mmClient(std::wstring const & p_sTitle)
    : m_bEscape(false),
      m_bNavigate(false),
      m_sPositionInHistory(m_sHistory.begin()),
      m_psCommand(NULL),
      m_sPrompt(L">> "),
      m_psImageStructure(new mmImages::mmImageStructure(NULL)),
      m_psMethodsContainer(mmInterfaceInitializers::CreateDefaultImagesCalculationMethodContainer(NULL)),
      m_psCalculationManager(new mmImages::mmImagesCalculationManagement(3, NULL))
{
    ::SetConsoleTitleW(p_sTitle.c_str());

    AddCommand(new mmCommands::mmQuit());
    AddCommand(new mmCommands::mmLoad(m_psImageStructure.get()));
    AddCommand(new mmCommands::mmSave(m_psImageStructure.get()));
    AddCommand(new mmCommands::mmPreview(m_psImageStructure.get()));
    AddCommand(new mmCommands::mmStructureInfo(m_psImageStructure.get()));
    AddCommand(new mmCommands::mmImageUtils::mmRename(m_psImageStructure.get()));
    AddCommand(new mmCommands::mmImageUtils::mmResize(m_psImageStructure.get()));
    AddCommand(new mmCommands::mmImageUtils::mmClean(m_psImageStructure.get()));

    std::vector<mmImages::mmImagesCalculationMethodI::sCalculationMethodParams> v_sMethods = m_psMethodsContainer->GetAvailableImagesCalculationMethods();
    std::map<std::wstring, std::wstring> v_sMethodFileMapping = m_psMethodsContainer->GetMethodFileMapping();
    for(std::size_t v_iI = 0; v_iI < v_sMethods.size(); ++v_iI) {
        std::wstring v_sNamespace = v_sMethodFileMapping[v_sMethods[v_iI].sIDName];
        v_sNamespace = v_sNamespace.substr(v_sNamespace.find_last_of('\\') + 1);
        v_sNamespace = v_sNamespace.substr(0, v_sNamespace.find_last_of('.'));
        AddCommand(new mmCommands::mmExternalCommand(v_sMethods[v_iI].sIDName, v_sMethods[v_iI].sCommand, v_sMethods[v_iI].sAutoParams.sInParams, m_psMethodsContainer.get(), m_psCalculationManager.get(), m_psImageStructure.get()), v_sNamespace);
    }

    std::transform(m_sCommands.begin(), m_sCommands.end(), std::back_inserter(m_sCommandNames), CommandToName<mmCommands::mmCommand*>);

    std::sort(m_sCommandNames.begin(), m_sCommandNames.end(), SortCaseInsensitive);
}
示例#10
0
// Init this application. Register your
// commands, reactors...
void InitApplication()
{
	// NOTE: DO NOT edit the following lines.
	//{{AFX_ARX_INIT
	AddCommand("ASDK", "MYINPUT", "MYINPUT", ACRX_CMD_TRANSPARENT | ACRX_CMD_USEPICKSET, asdkmyinput);
	AddCommand("ASDK", "MYSELECT", "MYSELECT", ACRX_CMD_TRANSPARENT | ACRX_CMD_USEPICKSET, asdkmyselect);
	//}}AFX_ARX_INIT

	// TODO: add your initialization functions

}
示例#11
0
文件: CliCtrl.cpp 项目: huiliu/Learn
CliCtrl::CliCtrl(wxWindow* parent, wxWindowID id, const wxString& value, const wxPoint& pos, const wxSize& size, int style)
	: wxTextCtrl(parent, id, value, pos, size, style/*, wxTextValidator(wxFILTER_ALPHA)*/)
	, m_CachedCmd(10)
{
	SetBackgroundColour(wxColor("#000000"));
	SetForegroundColour(wxColor("#ffffff"));

	SetInsertionPointEnd();
	AddCommand("ls", "list files");
	AddCommand("mkdir", "create dir");
	AddCommand("mkfs", "-t ext3");
}
//=============================================================================
///              CommandProcessor class
//=============================================================================
//--------------------------------------------------------------------------
/// constructors
//--------------------------------------------------------------------------
CommandProcessor::CommandProcessor()
    :  m_pParent(NULL),
       m_eDisplayMode(DISPLAY)    // Default to show in UI.
{
    m_strTagName = "";
    m_strID = "";
    m_strDisplayName = "";

    AddCommand(CONTENT_XML,  "CommandTree",    "Command Tree",    "CommandTree.xml", NO_DISPLAY, NO_INCLUDE, m_commandTreeResponse);
    AddCommand(CONTENT_XML,  "Settings",       "Settings",        "settings.xml",    NO_DISPLAY, NO_INCLUDE, m_xmlResponse);
    AddCommand(CONTENT_TEXT, "CommandList",    "Command List",    "commands",        NO_DISPLAY, NO_INCLUDE, m_commandListResponse);
}
示例#13
0
PLUGIN_API VOID InitializePlugin() 
{ 
    DebugSpewAlways("Initializing MQ2ChatWnd"); 
    // Add commands, macro parameters, hooks, etc. 
    AddCommand("/style",Style,0,1,0); 
    AddCommand("/mqfont",MQChatFont); 
    AddCommand("/mqmin",MQChatMin); 
    AddCommand("/mqclear",MQChatClear); 
    AddMQ2KeyBind("MQ2CHAT",DoMQ2ChatBind); 
    bmStripFirstStmlLines=AddMQ2Benchmark("StripFirstStmlLines"); 
    LoadChatSettings(); 
} 
示例#14
0
// New functions
void InheritanceVectorPart::InitializeEx(CComPtr<IMgaProject>& pProject, CComPtr<IMgaMetaPart>& pPart, CComPtr<IMgaFCO>& pFCO,
									  HWND parentWnd, PreferenceMap& preferences)
{
	TriangleVectorPart::InitializeEx(pProject, pPart, pFCO, parentWnd, preferences);

	if (m_inheritanceType == ImplementationInheritance || m_inheritanceType == InterfaceInheritance) {
		getFacilities().getMetaFCO(pPart, m_spMetaFCO);
		bool bColor = false;
		COLORREF crColor = COLOR_BLACK;
		PreferenceMap::iterator it = preferences.find(PREF_COLOR);
		if (it != preferences.end()) {
			bColor = true;
			crColor = it->second.uValue.crValue;
		} else {
			bColor = getFacilities().getPreference(pFCO, m_spMetaFCO, PREF_COLOR, crColor);
		}
		AbsoluteCoordCommand* colorCmd = new AbsoluteCoordCommand(crColor);
		AbsoluteCoordCommand* grayedCmd = new AbsoluteCoordCommand(COLOR_GRAYED_OUT);
		m_coordCommands.push_back(colorCmd);
		m_coordCommands.push_back(grayedCmd);
		unsigned long size = m_coordCommands.size();
		AddCommand(VectorCommand(colorCmd, grayedCmd, VectorCommand::SelectBrush));

		// Add four coordinates for the inner circle boundaries
		ComplexCoordCommand* ellipseLeft = new ComplexCoordCommand(LeftMost, 0.5 - 0.25 * INHERITANCE_RATIO);
		ellipseLeft->AddCommand(RightMost, 0.5 + 0.25 * INHERITANCE_RATIO, CoordAdd);
		ellipseLeft->AddCommand(OneConstant, 1.0, CoordAdd);	// correction in case of small sizes
		ComplexCoordCommand* ellipseTop = new ComplexCoordCommand(TopMost, 1.0 / 3.0 - 0.25);
		ellipseTop->AddCommand(BottomMost, 2.0 / 3.0 + 0.25, CoordAdd);
		ComplexCoordCommand* ellipseRight = new ComplexCoordCommand(LeftMost, 0.5 + 0.25 * INHERITANCE_RATIO);
		ellipseRight->AddCommand(RightMost, 0.5 - 0.25 * INHERITANCE_RATIO, CoordAdd);
		ComplexCoordCommand* ellipseBottom = new ComplexCoordCommand(TopMost, 1.0 / 3.0 + 0.25);
		ellipseBottom->AddCommand(BottomMost, 2.0 / 3.0 - 0.25, CoordAdd);

		m_coordCommands.push_back(ellipseLeft);
		m_coordCommands.push_back(ellipseTop);
		m_coordCommands.push_back(ellipseRight);
		m_coordCommands.push_back(ellipseBottom);
		size = m_coordCommands.size();
		if (m_inheritanceType == InterfaceInheritance)
			AddCommand(VectorCommand(m_coordCommands[size - 4],
									 m_coordCommands[size - 3],
									 m_coordCommands[size - 2],
									 m_coordCommands[size - 1],
									 VectorCommand::DrawEllipse));
		if (m_inheritanceType == ImplementationInheritance)
			AddCommand(VectorCommand(m_coordCommands[size - 4],
									 m_coordCommands[size - 3],
									 m_coordCommands[size - 2],
									 m_coordCommands[size - 1],
									 VectorCommand::FillEllipse));
	}
}
// Init this application. Register your
// commands, reactors...
void InitApplication()
{
    if (FAILED(DllRegisterServer()))
        acutPrintf("\nFailed to register.");//dbx safe
    // NOTE: DO NOT edit the following lines.
    //{{AFX_ARX_INIT
    AddCommand("ASDKETRANSMIT", "ADDNOTIFIER", "ADDNOTIFIER", ACRX_CMD_SESSION, AsdkeTransmitAddNotifier);
    AddCommand("ASDKETRANSMIT", "REMOVENOTIFIER", "REMOVENOTIFIER", ACRX_CMD_SESSION, AsdkeTransmitRemoveNotifier);
    //}}AFX_ARX_INIT

    // TODO: add your initialization functions

}
示例#16
0
	ElModules::ElModules() : ModuleBase("")
	{
		ModuleGame::Instance();
		ModulePlayer::Instance();
		ModuleServer::Instance();
		ModuleCamera::Instance();
		ModuleInput::Instance();
		ModuleIRC::Instance();

		AddCommand("Help", "help", "Displays this help text", eCommandFlagsNone, CommandHelp);
		AddCommand("Execute", "exec", "Executes a list of commands", eCommandFlagsNone, CommandExecute, { "filename(string) The list of commands to execute" });
		AddCommand("WriteConfig", "config_write", "Writes the ElDewrito config file", eCommandFlagsNone, CommandWriteConfig, { "filename(string) Optional, the filename to write the config to" });

		CommandMap::Instance().FinishAddCommands(); // call this so that the default values can be applied to the game
	}
示例#17
0
void BuildCommandTable(void)
{
  AddCommand("help",	HelpCom);
  AddCommand("q",	QuitCom);
  AddCommand("reghand",	RegHandlerCom);
  AddCommand("remhand", RemHandlerCom);
  AddCommand("reset",	ResetCom);
  AddCommand("setrx",	SetUpRxCom);
  AddCommand("tx",	TxCom);
  AddCommand("txmany",	TxManyCom);
  AddCommand("waitrx",	WaitRxCom);
}
示例#18
0
void CConsole::AddCommandToHead(char *sCommand)
{
	char	*temp;
	int	templen;

	// skopiuj wszystkie czekajace komendy
	templen = m_CmdText.cursize;
	if ( templen )
	{
		temp = (char *)new char[ templen ];
		memcpy( temp, m_CmdText.data, templen );
		SZ_Clear( &m_CmdText );
	}
	else
		temp = NULL;

	// najpier dodajemy zadana komende
	AddCommand( sCommand );

	// a potem skopiowana reszte
	if (templen)
	{
		SZ_Write( &m_CmdText, temp, templen );
		delete[] temp;
	}	
}
示例#19
0
bool C4MessageInput::Init() {
  // add default commands
  if (!pCommands) {
    AddCommand("speed", "SetGameSpeed(%d)");
  }
  return true;
}
示例#20
0
void CCommandView::showEvent(QShowEvent * e)
{
    //m_pCommandList->SetPos(m_pMenuBtn->geometry().left(),m_pMenuBtn->geometry().top(),m_pMenuBtn->geometry().width()*2.5,0);
    m_CmdVec.clear();

    std::vector<SMenuCommand> CmdList = m_pList->getActiveApp()->getCommandList();
    std::vector<SMenuCommand> TmpCmdList;
    for (unsigned int i = 0; i < CmdList.size(); ++i) {
        if (0 != CmdList.at(i).i_cmdID && 0 == CmdList.at(i).i_menuID) {
            AddCommand(CmdList.at(i).i_cmdID,CmdList.at(i).str_menuName,CmdList.at(i).str_ImagePath);
        }else if (0 == CmdList.at(i).i_cmdID && 0 != CmdList.at(i).i_menuID) {
            AddMenu(CmdList.at(i).i_menuID,CmdList.at(i).str_menuName);

            TmpCmdList = m_pList->getActiveApp()->getCommandList(CmdList.at(i).i_menuID);
            for(unsigned int j = 0; j < TmpCmdList.size(); j++) {
                AddSubCommand(CmdList.at(i).i_menuID,
                              TmpCmdList.at(j).i_cmdID,
                              TmpCmdList.at(j).str_menuName.data(),TmpCmdList.at(j).str_ImagePath);
            }
        }
    }
    m_pCurrentMenu = NULL;
    RefreshCommandList();

    AppBase::SetEdlidedText(m_pAppNameLab,
                            m_pList->getActiveApp()->getAppName().c_str(),
                            width()*0.8);
}
void CRunMapExpertDlg::UpdateCommandWithEditFields(int iIndex)
{
	PCCOMMAND pCommand = GetCommandAtIndex(&iIndex);
	
	// update command struct with edit fields:
	m_cCommand.GetWindowText(pCommand->szRun, MAX_PATH);
	m_cParameters.GetWindowText(pCommand->szParms, MAX_PATH);
	m_cEnsureFn.GetWindowText(pCommand->szEnsureFn, MAX_PATH);
	pCommand->bUseProcessWnd = m_cUseProcessWnd.GetCheck();
	pCommand->bEnsureCheck = m_cEnsureCheck.GetCheck();

	// save checked state..
	BOOL bCmdChecked = m_cCommandList.GetCheck(iIndex);

	// update list by deleting/adding command
	m_cCommandList.SetRedraw(FALSE);
	m_cCommandList.DeleteString(iIndex);
	AddCommand(iIndex, pCommand);
	m_cCommandList.SetCurSel(iIndex);
	m_cCommandList.SetRedraw(TRUE);
	m_cCommandList.Invalidate();

	m_cCommandList.SetCheck(iIndex, bCmdChecked);

	// DON'T call OnCommandlistSelchange() here
}
示例#22
0
void RenderPath::SetCommand(unsigned index, const RenderPathCommand& command)
{
    if (index < commands_.Size())
        commands_[index] = command;
    else if (index == commands_.Size())
        AddCommand(command);
}
示例#23
0
void QuestActionContainer :: AddLine(const char *statement)
{
	STRINGLIST commands;
	Util::Split(statement, ";", commands);
	for(size_t i = 0; i < commands.size(); i++)
		AddCommand(commands[i]);
}
示例#24
0
static void ProcData( void )
/**************************/
// NYI: serious copied code from ProcCode.  Should be united into one routine.
{
    char    buffer[ CODE_BUFFER_LEN ];
    char    *result;
    size_t  len;

    memcpy( buffer, "segment type data", 17 );
    OptionBuffer = buffer + 17;
    BufferLeft = CODE_BUFFER_LEN - 18;
    if( !ProcessKeyword( DataAttributes ) ) {
        Warning( "argument for data statement not valid", OPTION_SLOT );
    } else {    // get the rest of the attributes.
        while( ProcessKeyword( DataAttributes ) )
            {}     // NULL statement.
        if( BufferLeft != CODE_BUFFER_LEN - 18 ) {      // attribute spec'd.
            len = CODE_BUFFER_LEN - BufferLeft - 1;
            result = MemAlloc( CODE_BUFFER_LEN - BufferLeft + 1 );
            memcpy( result, buffer, len );
            *(result + len) = '\0';
            AddCommand( result, OPTION_SLOT, false );
        }
    }
}
示例#25
0
TerminalCommands::TerminalCommands(const std::string& termName, TerminalState* parent)
: m_terminalName(termName), m_parent(parent)
{
    AddCommand(new ExitCommand(this));
    GetCommandListMessage gclMsg(Terminal::GetInstance().getTerminalModule());
    Terminal::GetInstance().getTerminalModule()->toMessage(gclMsg, m_terminalName);
}
示例#26
0
void KeyBinder::AddCommand(const wxString& group, wxMenuItem* menuItem)
{
    if (menuItem->GetKind() != wxITEM_SEPARATOR)
    {
        AddCommand(menuItem->GetId(), group, menuItem->GetText(), menuItem->GetHelp());
    }
}
示例#27
0
/*
  ParseConfigLine - Parse the configuration line fvwm to us to use
*/
int ParseConfigLine(char *line)
{
	int cpl = strlen(configPrefix);

	if (strlen(line) > 1)
	{
		if (strncasecmp(line, configPrefix, cpl) == 0)
		{
			if (strncasecmp(
				    line+cpl, "RetainPixmap", 12) == 0)
			{
				RetainPixmap = True;
			}
			else if (strncasecmp(
					 line+cpl,
					 "DoNotRetainPixmap", 17) == 0)
			{
				RetainPixmap = False;
			}
			else
			{
				AddCommand(line + cpl);
			}
		}
		else if (strncasecmp(line, "colorset", 8) == 0)
		{
			return LoadColorset(line + 8);
		}
	}
	return -1;
}
示例#28
0
///
/// Add a command that doesn't appear in a menu.  When the key is pressed, the
/// given function pointer will be called (via the CommandManagerListener)
void CommandManager::AddCommand(const wxChar *name,
                                const wxChar *label,
                                CommandFunctor *callback,
                                unsigned int flags,
                                unsigned int mask)
{
   AddCommand(name, label, callback, wxT(""), flags, mask);
}                  
示例#29
0
// Init this application. Register your
// commands, reactors...
void InitApplication()
{
	// NOTE: DO NOT edit the following lines.
	//{{AFX_ARX_INIT
	AddCommand("ASDK_SMILEY", "ASDK_SMILEY", "SMILEY", ACRX_CMD_MODAL, createSmiley);
	RegisterArxApp();
	//}}AFX_ARX_INIT
}
示例#30
0
文件: Main.c 项目: byterj/IRW_1.4
int InitPlugin(void)
{
	if(Inited == TRUE)
		return FALSE;

	GetIRWProfileInt(NULL, "Smooth", "SmoothWalk", &SmoothWalk);

	AddPacketHandler(SERVER_MESSAGE, 0x22, HookServer_WalkAck);
	AddPacketHandler(CLIENT_MESSAGE, 0x02, HookClient_WalkRequest);
	
	AddCommand("smoothwalk", Command_SmoothWalk);
	AddCommand("resync", Command_Resync);
	
	Inited = TRUE;

	return TRUE;
}