cef/libcef_dll/ctocpp/variant_ctocpp.h
Marshall Greenblatt 35e21da884 Add DLL build support and wrapper that allows clients to transparently switch between static and dynamic CEF builds.
- The libcef project now builds libcef_static.lib instead of libcef.lib.
- The libcef_dll project builds libcef.lib and libcef.dll.  This DLL exports the new CEF C API defined in cef_capi.h, cef_nplugin_capi.h, cef_string.h and cef_string_map.h.
- The libcef_dll_wrapper project builds libcef_dll_wrapper.lib.  This static library wraps the new C API calls with an implementation of the CEF C++ interface as defined in cef.h and cef_nplugin.h.
- The cefclient project now uses the DLL instead of the static library.
- Type definitions have been moved from cef.h to cef_types.h so that they can be shared by both cef.h and cef_capi.h.  This change required some enumeration member name modifications throughout the code base.
- Fixed variable naming inconsistencies.
- Added CefVariant::GetArraySize() method and _NPN_ArrayObjectGetVectorSize() function.
- Remove the ProjectSection(WebsiteProperties) sections from cef.sln to improve VS2005 performance.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@16 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2009-03-05 01:10:06 +00:00

51 lines
1.6 KiB
C++

// 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.
#ifndef _VARIANT_CTOCPP_H
#define _VARIANT_CTOCPP_H
#ifndef USING_CEF_SHARED
#pragma message("Warning: "__FILE__" may be accessed wrapper-side only")
#else // USING_CEF_SHARED
#include "cef.h"
#include "cef_capi.h"
#include "ctocpp.h"
// Wrap a C variant structure with a C++ variant class.
// This class may be instantiated and accessed wrapper-side only.
class CefVariantCToCpp : public CefCToCpp<CefVariant, cef_variant_t>
{
public:
CefVariantCToCpp(cef_variant_t* str)
: CefCToCpp<CefVariant, cef_variant_t>(str) {}
virtual ~CefVariantCToCpp() {}
// CefVariant methods
virtual Type GetType();
virtual void SetNull();
virtual void SetBool(bool val);
virtual void SetInt(int val);
virtual void SetDouble(double val);
virtual void SetString(const std::wstring& val);
virtual void SetBoolArray(const std::vector<bool>& val);
virtual void SetIntArray(const std::vector<int>& val);
virtual void SetDoubleArray(const std::vector<double>& val);
virtual void SetStringArray(const std::vector<std::wstring>& val);
virtual bool GetBool();
virtual int GetInt();
virtual double GetDouble();
virtual std::wstring GetString();
virtual bool GetBoolArray(std::vector<bool>& val);
virtual bool GetIntArray(std::vector<int>& val);
virtual bool GetDoubleArray(std::vector<double>& val);
virtual bool GetStringArray(std::vector<std::wstring>& val);
virtual int GetArraySize();
};
#endif // USING_CEF_SHARED
#endif // _VARIANT_CTOCPP_H