Beispiel #1
0
void emFileManModel::LoadCommands(const emString & rootDir)
{
	ClearCommands();
	CmdRoot=new CommandNode;
	CmdRoot->Type=CT_GROUP;
	CmdRoot->Dir=rootDir;
	CmdRoot->Caption="Commands";
	Cmds.AddNew();
	Cmds.GetWritable(0).HashCode=emCalcHashCode(CmdRoot->CmdPath);
	Cmds.GetWritable(0).Node=CmdRoot;
	LoadChildCommands(CmdRoot);
}
Beispiel #2
0
void wxCommandProcessor::Store(wxCommand *command)
{
    wxCHECK_RET( command, wxT("no command in wxCommandProcessor::Store") );

    // Correct a bug: we must chop off the current 'branch'
    // so that we're at the end of the command list.
    if (!m_currentCommand)
        ClearCommands();
    else
    {
        wxList::compatibility_iterator node = m_currentCommand->GetNext();
        while (node)
        {
            wxList::compatibility_iterator next = node->GetNext();

            // Make sure m_lastSavedCommand won't point to freed memory
            if ( m_lastSavedCommand && m_lastSavedCommand == node )
                m_lastSavedCommand = wxList::compatibility_iterator();

            delete (wxCommand *)node->GetData();
            m_commands.Erase(node);

            node = next;
        }
    }

    if ( (int)m_commands.GetCount() == m_maxNoCommands )
    {
        wxList::compatibility_iterator firstNode = m_commands.GetFirst();

        // Make sure m_lastSavedCommand won't point to freed memory
        if ( m_lastSavedCommand && m_lastSavedCommand == firstNode )
            m_lastSavedCommand = wxList::compatibility_iterator();

        wxCommand *firstCommand = (wxCommand *)firstNode->GetData();
        delete firstCommand;
        m_commands.Erase(firstNode);
    }

    m_commands.Append(command);
    m_currentCommand = m_commands.GetLast();
    SetMenuStrings();
}
Beispiel #3
0
void cPluginLua::Close(void)
{
	cCSLock Lock(m_CriticalSection);

	// If already closed, bail out:
	if (!m_LuaState.IsValid())
	{
		ASSERT(m_HookMap.empty());
		return;
	}

	// Remove the command bindings and web tabs:
	ClearCommands();
	ClearConsoleCommands();
	ClearWebTabs();

	// Release all the references in the hook map:
	m_HookMap.clear();

	// Close the Lua engine:
	m_LuaState.Close();
}
Beispiel #4
0
bool CPattern::AllocatePattern(ROWINDEX rows)
//-------------------------------------------
{
	ModCommand *m = m_ModCommands;
	if(m != nullptr && rows == GetNumRows())
	{
		// Re-use allocated memory
		ClearCommands();
		m_ModCommands = nullptr;
	} else
	{
		m = AllocatePattern(rows, GetNumChannels());
		if(m == nullptr)
		{
			return false;
		}
	}
	Deallocate();
	m_ModCommands = m;
	m_Rows = rows;
	return true;
}
Beispiel #5
0
KeyBinder::~KeyBinder()
{
    ClearCommands();   
}
CRegisteredCommands::~CRegisteredCommands()
{
    ClearCommands();
}
Beispiel #7
0
wxCommandProcessor::~wxCommandProcessor()
{
    ClearCommands();
}
static
NTSTATUS
Poll(
    IN PCLOCK pClock,
    IN OUT PLONG64 pllNow,
    IN int KqueueFd,
    IN PKQUEUE_COMMANDS pCommands,
    OUT struct kevent* pEvents,
    IN int maxEvents,
    IN LONG64 llNextDeadline,
    OUT int* pReady
    )
{
    NTSTATUS status = STATUS_SUCCESS;
    int ready = 0;
    struct timespec timeout = {0, 0};
    LONG64 llTimeDiff = 0;

    do
    {
        if (llNextDeadline >= 0)
        {
            /* Convert to timeout structure */
            llTimeDiff = llNextDeadline - *pllNow;

            if (llTimeDiff < 0)
            {
                timeout.tv_sec = 0;
                timeout.tv_nsec = 0;
            }
            else
            {
                timeout.tv_sec = llTimeDiff / 1000000000ll;
                timeout.tv_nsec = llTimeDiff % 1000000000ll;
            }
        }

        ready = kevent(
            KqueueFd,
            pCommands->pCommands,
            pCommands->ulCommandCount,
            pEvents,
            maxEvents,
            llNextDeadline >= 0 ? &timeout : NULL);

        if (ready < 0 && errno == EINTR)
        {
            /* Update current time so the next timeout calculation is correct */
            status = ClockGetMonotonicTime(pClock, pllNow);
            GOTO_ERROR_ON_STATUS(status);
        }

    } while (ready < 0 && errno == EINTR);

    if (ready < 0)
    {
        status = LwErrnoToNtStatus(errno);
        GOTO_ERROR_ON_STATUS(status);
    }

    ClearCommands(pCommands);

    *pReady = ready;

error:

    return status;
}
Beispiel #9
0
emFileManModel::~emFileManModel()
{
	delete IpcServer;
	ClearCommands();
}
Beispiel #10
0
//! a destructor
GraphManager::~GraphManager()
{
	ClearManipulator();
	ClearGlobalManip();
	ClearCommands();
}