Beispiel #1
0
NvError NvRmSetKeyValuePair(NvRmDeviceHandle hRm, NvU32 KeyID, NvU32 Value)
{
    Key *pList = s_pKeyList;
    NvError e = NvSuccess;
    unsigned int i;

    if (KeyID >= NvOdmKeyListId_ReservedAreaStart &&
        KeyID <= NvOdmKeyListId_ReservedAreaEnd)
        return NvError_NotSupported;

    NvOsMutexLock(s_Mutex);
    // Checking if key already exists
    while (pList)
    {
        for (i=0; i<pList->Count; i++)
        {
            if (pList->KeyID[i] == KeyID)
            {
                pList->Value[i] = Value;
                goto cleanup;
            }
        }
        pList = pList->pNextKey;
    }
    // Adding The new key to the list
    e = AddKeyToList(KeyID, Value);
cleanup:
    NvOsMutexUnlock(s_Mutex);
    return e;
}
Beispiel #2
0
NvError NvRmPrivInitKeyList(NvRmDeviceHandle hRm, 
                            const NvU32 *InitialValues,
                            NvU32 InitialCount)
{
    NvError Error;
    NvU32 i;

    Error = NvOsMutexCreate(&s_Mutex);
    if (Error!=NvSuccess)
        return Error;

    if (!s_pKeyList)
    {
        s_pKeyList = &s_InitialKeyList;
        s_InitialKeyList.Count = 0;
        s_InitialKeyList.pNextKey = NULL;
        for (i=0; i<InitialCount; i++)
        {
            AddKeyToList(NvOdmKeyListId_ReservedAreaStart + i, 
                InitialValues[i]);
        }
    }

    // Creating the Mutex
    return Error;
}
Beispiel #3
0
dlgManageMacros::dlgManageMacros(wxWindow *parent, frmMain *form, queryMacroList *macros) :
	DialogWithHelp(form)
{
	SetFont(settings->GetSystemFont());
	LoadResource(parent, wxT("dlgManageMacros"));
	RestorePosition();

	this->macros = macros;

	// Setup list of keys
	lstKeys->CreateColumns(NULL, _("Key"), _("Name"), 40);

	lstKeys->Hide();
	size_t i;
	int num = 0;
	for (i = 1; i < 13; i++)
	{
		wxString key;
		key.Printf(wxT("Alt-F%d"), (int)i);
		AddKeyToList(num++, key);
	}
	for (i = 1; i < 11; i++)
	{
		wxString key;
		key.Printf(wxT("Ctrl-%d"), (int)i % 10); // in order of keys 1,2,...,8,9,0
		AddKeyToList(num++, key);
	}
	lstKeys->Show();

	// Initialy no key is selected, so disable editor keys
	btnClear->Disable();
	btnSave->Disable();

	// Clear Markers
	anythingChanged = false;
	thisMacroChanged = false;

	txtSqlBox->SetModEventMask(wxSTC_MOD_INSERTTEXT | wxSTC_MOD_DELETETEXT);
}