void ParseTree::showDetection(cv::Mat img, bool display) { for ( int i = 0; i < nodeSet().size(); ++i ) { if ( nodeSet()[i]->idx()(PtNode::IDX_TYPE) != static_cast<int>(Node::T_NODE) ) { continue; } const ParseInfo * info = nodeSet()[i]->parseInfo(this); cv::rectangle(img, info->cvRect(), cv::Scalar::all(255), 3); cv::rectangle(img, info->cvRect(), cv::Scalar(255, 0, 0), 2); /*if ( display ) { cv::String winName("AOGDetection"); cv::imshow(winName, img); cv::waitKey(0); }*/ } cv::rectangle(img, rootNode()->parseInfo(this)->cvRect(), cv::Scalar::all(255), 5); cv::rectangle(img, rootNode()->parseInfo(this)->cvRect(), cv::Scalar(0, 0, 255), 3); if ( display ) { cv::String winName("AOGDetection"); cv::imshow(winName, img); cv::waitKey(0); } }
/* ** makeWindow(). */ void makeWindow (TuiGenWinInfoPtr winInfo, int boxIt) { WINDOW *handle; handle = newwin (winInfo->height, winInfo->width, winInfo->origin.y, winInfo->origin.x); winInfo->handle = handle; if (handle != (WINDOW *) NULL) { if (boxIt == BOX_WINDOW) boxWin (winInfo, NO_HILITE); winInfo->isVisible = TRUE; scrollok (handle, TRUE); tuiRefreshWin (winInfo); #ifndef FOR_TEST if ( /*!m_WinIsAuxillary(winInfo->type) && */ (winInfo->type != CMD_WIN) && (winInfo->content == (OpaquePtr) NULL)) { mvwaddstr (handle, 1, 1, winName (winInfo)); tuiRefreshWin (winInfo); } #endif /*FOR_TEST */ } return; } /* makeWindow */
void Client::startMain(std::string const &user) { std::string winName("Babel - " + user); this->user = new contact(user, 0); this->connected = true; this->mainWin->setWindowTitle(winName.c_str()); this->mainWin->show(); }
wxString wxLuaWinDestroyCallback::GetInfo() const { wxString winName(wxT("wxWindow?")); if (m_window && m_window->GetClassInfo()) winName = m_window->GetClassInfo()->GetClassName(); return wxString::Format(wxT("%s(%p, id=%d)|wxLuaDestroyCallback(%p)"), winName.c_str(), m_window, m_window ? m_window->GetId() : -1, this); }
std::string getWindowName() { std::string winName(""); HWND fWin = GetForegroundWindow(); if (fWin) { DWORD threadId; GetWindowThreadProcessId(fWin, &threadId); HANDLE hProcess = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, false, threadId); if (hProcess) { char name[256]; if (GetModuleFileNameEx(hProcess, NULL, name, sizeof(name))) winName = name; } } return winName; }
/* ** partialWinByName(). ** Answer the window represented by name */ TuiWinInfoPtr partialWinByName (char *name) { TuiWinInfoPtr winInfo = (TuiWinInfoPtr) NULL; if (name != (char *) NULL) { int i = 0; while (i < MAX_MAJOR_WINDOWS && m_winPtrIsNull (winInfo)) { if (winList[i] != 0) { char *curName = winName (&winList[i]->generic); if (strlen (name) <= strlen (curName) && strncmp (name, curName, strlen (name)) == 0) winInfo = winList[i]; } i++; } } return winInfo; } /* partialWinByName */
eFlag DataLine::open(Sit S, const char *_uri, DLAccessMode _mode, StrStrList* argList_, Bool ignoreErr /* = FALSE */) { sabassert(mode == DLMODE_NONE); // the buffer must not be open yet // combine _uri and _baseUri into one Str strScheme, strPath; scheme = uri2SchemePath(S, _uri, strScheme, strPath); char *name = (char*) strPath; // mode set in the end fullUri = (char*)_uri; switch(scheme) { case URI_FILE: { if (name[0] == '/' && name[1] == '/') name += 2; // skipping the "//" in front // try to open the file #ifdef _MSC_VER if (!(f = stdopen(name,_mode == DLMODE_WRITE ? "wb" : "rb"))) #else if (!(f = stdopen(name,_mode == DLMODE_WRITE ? "w" : "r"))) #endif specErr1(S, E_FILE_OPEN, winName(name)); // set fileIsStd if filename is "stdin", "stdout" or "stderr" fileIsStd = isstd(name); }; break; case URI_ARG: { // if opening for read access, get the pointer to the argument contents // plus some extra information if (_mode == DLMODE_READ) { Str *value = NULL; if (argList_) value = argList_ -> find(name); if (!value) specErr1(S, E1_ARG_NOT_FOUND, name); buffer = (char*)*value; } // if opening for write access, just allocate a new dynamic block else outBuf = new DynBlock; }; break; default: { // try the extending scheme handler // ask the handler address from the Processor Processor *proc = S.getProcessor(); if (proc) handler = proc->getSchemeHandler(&handlerUD); else handler = NULL; // if there is no handler, report unsupported scheme if (!handler) specErr1(S, E1_UNSUPPORTED_SCHEME, strScheme); // try the fast way int count = 0; buffer = NULL; if (_mode == DLMODE_READ && handler -> getAll) handler -> getAll(handlerUD, proc, strScheme, name, &buffer, &count); if (buffer && (count != -1)) { gotWholeDocument = TRUE; bufCurr = 0; } else { // call the handler's open() function, obtaining a handle switch(handler -> open(handlerUD, proc, strScheme, name, &handle)) { case SH_ERR_UNSUPPORTED_SCHEME: // scheme not supported specErr1(S, E1_UNSUPPORTED_SCHEME, strScheme); case SH_ERR_NOT_OK: specErr1(S, E1_URI_OPEN, strScheme + ":" + strPath); }; } }; }; // open successfully completed. Set the new mode. mode = _mode; return OK; }