本文整理汇总了C++中WDL_PtrList类的典型用法代码示例。如果您正苦于以下问题:C++ WDL_PtrList类的具体用法?C++ WDL_PtrList怎么用?C++ WDL_PtrList使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了WDL_PtrList类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: toggleActionHook
// Returns:
// -1 = action does not belong to this extension, or does not toggle
// 0 = action belongs to this extension and is currently set to "off"
// 1 = action belongs to this extension and is currently set to "on"
int toggleActionHook(int iCmd)
{
static WDL_PtrList<const char> sReentrantCmds;
if (COMMAND_T* cmd = SWSGetCommandByID(iCmd))
{
if (cmd->accel.accel.cmd==iCmd && cmd->getEnabled && cmd->doCommand!=SWS_NOOP)
{
if (sReentrantCmds.Find(cmd->id) == -1)
{
sReentrantCmds.Add(cmd->id);
int state = cmd->getEnabled(cmd);
sReentrantCmds.Delete(sReentrantCmds.Find(cmd->id));
return state;
}
#ifdef ACTION_DEBUG
else
{
OutputDebugString("toggleActionHook - recursive action: ");
OutputDebugString(cmd->id);
OutputDebugString("\n");
}
#endif
}
}
return -1;
}
示例2:
WDL_PtrList<void>* FilteredVisState::GetFilteredTracks()
{
static WDL_PtrList<void> tracks;
tracks.Empty(false);
for (int i = 1; i <= GetNumTracks(); i++)
{
MediaTrack* tr = CSurf_TrackFromID(i, false);
if (MatchesFilter(tr))
tracks.Add(tr);
}
return &tracks;
}
示例3: on_list_update
void MainWnd::on_list_update()
{
WDL_PtrList<ShellAction> *actions = NULL;
App *the_app = NULL;
the_app = App::get();
actions = the_app->get_tasks();
#ifdef WIN32
HWND ctrl = GetDlgItem(m_hwnd, IDC_TASKS);
int sel_id = -1;
sel_id = ListView_GetCurSel(ctrl);
ListView_DeleteAllItems(ctrl);
if(!actions->GetSize())
return;
for(int i = 0; i < actions->GetSize(); i++)
{
LVITEM lvitem;
WDL_String tmp;
char buf[128];
ShellAction *action = actions->Get(i);
lvitem.mask = LVIF_TEXT | LVIF_PARAM;
lvitem.iItem = i;
lvitem.iSubItem = 0;
lvitem.lParam = (LPARAM)action->get_id();
lvitem.cchTextMax = strlen(action->get_title());
lvitem.pszText = action->get_title();
ListView_InsertItem(ctrl, &lvitem);
ListView_SetItemText(ctrl, i, 1, action->get_path());
tmp = "Every ";
itoa(action->get_interval(), buf, 10);
tmp.Append(buf);
tmp.Append(" ");
tmp.Append(RUN_TYPE_LABELS[action->get_interval_type()]);
ListView_SetItemText(ctrl, i, 2, tmp.Get());
}
if (sel_id >= 0 && m_selected_task)
{
ShellAction *action = the_app->get_task_by_id(sel_id + 1);
the_app->activate_task(action);
ListView_SetItemState(ctrl, sel_id, LVIS_SELECTED | LVIS_FOCUSED, LVIS_SELECTED | LVIS_FOCUSED);
}
#endif // WIN32
}
示例4: hookCommandProc
bool hookCommandProc(int iCmd, int flag)
{
static WDL_PtrList<const char> sReentrantCmds;
// for Xen extensions
g_KeyUpUndoHandler=0;
// "Hack" to make actions will #s less than 1000 work with SendMessage (AHK)
// no recursion check here: handled by REAPER
if (iCmd < 1000)
return KBD_OnMainActionEx(iCmd, 0, 0, 0, g_hwndParent, NULL) ? true : false; // C4800
// Special case for checking recording
if (iCmd == 1013 && !RecordInputCheck())
return true;
// Ignore commands that don't have anything to do with us from this point forward
if (COMMAND_T* cmd = SWSGetCommandByID(iCmd))
{
if (cmd->accel.accel.cmd==iCmd && cmd->doCommand && cmd->doCommand!=SWS_NOOP)
{
if (sReentrantCmds.Find(cmd->id) == -1)
{
sReentrantCmds.Add(cmd->id);
cmd->fakeToggle = !cmd->fakeToggle;
#ifndef DEBUG_PERFORMANCE_TIME
cmd->doCommand(cmd);
#else
CommandTimer(cmd);
#endif
sReentrantCmds.Delete(sReentrantCmds.Find(cmd->id));
return true;
}
#ifdef ACTION_DEBUG
else
{
OutputDebugString("hookCommandProc - recursive action: ");
OutputDebugString(cmd->id);
OutputDebugString("\n");
}
#endif
}
}
return false;
}
示例5: TrackPopupMenu
int TrackPopupMenu(HMENU hMenu, int flags, int xpos, int ypos, int resvd, HWND hwnd, const RECT *r)
{
if (!hMenu || m_trackingMenus.GetSize()) return 0;
ReleaseCapture();
m_trackingPar=hwnd;
m_trackingFlags=flags;
m_trackingRet=-1;
m_trackingPt.x=xpos;
m_trackingPt.y=ypos;
submenuWndProc(new HWND__(NULL,0,NULL,"menu",false,submenuWndProc,NULL),WM_CREATE,0,(LPARAM)hMenu);
printf("enter trackpopupmenu loop\n");
while (m_trackingRet<0 && m_trackingMenus.GetSize())
{
void SWELL_RunMessageLoop();
SWELL_RunMessageLoop();
Sleep(10);
}
printf("leave trackpopupmenu loop\n");
int x=m_trackingMenus.GetSize()-1;
while (x>=0)
{
HWND h = m_trackingMenus.Get(x);
m_trackingMenus.Delete(x);
if (h) DestroyWindow(h);
x--;
}
if (!(flags&TPM_NONOTIFY) && m_trackingRet>0)
SendMessage(hwnd,WM_COMMAND,m_trackingRet,0);
return m_trackingRet>0?m_trackingRet:0;
}
示例6: AddString
int AddString(const WDL_FastString &s)
{
WDL_FastString *ns = new WDL_FastString;
*ns = s;
m_strings.Add(ns);
return m_strings.GetSize()-1+STRING_INDEX_BASE;
}
示例7: RegisterToMarkerRegionUpdates
void RegisterToMarkerRegionUpdates(SNM_MarkerRegionListener* _listener)
{
#ifdef _SNM_MUTEX
SWS_SectionLock lock(&g_mkrRgnListenersMutex);
#endif
if (_listener && g_mkrRgnListeners.Find(_listener) < 0)
g_mkrRgnListeners.Add(_listener);
}
示例8: UnregisterToMarkerRegionUpdates
void UnregisterToMarkerRegionUpdates(SNM_MarkerRegionListener* _listener)
{
#ifdef _SNM_MUTEX
SWS_SectionLock lock(&g_mkrRgnListenersMutex);
#endif
int idx = _listener ? g_mkrRgnListeners.Find(_listener) : -1;
if (idx >= 0)
g_mkrRgnListeners.Delete(idx, false);
}
示例9: delete
~FontStorage()
{
int i, n = m_fonts.GetSize();
for (i = 0; i < n; ++i)
{
delete(m_fonts.Get(i)->font);
}
m_fonts.Empty(true);
}
示例10: ContinuousActionRegister
/******************************************************************************
* Continuous actions *
******************************************************************************/
bool ContinuousActionRegister (BR_ContinuousAction* action)
{
if (action && kbd_getTextFromCmd(action->cmd, NULL) && g_actions.FindSorted(action, &CompareActionsByCmd) == -1)
{
g_actions.InsertSorted(action, &CompareActionsByCmd);
return true;
}
else
return false;
}
示例11: Find
LICE_IFont* Find(IText* pTxt)
{
WDL_MutexLock lock(&m_mutex);
int i = 0, n = m_fonts.GetSize();
for (i = 0; i < n; ++i)
{
FontKey* key = m_fonts.Get(i);
if (key->size == pTxt->mSize && key->orientation == pTxt->mOrientation && key->style == pTxt->mStyle && !strcmp(key->face, pTxt->mFont)) return key->font;
}
return 0;
}
示例12: AddFontResourceEx
int AddFontResourceEx(LPCTSTR str, DWORD fl, void *pdv)
{
if (str && *str)
{
int x;
for (x=0;x<s_registered_fonts.GetSize();x++)
if (!strcmp(str,s_registered_fonts.Get(x))) return 0;
s_registered_fonts.Add(strdup(str));
return 1;
}
return 0;
}
示例13: OscInit
bool OscInit(OscHandler* osc)
{
KillOscThread();
if (s_osc_handlers.Find(osc) < 0)
{
// insert at the top, so new listeners will block existing handlers
s_osc_handlers.Insert(0, osc);
}
StartOscThread();
return true;
}
示例14: EndDialog
void EndDialog(HWND wnd, int ret)
{
if (!wnd) return;
int x;
for (x = 0; x < s_modalDialogs.GetSize(); x ++)
if (s_modalDialogs.Get(x)->hwnd == wnd)
{
s_modalDialogs.Get(x)->has_ret=true;
s_modalDialogs.Get(x)->ret = ret;
}
DestroyWindow(wnd);
// todo
}
示例15: Remove
void Remove(LICE_IBitmap* bitmap)
{
WDL_MutexLock lock(&m_mutex);
int i, n = m_bitmaps.GetSize();
for (i = 0; i < n; ++i)
{
if (m_bitmaps.Get(i)->bitmap == bitmap)
{
m_bitmaps.Delete(i, true);
delete(bitmap);
break;
}
}
}