DetachTabButton::DetachTabButton(TabAbstract * tab) : QPushButton(tab) { curtab = tab; setIcon(QIcon(":/Images/icons/tab-duplicate-2.png")); setFlat(true); setMaximumWidth(25); setToolTip(tr("Detach/attach tab")); connect(this, SIGNAL(clicked()), curtab, SLOT(onDetach())); }
bool WINAPI DllMain (HMODULE dll, DWORD reason, LPVOID reserved) { switch (reason) { case DLL_PROCESS_ATTACH: onAttach(); break; case DLL_PROCESS_DETACH: onDetach(); break; } return true; }
void Container::detach(Element * const element) { if(element != nullptr) { ResetFocus(); for (auto childPtrIt = _children.begin(); childPtrIt != _children.end(); ++childPtrIt) { if (childPtrIt->get() == element) { (*childPtrIt)->_upper = nullptr; onDetach(childPtrIt->get()); _children.erase(childPtrIt); return; } } } requestLayout(); }
void BaseNode::detachAllNodes() { updateVersion(); for(size_t i=0;i<m_Children.size();i++) { BaseNode * pChild = m_Children[ i ]; if (! pChild ) continue; // inform the child it is being detached pChild->onDetaching(); // inform ourselves onDetach( pChild ); // set the parent pointer to NULL pChild->m_pParent = NULL; } m_Children.clear(); // notify this object that a child object has been detached onChildDetached(); }
void BaseNode::detachNodeSwap( int nChild ) { if ( nChild >= 0 && nChild < (int)m_Children.size() ) { updateVersion(); BaseNode * pChild = m_Children[ nChild ]; if ( pChild != NULL ) { // inform the child it is being detached pChild->onDetaching(); // inform ourselves onDetach( pChild ); // null the parent pointer and remove from the child list pChild->m_pParent = NULL; } removeSwapIndex( m_Children, nChild ); // notify this object that a child object has been detached onChildDetached(); } }
void UnitSAO::setAttachment(int parent_id, const std::string &bone, v3f position, v3f rotation) { // Attachments need to be handled on both the server and client. // If we just attach on the server, we can only copy the position of the parent. Attachments // are still sent to clients at an interval so players might see them lagging, plus we can't // read and attach to skeletal bones. // If we just attach on the client, the server still sees the child at its original location. // This breaks some things so we also give the server the most accurate representation // even if players only see the client changes. int old_parent = m_attachment_parent_id; m_attachment_parent_id = parent_id; m_attachment_bone = bone; m_attachment_position = position; m_attachment_rotation = rotation; m_attachment_sent = false; if (parent_id != old_parent) { onDetach(old_parent); onAttach(parent_id); } }
void BaseNode::detachNode( int child ) { ASSERT( this != NULL ); if ( child >= 0 && child < (int)m_Children.size() ) { updateVersion(); BaseNode * pChild = m_Children[ child ]; if ( pChild != NULL ) { // inform the child it is being detached pChild->onDetaching(); // inform ourselves onDetach( pChild ); // null the parent pointer and remove from the child list pChild->m_pParent = NULL; } m_Children.erase( m_Children.begin() + child ); // notify this object that a child object has been detached onChildDetached(); } }
void Recorder::messagePump() { XnStatus nRetVal = XN_STATUS_OK; Message msg = { Message::MESSAGE_NO_OPERATION, 0, NULL, {NULL}, 0, 0 }; { xnl::LockGuard<MessageQueue> guard(m_queue); nRetVal = m_queue.Pop(msg); } if (XN_STATUS_OK == nRetVal) { switch (msg.type) { case Message::MESSAGE_INITIALIZE: { onInitialize(); } break; case Message::MESSAGE_TERMINATE: { onTerminate(); m_running = FALSE; } break; case Message::MESSAGE_ATTACH: { xnl::LockGuard<AttachedStreams> streamsGuard(m_streams); AttachedStreams::Iterator i = m_streams.Find(msg.pStream); if (i != m_streams.End()) { onAttach(i->Value().nodeId, msg.pStream); } } break; case Message::MESSAGE_DETACH: { xnl::LockGuard<AttachedStreams> streamsGuard(m_streams); AttachedStreams::Iterator i = m_streams.Find(msg.pStream); if (i != m_streams.End()) { onDetach(i->Value().nodeId); XN_DELETE(m_streams[msg.pStream].pCodec); m_streams.Remove(msg.pStream); } } break; case Message::MESSAGE_START: { xnl::LockGuard<AttachedStreams> streamsGuard(m_streams); for (AttachedStreams::Iterator i = m_streams.Begin(), e = m_streams.End(); i != e; ++i) { onStart(i->Value().nodeId); } m_started = true; } break; case Message::MESSAGE_RECORD: { xnl::LockGuard<AttachedStreams> streamsGuard(m_streams); AttachedStreams::Iterator i = m_streams.Find(msg.pStream); if (i != m_streams.End()) { XnCodecBase* pCodec = m_streams[msg.pStream].pCodec; XnUInt32 frameId = ++m_streams[msg.pStream].frameId; XnUInt64 timestamp = 0; if (frameId > 1) { timestamp = m_streams[msg.pStream].lastOutputTimestamp + (msg.pFrame->timestamp - m_streams[msg.pStream].lastInputTimestamp); } m_streams[msg.pStream].lastInputTimestamp = msg.pFrame->timestamp; m_streams[msg.pStream].lastOutputTimestamp = timestamp; onRecord(i->Value().nodeId, pCodec, msg.pFrame, frameId, timestamp); msg.pStream->frameRelease(msg.pFrame); } } break; case Message::MESSAGE_RECORDPROPERTY: { xnl::LockGuard<AttachedStreams> streamsGuard(m_streams); AttachedStreams::Iterator i = m_streams.Find(msg.pStream); if (i != m_streams.End()) { onRecordProperty( i->Value().nodeId, msg.propertyId, msg.pData, msg.dataSize); } // free the temporary buffer allocated earlier xnOSFree((void*)msg.pData); } break; default: ; } } }
bool Entity::removeSystem(const sbeID sID) { auto S = getSystem(sID); if (S) S->onDetach(*this); changed = true; return Systems.erase(sID); }