Ejemplo n.º 1
0
void IEToolbar::acquireSiteWindow(IUnknownPtr site) {
  // Query IOleWindow interface from specified site.
  IOleWindowPtr siteOLEWindow;
  const HRESULT getOleWindowResult =
      site.QueryInterface(IID_IOleWindow, &siteOLEWindow);
  if (FAILED(getOleWindowResult)) {
    throw _com_error(getOleWindowResult);
  }

  // Retrieve handle of site window.
  HWND siteWindowHandle = 0;
  const HRESULT getWindowResult = siteOLEWindow->GetWindow(&siteWindowHandle);
  if (FAILED(getWindowResult)) {
    throw _com_error(getWindowResult);
  }

  // Attach MFC-wrapper to site window.
  const BOOL attachResult = siteWindow_.Attach(siteWindowHandle);
  if (FALSE == attachResult) {
    throw Error("Failed to attach to site window handle\n");
  }

  // Subclass site window to retrieve its messages.
  subclassWindow(siteWindow_.GetSafeHwnd());
}
Ejemplo n.º 2
0
LRESULT CALLBACK Interpreter::CbtFilterHook(int code, WPARAM wParam, LPARAM lParam)
{
	// Looking for HCBT_CREATEWND, just pass others on...
	if (code == HCBT_CREATEWND)
	{
		//ASSERT(lParam != NULL);
		//LPCREATESTRUCT lpcs = ((LPCBT_CREATEWND)lParam)->lpcs;
		//ASSERT(lpcs != NULL);

		OTE* underConstruction = m_oteUnderConstruction;

		if (!underConstruction->isNil())
		{
			// Nil this out as soon as possible
			m_oteUnderConstruction = Pointers.Nil;
			underConstruction->countDown();

			ASSERT(wParam != NULL); // should be non-NULL HWND

			// set m_bDlgCreate to TRUE if it is a dialog box
			//  (this controls what kind of subclassing is done later)
			//pThreadState->m_bDlgCreate = (lpcs->lpszClass == WC_DIALOG);

			// Pass to Smalltalk for subclassing (catch unwind failures so not thrown out)
			subclassWindow(underConstruction, HWND(wParam));
		}
	}

	return ::CallNextHookEx(hHookOldCbtFilter, code, wParam, lParam);
}
Ejemplo n.º 3
0
SurfaceD3D::SurfaceD3D(egl::Display *display, const egl::Config *config, EGLint width, EGLint height,
                       EGLint fixedSize, EGLint postSubBufferSupported, EGLenum textureFormat,
                       EGLenum textureType, EGLClientBuffer shareHandle, EGLNativeWindowType window)
    : SurfaceImpl(display, config, width, height, fixedSize, postSubBufferSupported, textureFormat, textureType, shareHandle),
      mRenderer(static_cast<rx::RendererD3D*>(mDisplay->getRenderer())),
      mSwapChain(NULL),
      mWindowSubclassed(false),
      mNativeWindow(window)
{
    subclassWindow();
}
Ejemplo n.º 4
0
SurfaceD3D::SurfaceD3D(RendererD3D *renderer, egl::Display *display, const egl::Config *config, EGLint width, EGLint height,
                       EGLint fixedSize, EGLint postSubBufferSupported, EGLenum textureFormat,
                       EGLenum textureType, EGLClientBuffer shareHandle, EGLNativeWindowType window)
    : SurfaceImpl(display, config, fixedSize, postSubBufferSupported, textureFormat, textureType),
      mRenderer(renderer),
      mSwapChain(NULL),
      mSwapIntervalDirty(true),
      mWindowSubclassed(false),
      mNativeWindow(window),
      mWidth(width),
      mHeight(height),
      mSwapInterval(1),
      mShareHandle(reinterpret_cast<HANDLE*>(shareHandle))
{
    subclassWindow();
}
Ejemplo n.º 5
0
Surface::Surface(Display *display, const Config *config, HWND window) 
    : mDisplay(display), mConfig(config), mWindow(window)
{
    mSwapChain = NULL;
    mDepthStencil = NULL;
    mRenderTarget = NULL;
    mOffscreenTexture = NULL;
    mShareHandle = NULL;

    mPixelAspectRatio = (EGLint)(1.0 * EGL_DISPLAY_SCALING);   // FIXME: Determine actual pixel aspect ratio
    mRenderBuffer = EGL_BACK_BUFFER;
    mSwapBehavior = EGL_BUFFER_PRESERVED;
    mSwapInterval = -1;
    setSwapInterval(1);

    subclassWindow();
    resetSwapChain();
}
Ejemplo n.º 6
0
SurfaceD3D::SurfaceD3D(RendererD3D *renderer, egl::Display *display, const egl::Config *config, EGLint width, EGLint height, EGLint fixedSize,
                       EGLClientBuffer shareHandle, EGLNativeWindowType window)
    : SurfaceImpl(),
      mRenderer(renderer),
      mDisplay(display),
      mFixedSize(fixedSize == EGL_TRUE),
      mRenderTargetFormat(config->renderTargetFormat),
      mDepthStencilFormat(config->depthStencilFormat),
      mSwapChain(nullptr),
      mSwapIntervalDirty(true),
      mWindowSubclassed(false),
      mNativeWindow(window),
      mWidth(width),
      mHeight(height),
      mSwapInterval(1),
      mShareHandle(reinterpret_cast<HANDLE*>(shareHandle))
{
    subclassWindow();
}
Ejemplo n.º 7
0
Surface::Surface(Display *display, const Config *config, HWND window, EGLint postSubBufferSupported) 
    : mDisplay(display), mConfig(config), mWindow(window), mPostSubBufferSupported(postSubBufferSupported)
{
    mRenderer = mDisplay->getRenderer();
    mSwapChain = NULL;
    mShareHandle = NULL;
    mTexture = NULL;
    mTextureFormat = EGL_NO_TEXTURE;
    mTextureTarget = EGL_NO_TEXTURE;

    mPixelAspectRatio = (EGLint)(1.0 * EGL_DISPLAY_SCALING);   // FIXME: Determine actual pixel aspect ratio
    mRenderBuffer = EGL_BACK_BUFFER;
    mSwapBehavior = EGL_BUFFER_PRESERVED;
    mSwapInterval = -1;
    mWidth = -1;
    mHeight = -1;
    setSwapInterval(1);

    subclassWindow();
}
Ejemplo n.º 8
0
Surface::Surface(Display *display, const Config *config, EGLNativeWindowType window, EGLint fixedSize, EGLint width, EGLint height, EGLint postSubBufferSupported) 
    : mDisplay(display), mConfig(config), mNativeWindow(window, display->getDisplayId()), mPostSubBufferSupported(postSubBufferSupported)
{
    //TODO(jmadill): MANGLE refactor. (note, can't call makeRendererD3D because of dll export issues)
    mRenderer = static_cast<rx::RendererD3D*>(mDisplay->getRenderer());
    mSwapChain = NULL;
    mShareHandle = NULL;
    mTexture = NULL;
    mTextureFormat = EGL_NO_TEXTURE;
    mTextureTarget = EGL_NO_TEXTURE;

    mPixelAspectRatio = (EGLint)(1.0 * EGL_DISPLAY_SCALING);   // FIXME: Determine actual pixel aspect ratio
    mRenderBuffer = EGL_BACK_BUFFER;
    mSwapBehavior = EGL_BUFFER_PRESERVED;
    mSwapInterval = -1;
    mWidth = width;
    mHeight = height;
    mFixedWidth = mWidth;
    mFixedHeight = mHeight;
    setSwapInterval(1);
    mFixedSize = fixedSize;

    subclassWindow();
}