当前位置: 首页>>代码示例>>C++>>正文


C++ CefWindowInfo::SetTransparentPainting方法代码示例

本文整理汇总了C++中CefWindowInfo::SetTransparentPainting方法的典型用法代码示例。如果您正苦于以下问题:C++ CefWindowInfo::SetTransparentPainting方法的具体用法?C++ CefWindowInfo::SetTransparentPainting怎么用?C++ CefWindowInfo::SetTransparentPainting使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CefWindowInfo的用法示例。


在下文中一共展示了CefWindowInfo::SetTransparentPainting方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: NewWindow

TSharedPtr<IWebBrowserWindow> FWebBrowserSingleton::CreateBrowserWindow(void* OSWindowHandle, FString InitialURL, uint32 Width, uint32 Height, bool bUseTransparency, TOptional<FString> ContentsToLoad, bool ShowErrorMessage)
{
#if WITH_CEF3
	// Create new window
	TSharedPtr<FWebBrowserWindow> NewWindow(new FWebBrowserWindow(FIntPoint(Width, Height), InitialURL, ContentsToLoad, ShowErrorMessage));

	// WebBrowserHandler implements browser-level callbacks.
	CefRefPtr<FWebBrowserHandler> NewHandler(new FWebBrowserHandler);
	NewWindow->SetHandler(NewHandler);

	// Information used when creating the native window.
	CefWindowHandle WindowHandle = (CefWindowHandle)OSWindowHandle; // TODO: check this is correct for all platforms
	CefWindowInfo WindowInfo;

	// Always use off screen rendering so we can integrate with our windows
	WindowInfo.SetAsOffScreen(WindowHandle);
	WindowInfo.SetTransparentPainting(bUseTransparency);

	// Specify CEF browser settings here.
	CefBrowserSettings BrowserSettings;

	CefString URL = *InitialURL;

	// Create the CEF browser window.
	if (CefBrowserHost::CreateBrowser(WindowInfo, NewHandler.get(), URL, BrowserSettings, NULL))
	{
		WindowInterfaces.Add(NewWindow);
		return NewWindow;
	}
#endif
	return NULL;
}
开发者ID:johndpope,项目名称:UE4,代码行数:32,代码来源:WebBrowserSingleton.cpp

示例2: AddWebView

void AddWebView(CefWindowHandle parent, RECT windowRect, char* url, Settings* settings) {
  CefWindowInfo windowInfo;
  windowInfo.SetAsChild(parent, windowRect);
  windowInfo.SetTransparentPainting(true);
  g_handler->browserSettings_.web_security_disabled = settings->getBoolean("disableSecurity", false);
  CefBrowser::CreateBrowser(windowInfo, static_cast<CefRefPtr<CefClient>>(g_handler), url, g_handler->browserSettings_);
}
开发者ID:Houfeng,项目名称:appjs,代码行数:7,代码来源:native_window_win.cpp

示例3: NPP_SetWindowImpl

NPError NPP_SetWindowImpl(NPP instance, NPWindow* window_info) {
  if (instance == NULL)
    return NPERR_INVALID_INSTANCE_ERROR;

  if (window_info == NULL)
    return NPERR_GENERIC_ERROR;

  ClientPlugin* plugin = reinterpret_cast<ClientPlugin*>(instance->pdata);
  HWND parent_hwnd = reinterpret_cast<HWND>(window_info->window);

  if (plugin->hWnd == NULL) {
    WNDCLASS wc;
    HINSTANCE hInstance = GetModuleHandle(NULL);

    // Register the window class.
    wc.style = CS_OWNDC;
    wc.lpfnWndProc = PluginWndProc;
    wc.cbClsExtra = 0;
    wc.cbWndExtra = 0;
    wc.hInstance = hInstance;
    wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
    wc.hCursor = LoadCursor(NULL, IDC_ARROW);
    wc.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);
    wc.lpszMenuName = NULL;
    wc.lpszClassName = L"ClientOSRPlugin";
    RegisterClass(&wc);

    // Create the main window.
    plugin->hWnd = CreateWindow(L"ClientOSRPlugin", L"Client OSR Plugin",
        WS_CHILD|WS_CLIPCHILDREN|WS_CLIPSIBLINGS, 0, 0, 0, 0, parent_hwnd, NULL,
        hInstance, NULL);

    SetWindowLongPtr(plugin->hWnd, GWLP_USERDATA,
        reinterpret_cast<LONG_PTR>(plugin));

    // Enable GL drawing for the window.
    EnableGL(plugin->hWnd, &(plugin->hDC), &(plugin->hRC));

    // Create the off-screen rendering window.
    CefWindowInfo windowInfo;
    CefBrowserSettings settings;
    windowInfo.SetAsOffScreen(plugin->hWnd);
    if (g_offscreenTransparent)
      windowInfo.SetTransparentPainting(TRUE);
    CefBrowser::CreateBrowser(windowInfo, new ClientOSRHandler(plugin),
        "http://www.google.com", settings);
  }

  // Position the plugin window and make sure it's visible.
  RECT parent_rect;
  GetClientRect(parent_hwnd, &parent_rect);
  SetWindowPos(plugin->hWnd, NULL, parent_rect.left, parent_rect.top,
      parent_rect.right - parent_rect.left,
      parent_rect.bottom - parent_rect.top, SWP_SHOWWINDOW);

  UpdateWindow(plugin->hWnd);
  ShowWindow(plugin->hWnd, SW_SHOW);

  return NPERR_NO_ERROR;
}
开发者ID:AlloyTeam,项目名称:webtop,代码行数:60,代码来源:osrplugin.cpp

示例4: Create

bool WindowlessBoltBrowser::Create( HWND hHostWnd )
{
	assert(hHostWnd);
	assert(::IsWindow(hHostWnd));

	CefWindowInfo info;
	info.SetAsOffScreen(hHostWnd);
	info.SetTransparentPainting(m_transparent? TRUE : FALSE);
	
	return BaseBoltBrowser::Create(info);
}
开发者ID:FlowShell,项目名称:BXF,代码行数:11,代码来源:WindowlessBoltBrowser.cpp

示例5: RunTransparentPopupTest

void RunTransparentPopupTest(CefRefPtr<CefBrowser> browser) {
  CefWindowInfo info;
  CefBrowserSettings settings;

  // Initialize window info to the defaults for a popup window
  info.SetAsPopup(NULL, "TransparentPopup");
  info.SetTransparentPainting(TRUE);
  info.m_nWidth = 500;
  info.m_nHeight = 500;

  // Creat the popup browser window
  CefBrowser::CreateBrowser(info,
      static_cast<CefRefPtr<CefClient> >(g_handler),
      "http://tests/transparency", settings);
}
开发者ID:hernad,项目名称:CEF3_windows_build,代码行数:15,代码来源:cefclient_win.cpp

示例6: ClientAppCreateBrowser

CefRefPtr< CefBrowser > ClientAppCreateBrowser(std::shared_ptr<ofxCEFBrowser> ofx, std::string startResource) {
	// OSR Browser =======================================================
	CefBrowserSettings settings;

	// Create the single static handler class instance
	HWND hWnd = WindowFromDC(wglGetCurrentDC());
	
	CefWindowInfo info;
	info.width = ofx->getWidth();
	info.height = ofx->getHeight();
	info.SetAsOffScreen(hWnd);
	info.SetTransparentPainting(true);
	//info.SetAsChild(hWnd, rect); 
	//info.SetAsPopup(hWnd, "hehe"); 

	// Create the new child browser window using an offscreen window
	auto browser =  CefBrowserHost::CreateBrowserSync(info, ofx->getClientHandler().get(), CefString(startResource), settings);

	return browser;
}
开发者ID:dublet,项目名称:ofxCEFClient,代码行数:20,代码来源:client_win.cpp

示例7: initBrowser

void BrowserClient::initBrowser(const std::string& url)
{
    //Setup our main view that will show the cef ui
    setupMainView( _width, _height );
    _viewer->addView( _mainView );

    {
        CefWindowInfo windowInfo;
        CefBrowserSettings browserSettings;

        // in linux set a gtk widget, in windows a hwnd. If not available set nullptr - may cause some render errors, in context-menu and plugins.
        windowInfo.SetAsOffScreen(0L);
        windowInfo.SetTransparentPainting(true);
        //windowInfo.SetAsWindowless(0L, true);

        _browser = CefBrowserHost::CreateBrowserSync(windowInfo, this, url.c_str(), browserSettings, 0L);
        _browser->GetHost()->SendFocusEvent(true);
    }

    addExecuteCallback(new MapExecuteCallback(this));
    _mainView->addEventHandler(new BrowserEventHandler(_mainView.get(), this, _browser));
}
开发者ID:remoe,项目名称:osgearth-cef,代码行数:22,代码来源:BrowserClient.cpp

示例8: WndProc


//.........这里部分代码省略.........
                              | WS_DISABLED, x, 0, BUTTON_WIDTH, URLBAR_HEIGHT,
                              hWnd, (HMENU) IDC_NAV_STOP, hInst, 0);
      x += BUTTON_WIDTH;

      editWnd = CreateWindow(L"EDIT", 0,
                              WS_CHILD | WS_VISIBLE | WS_BORDER | ES_LEFT |
                              ES_AUTOVSCROLL | ES_AUTOHSCROLL| WS_DISABLED,
                              x, 0, rect.right - BUTTON_WIDTH * 4,
                              URLBAR_HEIGHT, hWnd, 0, hInst, 0);

      // Assign the edit window's WNDPROC to this function so that we can
      // capture the enter key
      editWndOldProc =
          reinterpret_cast<WNDPROC>(GetWindowLongPtr(editWnd, GWLP_WNDPROC));
      SetWindowLongPtr(editWnd, GWLP_WNDPROC,
          reinterpret_cast<LONG_PTR>(WndProc));
      g_handler->SetEditHwnd(editWnd);
      g_handler->SetButtonHwnds(backWnd, forwardWnd, reloadWnd, stopWnd);

      rect.top += URLBAR_HEIGHT;

      CefWindowInfo info;
      CefBrowserSettings settings;

      if (AppIsOffScreenRenderingEnabled()) {
        CefRefPtr<CefCommandLine> cmd_line = AppGetCommandLine();
        bool transparent =
            cmd_line->HasSwitch(cefclient::kTransparentPaintingEnabled);

        CefRefPtr<OSRWindow> osr_window =
            OSRWindow::Create(&g_main_browser_provider, transparent);
        osr_window->CreateWidget(hWnd, rect, hInst, szOSRWindowClass);
        info.SetAsOffScreen(osr_window->hwnd());
        info.SetTransparentPainting(transparent ? TRUE : FALSE);
        g_handler->SetOSRHandler(osr_window.get());
      } else {
        // Initialize window info to the defaults for a child window.
        info.SetAsChild(hWnd, rect);
      }

      // Creat the new child browser window
      CefBrowserHost::CreateBrowser(info, g_handler.get(),
          g_handler->GetStartupURL(), settings, NULL);

      return 0;
    }

    case WM_COMMAND: {
      CefRefPtr<CefBrowser> browser;
      if (g_handler.get())
        browser = g_handler->GetBrowser();

      wmId    = LOWORD(wParam);
      wmEvent = HIWORD(wParam);
      // Parse the menu selections:
      switch (wmId) {
      case IDM_ABOUT:
        DialogBox(hInst, MAKEINTRESOURCE(IDD_ABOUTBOX), hWnd, About);
        return 0;
      case IDM_EXIT:
        if (g_handler.get())
          g_handler->CloseAllBrowsers(false);
        return 0;
      case ID_WARN_CONSOLEMESSAGE:
        if (g_handler.get()) {
          std::wstringstream ss;
开发者ID:johndpope,项目名称:UE4,代码行数:67,代码来源:cefclient_win.cpp

示例9: WndProc

LRESULT CALLBACK TransparentWnd::WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
	static CefRefPtr<CefBrowser> browser = NULL;
	static HWND browserhWnd=NULL;
	static RECT rect;
	static TransparentWnd* handler;
	static int top=GetSystemMetrics(SM_CYFRAME)+GetSystemMetrics(SM_CYCAPTION)-2,left=GetSystemMetrics(SM_CXFRAME);
	switch (message)
	{
	case WM_INIT:
		{
			// Create the single static handler class instance
			handler=(TransparentWnd*)GetWindowLong(hWnd, GWL_USERDATA);
			CefRefPtr<MyHandler> g_handler=handler->g_handler;
			g_handler->SetMainHwnd(hWnd);


			GetClientRect(hWnd, &rect);

			CefWindowInfo info;
			CefBrowserSettings settings;

			// Populate the settings based on command line arguments.
			AppGetBrowserSettings(settings);
			// Initialize window info to the defaults for a child window
			info.SetAsChild(hWnd, rect);

			if(handler->isTransparent){
				info.m_bWindowRenderingDisabled = TRUE;
				info.SetTransparentPainting(TRUE);
			}

			// Creat the new child browser window
			CefBrowser::CreateBrowserSync(info,
				static_cast<CefRefPtr<CefClient> >(g_handler),
				handler->GetUrl(), settings);
			DragAcceptFiles(hWnd,TRUE);
		}
		break;
	case WM_NOTIFYICON:
		{
			handler=(TransparentWnd*)GetWindowLong(hWnd, GWL_USERDATA);
			handler->TaskMouseHandler(lParam);
		}
		break;
	case WM_ACTIVATE:
		{
			handler=(TransparentWnd*)GetWindowLong(hWnd, GWL_USERDATA);
			handler->FocusHandler();
		}
		break;
	case WM_CLOSE:
		{
			handler=(TransparentWnd*)GetWindowLong(hWnd, GWL_USERDATA);
			if(handler->g_handler->win){
				handler->CloseHandler();
				return 0;
			};
		}
		break;
	case WM_LBUTTONDOWN:
	case WM_RBUTTONDOWN:
		{
			handler=(TransparentWnd*)GetWindowLong(hWnd, GWL_USERDATA);
			if(handler->isEnableDrag){
				SetCapture(hWnd);
				handler->dragX=LOWORD(lParam);
				handler->dragY=HIWORD(lParam);
				handler->isDrag=true;
			}
		}
		break;

	case WM_LBUTTONUP:
	case WM_RBUTTONUP:
		{
			handler=(TransparentWnd*)GetWindowLong(hWnd, GWL_USERDATA);
			if (GetCapture() == hWnd)
				ReleaseCapture();
			handler->isDrag=false;
		}
		break;

	case WM_MOUSEMOVE:
		{
			handler=(TransparentWnd*)GetWindowLong(hWnd, GWL_USERDATA);
			if(handler->isDrag){
				POINT pt;
				GetCursorPos(&pt);
				handler->Move(pt.x-handler->dragX, pt.y-handler->dragY);
				handler->MoveHandler(handler->x,handler->y);
			}
		}
		break;

	case WM_SIZE:
		{
			handler=(TransparentWnd*)GetWindowLong(hWnd, GWL_USERDATA);
			switch(wParam){
			case SIZE_MINIMIZED:
//.........这里部分代码省略.........
开发者ID:guodayang,项目名称:MelodyDebug,代码行数:101,代码来源:transparent_wnd.cpp


注:本文中的CefWindowInfo::SetTransparentPainting方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。