Exemplo n.º 1
0
//---------------------------------------------------------------------
void CFlashDXPlayer::ResizePlayer(unsigned int newWidth, unsigned int newHeight)
{
	IOleInPlaceObject* pInPlaceObject = NULL;
	m_oleObject->QueryInterface(__uuidof(IOleInPlaceObject), (LPVOID*) &pInPlaceObject);

	if (pInPlaceObject != NULL)
	{
		RECT rect = { 0, 0, newWidth, newHeight };
		pInPlaceObject->SetObjectRects(&rect, &rect);
		pInPlaceObject->Release();

		m_width = newWidth;
		m_height = newHeight;

		AddDirtyRect(NULL);
	}

	if (m_alphaBlackDC)
	{
		DeleteDC(m_alphaBlackDC);
		DeleteObject(m_alphaBlackBitmap);
		DeleteDC(m_alphaWhiteDC);
		DeleteObject(m_alphaWhiteBitmap);

		m_alphaBlackDC = NULL;
		m_alphaBlackBitmap = NULL;
		m_alphaBlackBuffer = NULL;
		m_alphaWhiteDC = NULL;
		m_alphaWhiteBitmap = NULL;
		m_alphaWhiteBuffer = NULL;
	}
}
Exemplo n.º 2
0
	void on_message( UINT msg,WPARAM wp,LPARAM lp ){
		if( msg==WM_SIZE ){
			RECT rect;
			GetClientRect( hwnd,&rect );
			inPlaceObject->SetObjectRects( &rect,&rect );
		}
	}
Exemplo n.º 3
0
void WINAPI duFlash::Resize(LPRECT lpRect)
{
	duHwndObj::Resize(lpRect);
	
	duRect rcFlash;
	GetRect(&rcFlash);
	
	IOleInPlaceObject *pInPlaceObject = NULL;
	if (m_pFlash && SUCCEEDED(m_pFlash->QueryInterface(IID_IOleInPlaceObject,(void**)&pInPlaceObject)))
	{
		pInPlaceObject->SetObjectRects(&rcFlash, &rcFlash);
		pInPlaceObject->Release();
	}
}
Exemplo n.º 4
0
void FlashControl::setSize(int _width, int _height)
{
	width = _width;
	height = _height;

	renderBuffer->reserve(width, height);

	IOleInPlaceObject* inPlaceObject = 0;
	oleObject->QueryInterface(__uuidof(IOleInPlaceObject), (LPVOID*)&inPlaceObject);

	if (inPlaceObject)
	{
		invalidateTotally();
		inPlaceObject->SetObjectRects(&dirtyBounds, &dirtyBounds);
		inPlaceObject->Release();
	}

}
Exemplo n.º 5
0
void nekoFlashInstance::OnSizeUpdated(int32 width, int32 height)
{
    if(!mOleObject)
        return;

    mTexture = NULL;
    mTexture = nekoNew nekoHWTexture(GetNekoNovel()->GetHWResourceManager(), width, height);
    mTexture->Refresh();

    IOleInPlaceObject* inPlaceObject = 0;
    mOleObject->QueryInterface(__uuidof(IOleInPlaceObject), (LPVOID*)&inPlaceObject);

    if(inPlaceObject)
    {
        InvalidateTotally();

        inPlaceObject->SetObjectRects(&mDirtyBounds, &mDirtyBounds);
        inPlaceObject->Release();
    }
}
Exemplo n.º 6
0
// @pymethod |PyIOleInPlaceObject|SetObjectRects|Description of SetObjectRects.
PyObject *PyIOleInPlaceObject::SetObjectRects(PyObject *self, PyObject *args)
{
	IOleInPlaceObject *pIOIPO = GetI(self);
	if ( pIOIPO == NULL )
		return NULL;
	RECT PosRect;
	RECT ClipRect;
	if ( !PyArg_ParseTuple(args, "(llll)(llll):SetObjectRects", 
		&PosRect.left, &PosRect.top, &PosRect.right, &PosRect.bottom, 
		&ClipRect.left, &ClipRect.top, &ClipRect.right, &ClipRect.bottom))
		return NULL;
	HRESULT hr;
	PY_INTERFACE_PRECALL;
	hr = pIOIPO->SetObjectRects( &PosRect, &ClipRect );
	PY_INTERFACE_POSTCALL;
	if ( FAILED(hr) )
		return OleSetOleError(hr);
	Py_INCREF(Py_None);
	return Py_None;

}
Exemplo n.º 7
0
void WebBrowserContainer::UpdateRect()
{
	IOleInPlaceObject* oleInPlaceObject = NULL;
	HRESULT hRes = this->webBrowser->QueryInterface(IID_IOleInPlaceObject, (void**)&oleInPlaceObject);
	if (FAILED(hRes))
	{
		Logger::Error("WebBrowserContainer::SetSize(), IOleObject::QueryInterface(IID_IOleInPlaceObject) failed!, error code %i", hRes);
		return;
	}

	// Update the browser window according to the holder window.
	RECT rect = {0};
	GetClientRect(this->hwnd, &rect);

	hRes = oleInPlaceObject->SetObjectRects(&rect, &rect);
	if (FAILED(hRes))
	{
		Logger::Error("WebBrowserContainer::SetSize(), IOleObject::SetObjectRects() failed!, error code %i", hRes);
		return;
	}

	oleInPlaceObject->Release();
}
Exemplo n.º 8
0
void FlashControl::createControl(HMODULE _lib)
{
	site = new FlashSite();
	site->AddRef();	
	site->Init(this);
	
	// Try to load from user-supplied Flash OCX first
	if (_lib)
	{
		typedef HRESULT (__stdcall *GetClassObject)(REFCLSID rclsid, REFIID riid, LPVOID * ppv); 

		IClassFactory* factory = 0;
		GetClassObject getClassFunc = (GetClassObject)GetProcAddress(_lib, "DllGetClassObject");
		HRESULT result = getClassFunc(ShockwaveFlashObjects::CLSID_ShockwaveFlash, IID_IClassFactory, (void**)&factory);
		if (SUCCEEDED(result))
		{
			factory->CreateInstance(NULL, IID_IOleObject, (void**)&oleObject);
			factory->Release();	
		}
	}

	// If we still don't have the object, try loading from registry
	if (!oleObject)
	{
		HRESULT result = CoCreateInstance(ShockwaveFlashObjects::CLSID_ShockwaveFlash, 0, CLSCTX_INPROC_SERVER, IID_IOleObject, (void**)&oleObject);
		if (FAILED(result))
		{
			MYGUI_EXCEPT("Unable to load the Flash ActiveX control.");
		}
	}

	IOleClientSite* clientSite = 0;
	site->QueryInterface(__uuidof(IOleClientSite), (void**)&clientSite);
	oleObject->SetClientSite(clientSite);
	clientSite->Release();

	IOleInPlaceObject* inPlaceObject = 0;	
	oleObject->QueryInterface(__uuidof(IOleInPlaceObject), (LPVOID*)&inPlaceObject);			

	if (inPlaceObject)
	{
		invalidateTotally();

		inPlaceObject->SetObjectRects(&dirtyBounds, &dirtyBounds);
		inPlaceObject->Release();
	}

	oleObject->QueryInterface(__uuidof(ShockwaveFlashObjects::IShockwaveFlash), (LPVOID*)&flashInterface);

	flashInterface->PutWMode("opaque");

	oleObject->DoVerb(OLEIVERB_INPLACEACTIVATE, 0, clientSite, 0, 0, 0);
	clientSite->Release();	
		
	oleObject->QueryInterface(__uuidof(IOleInPlaceObjectWindowless), (LPVOID*)&windowlessObject);
			
	handler = new FlashHandler();
	handler->AddRef();	
	handler->Init(this);

	IViewObject* curView = 0;
	flashInterface->QueryInterface(IID_IViewObject, (void**)&curView);
}
void FlashControl::createControl()
{
	site = new Impl::FlashSite();
	site->AddRef();	
	site->Init(this);
	
	HMODULE flashLib = HikariManager::Get().flashLib;
	
	// Try to load from user-supplied Flash OCX first
	if(flashLib)
	{
		IClassFactory* factory = 0;
		GetClassObject getClassFunc = (GetClassObject)GetProcAddress(flashLib, "DllGetClassObject");
		HRESULT result = getClassFunc(ShockwaveFlashObjects::CLSID_ShockwaveFlash, IID_IClassFactory, (void**)&factory);
		if(SUCCEEDED(result))
		{
			factory->CreateInstance(NULL, IID_IOleObject, (void**)&oleObject);
			factory->Release();	
		}
	}

	// If we still don't have the object, try loading from registry
	if(!oleObject)
	{
		HRESULT result = CoCreateInstance(ShockwaveFlashObjects::CLSID_ShockwaveFlash, 0, CLSCTX_INPROC_SERVER, IID_IOleObject, (void**)&oleObject);
		if(FAILED(result))
			OGRE_EXCEPT(Ogre::Exception::ERR_RT_ASSERTION_FAILED, "Unable to load the Flash ActiveX control.", "FlashControl::createControl");
	}

	IOleClientSite* clientSite = 0;
	site->QueryInterface(__uuidof(IOleClientSite), (void**)&clientSite);
	oleObject->SetClientSite(clientSite);
	clientSite->Release();

	IOleInPlaceObject* inPlaceObject = 0;	
	oleObject->QueryInterface(__uuidof(IOleInPlaceObject), (LPVOID*)&inPlaceObject);			

	if(inPlaceObject)
	{
		invalidateTotally();

		inPlaceObject->SetObjectRects(&dirtyBounds, &dirtyBounds);
		inPlaceObject->Release();
	}

	oleObject->QueryInterface(__uuidof(ShockwaveFlashObjects::IShockwaveFlash), (LPVOID*)&flashInterface);

	flashInterface->PutWMode("opaque");

	oleObject->DoVerb(OLEIVERB_INPLACEACTIVATE, 0, clientSite, 0, 0, 0);
	clientSite->Release();	
		
	oleObject->QueryInterface(__uuidof(IOleInPlaceObjectWindowless), (LPVOID*)&windowlessObject);
			
	handler = new Impl::FlashHandler();
	handler->AddRef();	
	handler->Init(this);

	IViewObject* curView = 0;
	flashInterface->QueryInterface(IID_IViewObject, (void**)&curView);
}