void SkinParser::getRefDimensions( int &rWidth, int &rHeight, bool toScreen ) { if( toScreen ) { OSFactory *pOsFactory = OSFactory::instance( getIntf() ); rWidth = pOsFactory->getScreenWidth(); rHeight = pOsFactory->getScreenHeight(); return; } string panelId = m_panelStack.back(); if( panelId != "none" ) { list<BuilderData::Panel>::const_iterator it; for( it = m_pData->m_listPanel.begin(); it != m_pData->m_listPanel.end(); ++it ) { if( it->m_id == panelId ) { rWidth = it->m_width; rHeight = it->m_height; return; } } } else { const BuilderData::Layout layout = m_pData->m_listLayout.back(); rWidth = layout.m_width; rHeight = layout.m_height; return; } msg_Err( getIntf(), "failure to retrieve parent panel or layout" ); }
void Tooltip::CmdShow::execute() { if( m_pParent->m_pImage ) { if( m_pParent->m_xPos == -1 ) { // Get the mouse coordinates and the image size OSFactory *pOsFactory = OSFactory::instance( m_pParent->getIntf() ); int x, y; pOsFactory->getMousePos( x, y ); int scrWidth = pOsFactory->getScreenWidth(); int scrHeight = pOsFactory->getScreenHeight(); int w = m_pParent->m_pImage->getWidth(); int h = m_pParent->m_pImage->getHeight(); // Compute the position of the tooltip x -= (w / 2 + 4); y += (h + 5); if( x + w > scrWidth ) x -= (x + w - scrWidth); else if( x < 0 ) x = 0; if( y + h > scrHeight ) y -= (2 * h + 20); m_pParent->m_xPos = x; m_pParent->m_yPos = y; } // Show the tooltip window m_pParent->m_pOsTooltip->show( m_pParent->m_xPos, m_pParent->m_yPos, *(m_pParent->m_pImage) ); } }
VoutManager::VoutManager( intf_thread_t *pIntf ): SkinObject( pIntf ), m_pCtrlVideoVec(), m_pCtrlVideoVecBackup(), m_SavedWndVec(), m_pVoutMainWindow( NULL ), m_pFscWindow( NULL ) { m_pVoutMainWindow = new VoutMainWindow( getIntf() ); OSFactory *pOsFactory = OSFactory::instance( getIntf() ); int width = pOsFactory->getScreenWidth(); int height = pOsFactory->getScreenHeight(); m_pVoutMainWindow->move( 0, 0 ); m_pVoutMainWindow->resize( width, height ); VarBool &rFullscreen = VlcProc::instance( getIntf() )->getFullscreenVar(); rFullscreen.addObserver( this ); }
const int SkinParser::getRefHeight( bool toScreen ) { if( toScreen ) { OSFactory *pOsFactory = OSFactory::instance( getIntf() ); return pOsFactory->getScreenHeight(); } string panelId = m_panelStack.back(); if( panelId != "none" ) { const BuilderData::Panel panel = m_pData->m_listPanel.back(); return panel.m_height; } else { const BuilderData::Layout layout = m_pData->m_listLayout.back(); return layout.m_height; } }
void X11DragDrop::dndPosition( ldata_t data ) { Window src = data[0]; Time time = data[2]; Atom selectionAtom = XInternAtom( XDISPLAY, "XdndSelection", 0 ); Atom targetAtom = XInternAtom( XDISPLAY, "text/plain", 0 ); Atom propAtom = XInternAtom( XDISPLAY, "VLC_SELECTION", 0 ); Atom actionAtom = XInternAtom( XDISPLAY, "XdndActionCopy", 0 ); Atom typeAtom = XInternAtom( XDISPLAY, "XdndFinished", 0 ); // Convert the selection into the given target // NEEDED or it doesn't work! XConvertSelection( XDISPLAY, selectionAtom, targetAtom, propAtom, src, time ); actionAtom = XInternAtom( XDISPLAY, "XdndActionCopy", 0 ); typeAtom = XInternAtom( XDISPLAY, "XdndStatus", 0 ); XEvent event; event.type = ClientMessage; event.xclient.window = src; event.xclient.display = XDISPLAY; event.xclient.message_type = typeAtom; event.xclient.format = 32; event.xclient.data.l[0] = m_wnd; // Accept the drop (1), or not (0). event.xclient.data.l[1] = m_target != None ? 1 : 0; OSFactory *pOsFactory = X11Factory::instance( getIntf() ); int w = pOsFactory->getScreenWidth(); int h = pOsFactory->getScreenHeight(); event.xclient.data.l[2] = 0; event.xclient.data.l[3] = (w << 16) | h; event.xclient.data.l[4] = actionAtom; // Tell the source whether we accept the drop XSendEvent( XDISPLAY, src, False, 0, &event ); }