当前位置:网站首页>Libcef common concepts framework features

Libcef common concepts framework features

2022-06-21 12:36:00 Plug in development

1. brief introduction

  Chromium Embedded Framework (CEF) It's based on Google Chromium Open source project project . And Chromium The project itself mainly focuses on Google Chrome Application development is different ,CEF Focus on promoting embedded browser use cases in third-party applications .CEF By providing stable production quality API、 Track specific Chromium Release branch and binary distribution of version , Connect users with the underlying Chromium and Blink Code complexity is isolated .CEF Most functions in have default implementations , It can provide rich functions , At the same time, there is almost no need for users to do integration work . As of the publication of this article , More than... Have been installed worldwide 1 One hundred million CEF example , These examples are embedded in products from a variety of companies and industries .CEF Some of the uses are available on the Wikipedia page CEF List of companies and products . CEF Some use cases for include :

  • Embed compliance in existing native applications HTML5 Of Web Browser controls .
  • Create lightweight native “ Shell ” Applications , The application hosting mainly uses Web User interface for technology development .
  • In an application that has its own custom drawing framework “ Off screen ” present Web Content .
  • Act as a reference to existing Web Properties and applications to automate the testing of the host .

  CEF3 Is based on multi process Chromium Content API The next generation of CEF .CEF3 The advantages of the multi - process architecture include :

  • Improved performance and stability (JavaScript And plug-ins run in separate processes ).
  • Support Retina Monitor .
  • be used for WebGL and 3D CSS Of GPU Speed up .
  • Cool new features , Such as WebRTC( Webcam support ) And voice input .
  • adopt DevTools Remote debugging protocol and ChromeDriver2 Achieve better automation UI test .
  • Faster access to current and future Web Functions and standards .

2. Use binary SDK

  CEF3 The binary distribution of is available from the project download page . They are contained on specific platforms (Windows、MacOS or Linux) Build a specific version of CEF3 All the files you need . On how to use CEF3 Detailed instructions for creating simple applications for binary distributions , See tutorial Wiki page .

   Whatever the platform , All binary distributions share the same common structure :

  CMakeLists.txt Provide CMake To configure , For building test applications included in the binary distribution . Platform specific build instructions are provided as comments at the top of this file .

  • Debug Include debug build CEF Shared library (libcef) And any other libraries needed to run on the platform .
  • include Include all necessary CEF The header file .
  • libcef_dll contain libcef_dll_wrapper The source code of the static library , All use CEF C++ API All applications must be linked to the static library . For more information , see also “C++ Wrappers ” part .
  • A release contains a release build CEF Shared library (libcef) And any other libraries needed to run on the platform .
  • Resources include the use of CEF The resources required by the application ( Limited to Windows and Linux). This includes .pak file ( Binaries with global resources ) And possibly other documents , For example, depending on the platform .
  • tests/cefclient Contains... Configured to be built using files from the binary distribution cefclient Sample application . This application demonstrates a wide range of CEF function .
  • tests/cefsimple Contains... Configured to be built using files from the binary distribution cefsimple Sample application . This application demonstrates the minimum functionality required to create a browser window .
  • tests/ceftests Contains... Configured to be built using files from the binary distribution ceftests Sample application . This application is CEF API And functions to provide unit test coverage .
  • Each binary distribution also contains a README.txt file , This document describes in more detail the platform specific distributions , And one. LICENSE.txt file , It includes CEF Of BSD license . Distribute based on CEF When , You should include the license text somewhere in the application distribution . for example , You can use the application UI Or in the documentation bundled with the application “ About ” or “ credit ” List it on the page . By loading... Separately “about:license” and “about:credits”, It can also be in CEF3 Get license and credit information in the browser window .

   You can use standard platform building tools to build a platform based on CEF Binary distribution applications . This includes Windows Upper Visual Studio、MacOS Upper Xcode and Linux Upper gcc/make. The project download page contains information about the operating system and build tool versions required for a particular binary version . stay Linux When building on , Also pay special attention to the package dependencies listed .

3. Build from source

   CEF You can build from local source code , You can also use TeamCity And so on . It needs to go through Git download Chromium and CEF Source code .Chromium The code base is very large , It is only recommended to have 8GB above RAM Built using source code on a medium-sized machine Chromium.BranchesAndBuilding Wiki On the page, you can build from source code Chromium and CEF Detailed description of .

4. Sample application

   cefclient The sample application is CEF A complete working example of integration , And included in the source code form of each binary distribution . Use CEF The easiest way to create a new application is from cefclient The application starts and removes unwanted parts . Many of the examples in this document are derived from cefclient Applications .

   Reasonable script code can effectively improve work efficiency , Reduce repetitive labor .

原网站

版权声明
本文为[Plug in development]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/172/202206211230148122.html