资源简介

cef离屏渲染的c++代码示例,改自cefclient(在群里朋友的基础上修改的,更直接明了,删掉了多余的文件),有需要的朋友可以参考一下

资源截图

代码片段和文件信息

// Copyright (c) 2009 The Chromium embedded framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.

#include “transfer_util.h“

void transfer_string_list_contents(cef_string_list_t fromList
                                   StringList& toList)
{
  int size = cef_string_list_size(fromList);
  CefString value;

  for(int i = 0; i < size; i++) {
     cef_string_list_value(fromList i value.GetWritableStruct());
     toList.push_back(value);
  }
}

void transfer_string_list_contents(const StringList& fromList
                                   cef_string_list_t toList)
{
  size_t size = fromList.size();
  for(size_t i = 0; i < size; ++i)
    cef_string_list_append(toList fromList[i].GetStruct());
}

void transfer_string_map_contents(cef_string_map_t fromMap
                                  StringMap& toMap)
{
  int size = cef_string_map_size(fromMap);
  CefString key value;
  
  for(int i = 0; i < size; ++i) {
    cef_string_map_key(fromMap i key.GetWritableStruct());
    cef_string_map_value(fromMap i value.GetWritableStruct());
    
    toMap.insert(std::make_pair(key value));
  }
}

void transfer_string_map_contents(const StringMap& fromMap
                                  cef_string_map_t toMap)
{
  StringMap::const_iterator it = fromMap.begin();
  for(; it != fromMap.end(); ++it)
    cef_string_map_append(toMap it->first.GetStruct() it->second.GetStruct());
}

void transfer_string_multimap_contents(cef_string_multimap_t fromMap
                                       StringMultimap& toMap)
{
  int size = cef_string_multimap_size(fromMap);
  CefString key value;

  for(int i = 0; i < size; ++i) {
    cef_string_multimap_key(fromMap i key.GetWritableStruct());
    cef_string_multimap_value(fromMap i value.GetWritableStruct());
    
    toMap.insert(std::make_pair(key value));
  }
}

void transfer_string_multimap_contents(const StringMultimap& fromMap
                                       cef_string_multimap_t toMap)
{
  StringMultimap::const_iterator it = fromMap.begin();
  for(; it != fromMap.end(); ++it) {
    cef_string_multimap_append(toMap
        it->first.GetStruct()
        it->second.GetStruct());
  }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     文件       35687  2014-09-14 00:05  cefclient.vcxproj
     文件       13989  2014-09-14 00:05  cefclient.vcxproj.filters
     文件        2031  2015-03-11 15:22  cefclient2010.sln
     目录           0  2014-09-14 00:05  include\
     目录           0  2014-09-14 00:05  include\capi\
     文件        7318  2014-09-14 00:05  include\capi\cef_app_capi.h
     文件        3044  2014-09-14 00:05  include\capi\cef_base_capi.h
     文件       16641  2014-09-14 00:05  include\capi\cef_browser_capi.h
     文件        3760  2014-09-14 00:05  include\capi\cef_browser_process_handler_capi.h
     文件        2855  2014-09-14 00:05  include\capi\cef_callback_capi.h
     文件        5285  2014-09-14 00:05  include\capi\cef_client_capi.h
     文件        7569  2014-09-14 00:05  include\capi\cef_command_line_capi.h
     文件        8487  2014-09-14 00:05  include\capi\cef_context_menu_handler_capi.h
     文件        7203  2014-09-14 00:05  include\capi\cef_cookie_capi.h
     文件        4038  2014-09-14 00:05  include\capi\cef_dialog_handler_capi.h
     文件        4349  2014-09-14 00:05  include\capi\cef_display_handler_capi.h
     文件       13828  2014-09-14 00:05  include\capi\cef_dom_capi.h
     文件        4570  2014-09-14 00:05  include\capi\cef_download_handler_capi.h
     文件        5100  2014-09-14 00:05  include\capi\cef_download_item_capi.h
     文件        4771  2014-09-14 00:05  include\capi\cef_drag_data_capi.h
     文件        2865  2014-09-14 00:05  include\capi\cef_drag_handler_capi.h
     文件        3409  2014-09-14 00:05  include\capi\cef_focus_handler_capi.h
     文件        7114  2014-09-14 00:05  include\capi\cef_frame_capi.h
     文件        2991  2014-09-14 00:05  include\capi\cef_geolocation_capi.h
     文件        3819  2014-09-14 00:05  include\capi\cef_geolocation_handler_capi.h
     文件        5461  2014-09-14 00:05  include\capi\cef_jsdialog_handler_capi.h
     文件        3531  2014-09-14 00:05  include\capi\cef_keyboard_handler_capi.h
     文件        8305  2014-09-14 00:05  include\capi\cef_life_span_handler_capi.h
     文件        4655  2014-09-14 00:05  include\capi\cef_load_handler_capi.h
     文件       12990  2014-09-14 00:05  include\capi\cef_menu_model_capi.h
     文件        4945  2014-09-14 00:05  include\capi\cef_origin_whitelist_capi.h
............此处省略420个文件信息

评论

共有 条评论