MCPcopy Create free account
hub / github.com/ConEmu/ConEmu / LoadConsoleData

Method LoadConsoleData

src/ConEmu/VirtualConsole.cpp:2223–2321  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2221}
2222
2223bool CVirtualConsole::LoadConsoleData()
2224{
2225 if (!this)
2226 {
2227 _ASSERTE(this!=nullptr);
2228 return false;
2229 }
2230
2231 WARNING("Поскольку тут мы с буфером работаем, хорошо бы выполнять только в главном потоке");
2232
2233 // Может быть, если консоль неактивна, т.к. CVirtualConsole::Update не вызывается и диалоги не детектятся. А это требуется.
2234 if (!mpsz_ConChar || !mpn_ConAttrEx)
2235 {
2236 // Если при старте ConEmu создано несколько консолей через '@'
2237 // то все кроме активной - не инициализированы (InitDC не вызывался),
2238 // что нужно делать в главной нити,
2239 // PostMessage(ghWnd, mn_MsgInitInactiveDC, 0, apVCon) об этом позаботится
2240 mp_ConEmu->InitInactiveDC(this);
2241 return false;
2242 }
2243
2244 gpSetCls->Performance(tPerfData, FALSE);
2245 {
2246 #ifdef SHOWDEBUGSTEPS
2247 mp_ConEmu->DebugStep(L"mp_RCon->GetConsoleData");
2248 #endif
2249
2250 mp_RCon->GetConsoleData(mpsz_ConChar, mpn_ConAttrEx, m_Sizes.TextWidth, m_Sizes.TextHeight, m_etr); //TextLen*2);
2251
2252 #ifdef SHOWDEBUGSTEPS
2253 mp_ConEmu->DebugStep(nullptr);
2254 #endif
2255 }
2256 SMALL_RECT rcFull, rcGlyph = {0,0,-1,-1};
2257
2258 const CRgnDetect* pRgn = mp_RCon->GetDetector();
2259
2260 _ASSERTE(countof(mrc_Dialogs)==countof(mn_DialogFlags));
2261 mn_DialogsCount = pRgn ? pRgn->GetDetectedDialogs(countof(mrc_Dialogs), mrc_Dialogs, mn_DialogFlags) : 0;
2262 mn_DialogAllFlags = pRgn ? pRgn->GetFlags() : 0;
2263
2264 // Even mp_RCon->isFilePanel(true, false, true) may be not suitable
2265 // because there may be some lags in detection or window switching
2266 isFilePanel = (mn_DialogAllFlags & (FR_LEFTPANEL|FR_RIGHTPANEL|FR_FULLPANEL)) != 0;
2267
2268#if 0
2269 if (mn_DialogsCount == 7 && mn_LastDialogsCount == 6)
2270 {
2271 Dump(L"T:\\Dialogs.con");
2272 }
2273#endif
2274
2275 if (gpSet->isExtendUCharMap)
2276 {
2277 if (pRgn && (mn_DialogAllFlags & (FR_UCHARMAP|FR_UCHARMAPGLYPH)) == (FR_UCHARMAP|FR_UCHARMAPGLYPH))
2278 {
2279 if (pRgn->GetDetectedDialogs(1, &rcFull, nullptr, FR_UCHARMAP, FR_UCHARMAP)
2280 && pRgn->GetDetectedDialogs(1, &rcGlyph, nullptr, FR_UCHARMAPGLYPH, FR_UCHARMAPGLYPH))

Callers 2

WndProcMethod · 0.80
MonitorThreadWorkerMethod · 0.80

Calls 10

wcscpy_cFunction · 0.85
InitInactiveDCMethod · 0.80
PerformanceMethod · 0.80
DebugStepMethod · 0.80
GetFlagsMethod · 0.80
CreateOtherFontMethod · 0.80
GetConsoleDataMethod · 0.45
GetDetectorMethod · 0.45
GetDetectedDialogsMethod · 0.45
IsSetMethod · 0.45

Tested by

no test coverage detected