本文整理汇总了C++中LIST::getIndex方法的典型用法代码示例。如果您正苦于以下问题:C++ LIST::getIndex方法的具体用法?C++ LIST::getIndex怎么用?C++ LIST::getIndex使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LIST
的用法示例。
在下文中一共展示了LIST::getIndex方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: IsResidentSetting
int IsResidentSetting(const char *module, const char *setting)
{
if (!m_lResidentSettings.getCount()) return 0;
if (m_lResidentModules.getIndex((char*)module) == -1) return 0;
if (!setting) return 1;
char str[2*FLD_SIZE];
mir_strncpy(str, module, _countof(str)-1);
mir_strcat(str, "/");
mir_strncat(str, setting, _countof(str));
return m_lResidentSettings.getIndex(str) != -1;
}
示例2: DbEventTypeRegister
static INT_PTR DbEventTypeRegister(WPARAM, LPARAM lParam)
{
DBEVENTTYPEDESCR* et = (DBEVENTTYPEDESCR*)lParam;
if (eventTypes.getIndex(et) == -1) {
DBEVENTTYPEDESCR* p = (DBEVENTTYPEDESCR*)mir_calloc(sizeof(DBEVENTTYPEDESCR));
p->cbSize = DBEVENTTYPEDESCR_SIZE;
p->module = mir_strdup(et->module);
p->eventType = et->eventType;
p->descr = mir_strdup(et->descr);
if (et->cbSize == DBEVENTTYPEDESCR_SIZE) {
if (et->textService)
p->textService = mir_strdup(et->textService);
if (et->iconService)
p->iconService = mir_strdup(et->iconService);
p->eventIcon = et->eventIcon;
p->flags = et->flags;
}
if (!p->textService) {
char szServiceName[100];
mir_snprintf(szServiceName, sizeof(szServiceName), "%s/GetEventText%d", p->module, p->eventType);
p->textService = mir_strdup(szServiceName);
}
if (!p->iconService) {
char szServiceName[100];
mir_snprintf(szServiceName, sizeof(szServiceName), "%s/GetEventIcon%d", p->module, p->eventType);
p->iconService = mir_strdup(szServiceName);
}
eventTypes.insert(p);
}
return 0;
}
示例3: OnMsgWndEvent
//hookProc ME_MSG_WINDOWEVENT
static int OnMsgWndEvent(WPARAM, LPARAM lParam)
{
MsgWndData *msgwnd;
MessageWindowEventData *msgwe = (MessageWindowEventData*)lParam;
/* sanity check */
if (msgwe->hContact == NULL)
return 0;
switch (msgwe->uType) {
case MSG_WINDOW_EVT_OPENING:
msgwnd = gMsgWndList.find((MsgWndData*)&msgwe->hContact);
if (msgwnd == NULL) {
msgwnd = new MsgWndData(msgwe->hwndWindow, msgwe->hContact);
gMsgWndList.insert(msgwnd);
}
break;
case MSG_WINDOW_EVT_CLOSE:
int i = gMsgWndList.getIndex((MsgWndData*)&msgwe->hContact);
if (i != -1) {
delete gMsgWndList[i];
gMsgWndList.remove(i);
}
break;
}
return 0;
}
示例4:
MIR_CORE_DLL(int) Langpack_MarkPluginLoaded(PLUGININFOEX *pInfo)
{
int idx = lMuuids.getIndex(&pInfo->uuid);
if (idx == -1)
return 0;
return (idx + 1) << 16;
}
示例5: IsActionEnabled
bool IsActionEnabled(POPUPACTION *action)
{
if (!(action->flags & PAF_ENABLED))
return false;
int index;
if ((index = gActions.getIndex(action)) >= 0)
if (!(gActions[index]->flags & PAF_ENABLED))
return false;
return true;
}
示例6: GetContactProto
MIR_CORE_DLL(HANDLE) TimeZone_CreateByContact(MCONTACT hContact, LPCSTR szModule, DWORD dwFlags)
{
if (hContact == NULL && szModule == NULL)
return (dwFlags & (TZF_DIFONLY | TZF_KNOWNONLY)) ? NULL : &myInfo.myTZ;
if (szModule == NULL) szModule = "UserInfo";
DBVARIANT dbv;
if (!db_get_ts(hContact, szModule, "TzName", &dbv)) {
HANDLE res = TimeZone_CreateByName(dbv.ptszVal, dwFlags);
db_free(&dbv);
if (res) return res;
}
signed char timezone = (signed char)db_get_b(hContact, szModule, "Timezone", -1);
if (timezone == -1) {
char *szProto = GetContactProto(hContact);
if (!db_get_ts(hContact, szProto, "TzName", &dbv)) {
HANDLE res = TimeZone_CreateByName(dbv.ptszVal, dwFlags);
db_free(&dbv);
if (res) return res;
}
timezone = (signed char)db_get_b(hContact, szProto, "Timezone", -1);
}
if (timezone != -1) {
MIM_TIMEZONE tzsearch;
tzsearch.tzi.Bias = timezone * 30;
if (myInfo.myTZ.tzi.Bias == tzsearch.tzi.Bias) {
if (dwFlags & TZF_DIFONLY) return NULL;
return &myInfo.myTZ;
}
int i = g_timezonesBias.getIndex(&tzsearch);
while (i >= 0 && g_timezonesBias[i]->tzi.Bias == tzsearch.tzi.Bias) --i;
int delta = LONG_MAX;
for (int j = ++i; j < g_timezonesBias.getCount() && g_timezonesBias[j]->tzi.Bias == tzsearch.tzi.Bias; ++j) {
int delta1 = abs(g_timezonesBias[j]->tzi.DaylightDate.wMonth - myInfo.myTZ.tzi.DaylightDate.wMonth);
if (delta1 <= delta) {
delta = delta1;
i = j;
}
}
if (i >= 0) {
MIM_TIMEZONE *tz = g_timezonesBias[i];
return ((dwFlags & TZF_DIFONLY) && IsSameTime(tz)) ? NULL : tz;
}
}
return (dwFlags & (TZF_DIFONLY | TZF_KNOWNONLY)) ? NULL : &myInfo.myTZ;
}
示例7: CloseRichCallback
void CloseRichCallback(HWND hwnd)
{
int ind = g_RichEditList.getIndex((RichEditData*)&hwnd);
if (ind == -1 )
return;
RichEditData* rdt = g_RichEditList[ind];
if (rdt->hToolTip)
DestroyWindow(rdt->hToolTip);
delete rdt;
g_RichEditList.remove(ind);
mir_unsubclassWindow(hwnd, RichEditSubclass);
}
示例8: enumResidentProc
int enumResidentProc(const char *setting, DWORD, LPARAM)
{
m_lResidentSettings.insert(mir_strdup(setting));
char str[FLD_SIZE];
const char *end = strstr(setting, "/");
if (end && (end - setting) < _countof(str)) {
mir_strncpy(str, setting, end - setting + 1);
if (m_lResidentModules.getIndex(str) == -1)
m_lResidentModules.insert(mir_strdup(str));
}
return 0;
}
示例9: CloseRichOwnerCallback
void CloseRichOwnerCallback(HWND hwnd)
{
int ind = g_RichEditOwnerList.getIndex((RichEditOwnerData*)&hwnd);
if (ind == -1)
return;
RichEditOwnerData* rdto = g_RichEditOwnerList[ind];
CloseRichCallback(rdto->hwndInput);
CloseRichCallback(rdto->hwndLog);
delete rdto;
g_RichEditOwnerList.remove(ind);
mir_unsubclassWindow(hwnd, RichEditOwnerSubclass);
}
示例10: RegisterAction
void RegisterAction(POPUPACTION *action)
{
int index;
if ((index = gActions.getIndex(action)) >= 0) {
DWORD flags = gActions[index]->flags;
*gActions[index] = *action;
gActions[index]->flags = flags;
}
else {
POPUPACTION *actionCopy = new POPUPACTION;
*actionCopy = *action;
actionCopy->flags = db_get_b(NULL, "PopupActions", actionCopy->lpzTitle, actionCopy->flags & PAF_ENABLED) ? PAF_ENABLED : 0;
gActions.insert(actionCopy);
}
}
示例11: RegisterAction
void RegisterAction(POPUPACTION *action)
{
int index;
if ((index = gActions.getIndex(action)) >= 0)
{
DWORD flags = gActions[index]->flags;
*gActions[index] = *action;
gActions[index]->flags = flags;
} else
{
POPUPACTION *actionCopy = (POPUPACTION *)mir_alloc(sizeof(POPUPACTION));
*actionCopy = *action;
actionCopy->flags =
DBGetContactSettingByte(NULL, "PopUpActions", actionCopy->lpzTitle, actionCopy->flags & PAF_ENABLED) ?
PAF_ENABLED : 0;
gActions.insert(actionCopy);
}
}
示例12: ApplyFingerprintImage
int __fastcall ApplyFingerprintImage(MCONTACT hContact, LPTSTR szMirVer)
{
if (hContact == NULL)
return 0;
HANDLE hImage = INVALID_HANDLE_VALUE;
if (szMirVer)
hImage = GetIconIndexFromFI(szMirVer);
ExtraIcon_SetIcon(hExtraIcon, hContact, hImage);
if (arMonitoredWindows.getIndex((HANDLE)hContact) != -1)
SetSrmmIcon(hContact, szMirVer);
MCONTACT hMeta = db_mc_getMeta(hContact);
if (hMeta && db_mc_getMostOnline(hMeta) == hContact)
db_set_ts(hMeta, META_PROTO, "MirVer", szMirVer);
return 0;
}
示例13: EnumResidentSettings
int EnumResidentSettings(const char *module, ModuleSettingLL *msll)
{
msll->first = 0;
msll->last = 0;
if (!module) return 0;
if (!m_lResidentSettings.getCount()) return 0;
if (m_lResidentModules.getIndex((char*)module) == -1) return 0;
int len = (int)mir_strlen(module);
int cnt = 0;
for (int i = 0; i < m_lResidentSettings.getCount(); i++) {
if (strncmp(module, m_lResidentSettings[i], len))
continue;
if (m_lResidentSettings[i][len] != '/' || m_lResidentSettings[i][len+1] == 0) continue;
enumModulesSettingsProc(&m_lResidentSettings[i][len+1], 0, (LPARAM)msll);
cnt++;
}
return cnt;
}
示例14: OnContactSettingChanged
static int OnContactSettingChanged(WPARAM hContact, LPARAM lParam)
{
if (hContact == NULL)
return 0;
/* user details update */
DBCONTACTWRITESETTING *dbcws = (DBCONTACTWRITESETTING*)lParam;
if (!strcmp(dbcws->szSetting, SET_CONTACT_COUNTRY) ||
!strcmp(dbcws->szSetting, SET_CONTACT_ORIGIN_COUNTRY) ||
!strcmp(dbcws->szSetting, SET_CONTACT_COMPANY_COUNTRY))
{
/* Extra Image */
SetExtraImage(hContact);
/* Status Icon */
int i = gMsgWndList.getIndex((MsgWndData*)&hContact);
if (i != -1) {
gMsgWndList[i]->ContryIDchange((int)ServiceDetectContactOriginCountry(hContact, 0));
gMsgWndList[i]->FlagsIconSet();
}
}
return 0;
}
示例15: MessageDlgSubclass
//global subclass function for all dialogs
static LRESULT CALLBACK MessageDlgSubclass(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
MsgWndData* dat = IsMsgWnd(hwnd);
if (dat == NULL)
return 0;
switch(uMsg) {
case DM_OPTIONSAPPLIED:
dat->clear();
dat->CreateSmileyButton();
break;
case DM_APPENDTOLOG:
if (opt.PluginSupportEnabled) {
//get length of text now before things can get added...
GETTEXTLENGTHEX gtl;
gtl.codepage = 1200;
gtl.flags = GTL_PRECISE | GTL_NUMCHARS;
dat->idxLastChar = (int)SendMessage(dat->REdit, EM_GETTEXTLENGTHEX, (WPARAM) >l, 0);
}
break;
}
LRESULT result = mir_callNextSubclass(hwnd, MessageDlgSubclass, uMsg, wParam, lParam);
if (!opt.PluginSupportEnabled)
return result;
switch(uMsg) {
case WM_DESTROY:
WaitForSingleObject(g_hMutex, 2000);
{
int ind = g_MsgWndList.getIndex((MsgWndData*)&hwnd);
if ( ind != -1 ) {
delete g_MsgWndList[ind];
g_MsgWndList.remove(ind);
}
}
ReleaseMutex(g_hMutex);
break;
case WM_SIZE:
if (dat->doSmileyButton) {
RECT rect = dat->CalcSmileyButtonPos();
SetWindowPos(dat->hSmlButton, NULL, rect.left, rect.top,
0, 0, SWP_NOZORDER | SWP_NOSIZE | SWP_NOACTIVATE);
}
break;
case DM_APPENDTOLOG:
if (dat->doSmileyReplace) {
SmileyPackCType* smcp;
SmileyPackType* SmileyPack = GetSmileyPack(dat->ProtocolName, dat->hContact, &smcp);
if (SmileyPack != NULL) {
const CHARRANGE sel = { dat->idxLastChar, LONG_MAX };
ReplaceSmileys(dat->REdit, SmileyPack, smcp, sel, false, false, false);
}
}
break;
case DM_REMAKELOG:
if (dat->doSmileyReplace) {
SmileyPackCType* smcp;
SmileyPackType* SmileyPack = GetSmileyPack(dat->ProtocolName, dat->hContact, &smcp);
if (SmileyPack != NULL) {
static const CHARRANGE sel = { 0, LONG_MAX };
ReplaceSmileys(dat->REdit, SmileyPack, smcp, sel, false, false, false);
}
}
break;
case WM_COMMAND:
if (LOWORD(wParam) == IDC_SMLBUTTON && HIWORD(wParam) == BN_CLICKED) {
SmileyToolWindowParam *stwp = new SmileyToolWindowParam;
stwp->pSmileyPack = GetSmileyPack(dat->ProtocolName, dat->hContact);
stwp->hWndParent = hwnd;
stwp->hWndTarget = dat->MEdit;
stwp->targetMessage = EM_REPLACESEL;
stwp->targetWParam = TRUE;
RECT rect;
GetWindowRect(dat->hSmlButton, &rect);
if (dat->OldButtonPlace) {
stwp->direction = 3;
stwp->xPosition = rect.left;
stwp->yPosition = rect.top + 4;
}
else {
stwp->direction = 0;
stwp->xPosition = rect.left;
stwp->yPosition = rect.top + 24;
}
mir_forkthread(SmileyToolThread, stwp);
}
if (LOWORD(wParam) == MI_IDC_ADD && HIWORD(wParam) == BN_CLICKED && dat->doSmileyButton) {
RECT rect = dat->CalcSmileyButtonPos();
//.........这里部分代码省略.........