void MenuSelection::selectClass(Character* c) { if (c != _selected_class) { _selected_class = c; updateClass(); } }
void Client::updateState(xcb_ewmh_connection_t* ewmhConn) { xcb_connection_t* conn = ewmhConn->connection; xcb_get_geometry_cookie_t geomCookie; if (!mOwned) geomCookie = xcb_get_geometry_unchecked(conn, mWindow); const xcb_get_property_cookie_t normalHintsCookie = xcb_icccm_get_wm_normal_hints(conn, mWindow); const xcb_get_property_cookie_t leaderCookie = xcb_get_property(conn, 0, mWindow, Atoms::WM_CLIENT_LEADER, XCB_ATOM_WINDOW, 0, 1); const xcb_get_property_cookie_t transientCookie = xcb_icccm_get_wm_transient_for(conn, mWindow); const xcb_get_property_cookie_t hintsCookie = xcb_icccm_get_wm_hints(conn, mWindow); const xcb_get_property_cookie_t classCookie = xcb_icccm_get_wm_class(conn, mWindow); const xcb_get_property_cookie_t nameCookie = xcb_icccm_get_wm_name(conn, mWindow); const xcb_get_property_cookie_t protocolsCookie = xcb_icccm_get_wm_protocols(conn, mWindow, Atoms::WM_PROTOCOLS); const xcb_get_property_cookie_t strutCookie = xcb_ewmh_get_wm_strut(ewmhConn, mWindow); const xcb_get_property_cookie_t partialStrutCookie = xcb_ewmh_get_wm_strut_partial(ewmhConn, mWindow); const xcb_get_property_cookie_t stateCookie = xcb_ewmh_get_wm_state(ewmhConn, mWindow); const xcb_get_property_cookie_t typeCookie = xcb_ewmh_get_wm_window_type(ewmhConn, mWindow); const xcb_get_property_cookie_t pidCookie = xcb_ewmh_get_wm_pid(ewmhConn, mWindow); if (!mOwned) updateSize(conn, geomCookie); updateNormalHints(conn, normalHintsCookie); updateLeader(conn, leaderCookie); updateTransient(conn, transientCookie); updateHints(conn, hintsCookie); updateClass(conn, classCookie); updateName(conn, nameCookie); updateProtocols(conn, protocolsCookie); updateStrut(ewmhConn, strutCookie); updatePartialStrut(ewmhConn, partialStrutCookie); updateEwmhState(ewmhConn, stateCookie); updateWindowTypes(ewmhConn, typeCookie); updatePid(ewmhConn, pidCookie); }
void Client::propertyNotify(xcb_atom_t atom) { #warning Need to notify js that properties have changed warning() << "Got propertyNotify" << Atoms::name(atom) << mWindow; auto ewmhConnection = WindowManager::instance()->ewmhConnection(); auto conn = ewmhConnection->connection; if (atom == XCB_ATOM_WM_NORMAL_HINTS) { const xcb_get_property_cookie_t normalHintsCookie = xcb_icccm_get_wm_normal_hints(conn, mWindow); updateNormalHints(conn, normalHintsCookie); } else if (atom == XCB_ATOM_WM_TRANSIENT_FOR) { const xcb_get_property_cookie_t transientCookie = xcb_icccm_get_wm_transient_for(conn, mWindow); updateTransient(conn, transientCookie); } else if (atom == Atoms::WM_CLIENT_LEADER) { const xcb_get_property_cookie_t leaderCookie = xcb_get_property(conn, 0, mWindow, Atoms::WM_CLIENT_LEADER, XCB_ATOM_WINDOW, 0, 1); updateLeader(conn, leaderCookie); } else if (atom == XCB_ATOM_WM_HINTS) { const xcb_get_property_cookie_t hintsCookie = xcb_icccm_get_wm_hints(conn, mWindow); updateHints(conn, hintsCookie); } else if (atom == XCB_ATOM_WM_CLASS) { const xcb_get_property_cookie_t classCookie = xcb_icccm_get_wm_class(conn, mWindow); updateClass(conn, classCookie); } else if (atom == XCB_ATOM_WM_NAME) { const xcb_get_property_cookie_t nameCookie = xcb_icccm_get_wm_name(conn, mWindow); updateName(conn, nameCookie); } else if (atom == Atoms::WM_PROTOCOLS) { const xcb_get_property_cookie_t protocolsCookie = xcb_icccm_get_wm_protocols(conn, mWindow, Atoms::WM_PROTOCOLS); updateProtocols(conn, protocolsCookie); } else if (atom == ewmhConnection->_NET_WM_STRUT) { const xcb_get_property_cookie_t strutCookie = xcb_ewmh_get_wm_strut(ewmhConnection, mWindow); updateStrut(ewmhConnection, strutCookie); } else if (atom == ewmhConnection->_NET_WM_STRUT_PARTIAL) { const xcb_get_property_cookie_t partialStrutCookie = xcb_ewmh_get_wm_strut_partial(ewmhConnection, mWindow); updatePartialStrut(ewmhConnection, partialStrutCookie); } else if (atom == ewmhConnection->_NET_WM_STATE) { const xcb_get_property_cookie_t stateCookie = xcb_ewmh_get_wm_state(ewmhConnection, mWindow); updateEwmhState(ewmhConnection, stateCookie); } else if (atom == ewmhConnection->_NET_WM_WINDOW_TYPE) { const xcb_get_property_cookie_t typeCookie = xcb_ewmh_get_wm_window_type(ewmhConnection, mWindow); updateWindowTypes(ewmhConnection, typeCookie); } else if (atom == ewmhConnection->_NET_WM_PID) { const xcb_get_property_cookie_t pidCookie = xcb_ewmh_get_wm_pid(ewmhConnection, mWindow); updatePid(ewmhConnection, pidCookie); } else { warning() << "Unhandled propertyNotify atom" << Atoms::name(atom); } }
int testindex::execute() { size_t mVerifyCnt = 0; size_t bSuccess = 0; if(!MVTApp::startStore()) { mLogger.out()<<"failed to start store...\n"; return -1; } if((lsession = MVTApp::startSession())==NULL){ mLogger.out()<<"failed to create session....\n"; return -1; } CStoreInfo indexInfo_bef(lsession),indexInfo_aft(lsession); std::stringstream ft_bef,ft_aft; //get class details before rebuild mLogger.out()<<"Store Scan in progress....\n"; indexInfo_bef.storeScan(); mLogger.out()<<"DONE..\n\n"; mLogger.out()<<"FT scan in progress.....\n"; indexInfo_bef.ftScan(ft_bef); mLogger.out()<<"DONE...\n\n"; //rebuild ALL classes and ftindex. mLogger.out()<<"Store rebuild in progres....\n"; TVERIFYRC(updateClass(lsession,NULL,NULL)); TVERIFYRC(lsession->rebuildIndexFT()); mLogger.out()<<"DONE...\n\n"; //get class details before rebuild mLogger.out()<<"Store Scan in progress....\n"; indexInfo_aft.storeScan(); mLogger.out()<<"DONE..\n\n"; mLogger.out()<<"FT scan in progress.....\n"; indexInfo_aft.ftScan(ft_aft); mLogger.out()<<"DONE..\n\n"; //compare class results mLogger.out()<<"Validating results.....\n"; for(size_t i=0;i<indexInfo_bef.mClasses.size();i++) { TVERIFY(indexInfo_bef.mClasses[i]->mClassID == indexInfo_aft.mClasses[i]->mClassID); //mLogger.out()<<"DataEventID:"<<indexInfo_bef.mClasses[i]->mClassID<<"\t"; TVERIFY(indexInfo_bef.mClasses[i]->mClassName == indexInfo_aft.mClasses[i]->mClassName); //mLogger.out()<<"ClassName:"<<indexInfo_bef.mClasses[i]->mClassName<<"\t"; TVERIFY(indexInfo_bef.mClasses[i]->mFamily == indexInfo_aft.mClasses[i]->mFamily); //mLogger.out()<<"IsFamily:"<<indexInfo_bef.mClasses[i]->mFamily<<"\t"; TVERIFY(indexInfo_bef.mClasses[i]->mPinCnt == indexInfo_aft.mClasses[i]->mPinCnt); //mLogger.out()<<"PIN count:"<<indexInfo_bef.mClasses[i]->mPinCnt<<"\t"; TVERIFY(indexInfo_bef.mClasses[i]->mIndexedProp == indexInfo_aft.mClasses[i]->mIndexedProp); //mLogger.out()<<"IndexedPropID:"<<indexInfo_bef.mClasses[i]->mIndexedProp<<"\n"; mLogger.out()<<"DataEventID:"<<indexInfo_bef.mClasses[i]->mClassID<<"\t"<<"verified successfully..."<<i+1<<endl; mVerifyCnt++; } //compare ft results if(ft_aft.str()== ft_bef.str()) { bSuccess = 1; mLogger.out()<<ft_aft.str()<<endl; mLogger.out()<<"Ft validation is successful..\n"; } lsession->terminate(); MVTApp::stopStore(); return bSuccess&(indexInfo_bef.mClasses.size() == mVerifyCnt?0:-1); }