Update include/ comments to Doxygen formatting (see issue #3384)

See related guidelines in the issue.
This commit is contained in:
Marshall Greenblatt
2022-08-31 22:03:04 -04:00
parent 7b352159df
commit d7a153bdd4
235 changed files with 11484 additions and 11274 deletions

View File

@@ -39,7 +39,9 @@
#define CefEventHandle cef_event_handle_t
#define CefWindowHandle cef_window_handle_t
// Class representing CefExecuteProcess arguments.
///
/// Class representing CefExecuteProcess arguments.
///
class CefMainArgs : public cef_main_args_t {
public:
CefMainArgs() : cef_main_args_t{} {}
@@ -71,7 +73,9 @@ struct CefWindowInfoTraits {
}
};
// Class representing window information.
///
/// Class representing window information.
///
class CefWindowInfo : public CefStructBase<CefWindowInfoTraits> {
public:
typedef CefStructBase<CefWindowInfoTraits> parent;
@@ -84,7 +88,7 @@ class CefWindowInfo : public CefStructBase<CefWindowInfoTraits> {
CefWindowInfo& operator=(CefWindowInfo&&) = default;
///
// Create the browser as a child window.
/// Create the browser as a child window.
///
void SetAsChild(CefWindowHandle parent, const CefRect& bounds) {
parent_window = parent;
@@ -92,16 +96,16 @@ class CefWindowInfo : public CefStructBase<CefWindowInfoTraits> {
}
///
// Create the browser using windowless (off-screen) rendering. No window
// will be created for the browser and all rendering will occur via the
// CefRenderHandler interface. The |parent| value will be used to identify
// monitor info and to act as the parent window for dialogs, context menus,
// etc. If |parent| is not provided then the main screen monitor will be used
// and some functionality that requires a parent window may not function
// correctly. In order to create windowless browsers the
// CefSettings.windowless_rendering_enabled value must be set to true.
// Transparent painting is enabled by default but can be disabled by setting
// CefBrowserSettings.background_color to an opaque value.
/// Create the browser using windowless (off-screen) rendering. No window
/// will be created for the browser and all rendering will occur via the
/// CefRenderHandler interface. The |parent| value will be used to identify
/// monitor info and to act as the parent window for dialogs, context menus,
/// etc. If |parent| is not provided then the main screen monitor will be used
/// and some functionality that requires a parent window may not function
/// correctly. In order to create windowless browsers the
/// CefSettings.windowless_rendering_enabled value must be set to true.
/// Transparent painting is enabled by default but can be disabled by setting
/// CefBrowserSettings.background_color to an opaque value.
///
void SetAsWindowless(CefWindowHandle parent) {
windowless_rendering_enabled = true;

View File

@@ -42,19 +42,19 @@ extern "C" {
// See include/base/cef_logging.h for macros and intended usage.
///
// Gets the current log level.
/// Gets the current log level.
///
CEF_EXPORT int cef_get_min_log_level(void);
///
// Gets the current vlog level for the given file (usually taken from
// __FILE__). Note that |N| is the size *with* the null terminator.
/// Gets the current vlog level for the given file (usually taken from
/// __FILE__). Note that |N| is the size *with* the null terminator.
///
CEF_EXPORT int cef_get_vlog_level(const char* file_start, size_t N);
///
// Add a log message. See the LogSeverity defines for supported |severity|
// values.
/// Add a log message. See the LogSeverity defines for supported |severity|
/// values.
///
CEF_EXPORT void cef_log(const char* file,
int line,

View File

@@ -39,7 +39,9 @@
#define CefEventHandle cef_event_handle_t
#define CefWindowHandle cef_window_handle_t
// Class representing CefExecuteProcess arguments.
///
/// Class representing CefExecuteProcess arguments.
///
class CefMainArgs : public cef_main_args_t {
public:
CefMainArgs() : cef_main_args_t{} {}
@@ -72,7 +74,9 @@ struct CefWindowInfoTraits {
}
};
// Class representing window information.
///
/// Class representing window information.
///
class CefWindowInfo : public CefStructBase<CefWindowInfoTraits> {
public:
typedef CefStructBase<CefWindowInfoTraits> parent;
@@ -85,7 +89,7 @@ class CefWindowInfo : public CefStructBase<CefWindowInfoTraits> {
CefWindowInfo& operator=(CefWindowInfo&&) = default;
///
// Create the browser as a child view.
/// Create the browser as a child view.
///
void SetAsChild(CefWindowHandle parent, const CefRect& bounds) {
parent_view = parent;
@@ -94,16 +98,16 @@ class CefWindowInfo : public CefStructBase<CefWindowInfoTraits> {
}
///
// Create the browser using windowless (off-screen) rendering. No view
// will be created for the browser and all rendering will occur via the
// CefRenderHandler interface. The |parent| value will be used to identify
// monitor info and to act as the parent view for dialogs, context menus,
// etc. If |parent| is not provided then the main screen monitor will be used
// and some functionality that requires a parent view may not function
// correctly. In order to create windowless browsers the
// CefSettings.windowless_rendering_enabled value must be set to true.
// Transparent painting is enabled by default but can be disabled by setting
// CefBrowserSettings.background_color to an opaque value.
/// Create the browser using windowless (off-screen) rendering. No view
/// will be created for the browser and all rendering will occur via the
/// CefRenderHandler interface. The |parent| value will be used to identify
/// monitor info and to act as the parent view for dialogs, context menus,
/// etc. If |parent| is not provided then the main screen monitor will be used
/// and some functionality that requires a parent view may not function
/// correctly. In order to create windowless browsers the
/// CefSettings.windowless_rendering_enabled value must be set to true.
/// Transparent painting is enabled by default but can be disabled by setting
/// CefBrowserSettings.background_color to an opaque value.
///
void SetAsWindowless(CefWindowHandle parent) {
windowless_rendering_enabled = true;

View File

@@ -37,130 +37,138 @@
#include "include/base/cef_ref_counted.h"
///
// Smart pointer implementation that is an alias of scoped_refptr from
// include/base/cef_ref_counted.h.
// <p>
// A smart pointer class for reference counted objects. Use this class instead
// of calling AddRef and Release manually on a reference counted object to
// avoid common memory leaks caused by forgetting to Release an object
// reference. Sample usage:
// <pre>
// class MyFoo : public CefBaseRefCounted {
// ...
// };
//
// void some_function() {
// // The MyFoo object that |foo| represents starts with a single
// // reference.
// CefRefPtr&lt;MyFoo&gt; foo = new MyFoo();
// foo-&gt;Method(param);
// // |foo| is released when this function returns
// }
//
// void some_other_function() {
// CefRefPtr&lt;MyFoo&gt; foo = new MyFoo();
// ...
// foo = NULL; // explicitly releases |foo|
// ...
// if (foo)
// foo-&gt;Method(param);
// }
// </pre>
// The above examples show how CefRefPtr&lt;T&gt; acts like a pointer to T.
// Given two CefRefPtr&lt;T&gt; classes, it is also possible to exchange
// references between the two objects, like so:
// <pre>
// {
// CefRefPtr&lt;MyFoo&gt; a = new MyFoo();
// CefRefPtr&lt;MyFoo&gt; b;
//
// b.swap(a);
// // now, |b| references the MyFoo object, and |a| references NULL.
// }
// </pre>
// To make both |a| and |b| in the above example reference the same MyFoo
// object, simply use the assignment operator:
// <pre>
// {
// CefRefPtr&lt;MyFoo&gt; a = new MyFoo();
// CefRefPtr&lt;MyFoo&gt; b;
//
// b = a;
// // now, |a| and |b| each own a reference to the same MyFoo object.
// // the reference count of the underlying MyFoo object will be 2.
// }
// </pre>
// Reference counted objects can also be passed as function parameters and
// used as function return values:
// <pre>
// void some_func_with_param(CefRefPtr&lt;MyFoo&gt; param) {
// // A reference is added to the MyFoo object that |param| represents
// // during the scope of some_func_with_param() and released when
// // some_func_with_param() goes out of scope.
// }
//
// CefRefPtr&lt;MyFoo&gt; some_func_with_retval() {
// // The MyFoo object that |foox| represents starts with a single
// // reference.
// CefRefPtr&lt;MyFoo&gt; foox = new MyFoo();
//
// // Creating the return value adds an additional reference.
// return foox;
//
// // When some_func_with_retval() goes out of scope the original |foox|
// // reference is released.
// }
//
// void and_another_function() {
// CefRefPtr&lt;MyFoo&gt; foo = new MyFoo();
//
// // pass |foo| as a parameter.
// some_function(foo);
//
// CefRefPtr&lt;MyFoo&gt; foo2 = some_func_with_retval();
// // Now, since we kept a reference to the some_func_with_retval() return
// // value, |foo2| is the only class pointing to the MyFoo object created
// in some_func_with_retval(), and it has a reference count of 1.
//
// some_func_with_retval();
// // Now, since we didn't keep a reference to the some_func_with_retval()
// // return value, the MyFoo object created in some_func_with_retval()
// // will automatically be released.
// }
// </pre>
// And in standard containers:
// <pre>
// {
// // Create a vector that holds MyFoo objects.
// std::vector&lt;CefRefPtr&lt;MyFoo&gt; &gt; MyFooVec;
//
// // The MyFoo object that |foo| represents starts with a single
// // reference.
// CefRefPtr&lt;MyFoo&gt; foo = new MyFoo();
//
// // When the MyFoo object is added to |MyFooVec| the reference count
// // is increased to 2.
// MyFooVec.push_back(foo);
// }
// </pre>
// </p>
/// Smart pointer implementation that is an alias of scoped_refptr from
/// include/base/cef_ref_counted.h.
///
/// A smart pointer class for reference counted objects. Use this class instead
/// of calling AddRef and Release manually on a reference counted object to
/// avoid common memory leaks caused by forgetting to Release an object
/// reference. Sample usage:
///
/// <pre>
/// class MyFoo : public CefBaseRefCounted {
/// ...
/// };
///
/// void some_function() {
/// // The MyFoo object that |foo| represents starts with a single
/// // reference.
/// CefRefPtr&lt;MyFoo&gt; foo = new MyFoo();
/// foo-&gt;Method(param);
/// // |foo| is released when this function returns
/// }
///
/// void some_other_function() {
/// CefRefPtr&lt;MyFoo&gt; foo = new MyFoo();
/// ...
/// foo = NULL; /// explicitly releases |foo|
/// ...
/// if (foo)
/// foo-&gt;Method(param);
/// }
/// </pre>
///
/// The above examples show how CefRefPtr&lt;T&gt; acts like a pointer to T.
/// Given two CefRefPtr&lt;T&gt; classes, it is also possible to exchange
/// references between the two objects, like so:
///
/// <pre>
/// {
/// CefRefPtr&lt;MyFoo&gt; a = new MyFoo();
/// CefRefPtr&lt;MyFoo&gt; b;
///
/// b.swap(a);
/// // now, |b| references the MyFoo object, and |a| references NULL.
/// }
/// </pre>
///
/// To make both |a| and |b| in the above example reference the same MyFoo
/// object, simply use the assignment operator:
///
/// <pre>
/// {
/// CefRefPtr&lt;MyFoo&gt; a = new MyFoo();
/// CefRefPtr&lt;MyFoo&gt; b;
///
/// b = a;
/// // now, |a| and |b| each own a reference to the same MyFoo object.
/// // the reference count of the underlying MyFoo object will be 2.
/// }
/// </pre>
///
/// Reference counted objects can also be passed as function parameters and
/// used as function return values:
///
/// <pre>
/// void some_func_with_param(CefRefPtr&lt;MyFoo&gt; param) {
/// // A reference is added to the MyFoo object that |param| represents
/// // during the scope of some_func_with_param() and released when
/// // some_func_with_param() goes out of scope.
/// }
///
/// CefRefPtr&lt;MyFoo&gt; some_func_with_retval() {
/// // The MyFoo object that |foox| represents starts with a single
/// // reference.
/// CefRefPtr&lt;MyFoo&gt; foox = new MyFoo();
///
/// // Creating the return value adds an additional reference.
/// return foox;
///
/// // When some_func_with_retval() goes out of scope the original |foox|
/// // reference is released.
/// }
///
/// void and_another_function() {
/// CefRefPtr&lt;MyFoo&gt; foo = new MyFoo();
///
/// // pass |foo| as a parameter.
/// some_function(foo);
///
/// CefRefPtr&lt;MyFoo&gt; foo2 = some_func_with_retval();
/// // Now, since we kept a reference to the some_func_with_retval() return
/// // value, |foo2| is the only class pointing to the MyFoo object created
/// in some_func_with_retval(), and it has a reference count of 1.
///
/// some_func_with_retval();
/// // Now, since we didn't keep a reference to the some_func_with_retval()
/// // return value, the MyFoo object created in some_func_with_retval()
/// // will automatically be released.
/// }
/// </pre>
///
/// And in standard containers:
///
/// <pre>
/// {
/// // Create a vector that holds MyFoo objects.
/// std::vector&lt;CefRefPtr&lt;MyFoo&gt; &gt; MyFooVec;
///
/// // The MyFoo object that |foo| represents starts with a single
/// // reference.
/// CefRefPtr&lt;MyFoo&gt; foo = new MyFoo();
///
/// // When the MyFoo object is added to |MyFooVec| the reference count
/// // is increased to 2.
/// MyFooVec.push_back(foo);
/// }
/// </pre>
///
template <class T>
using CefRefPtr = scoped_refptr<T>;
///
// A CefOwnPtr<T> is like a T*, except that the destructor of CefOwnPtr<T>
// automatically deletes the pointer it holds (if any). That is, CefOwnPtr<T>
// owns the T object that it points to. Like a T*, a CefOwnPtr<T> may hold
// either NULL or a pointer to a T object. Also like T*, CefOwnPtr<T> is
// thread-compatible, and once you dereference it, you get the thread safety
// guarantees of T.
/// A CefOwnPtr<T> is like a T*, except that the destructor of CefOwnPtr<T>
/// automatically deletes the pointer it holds (if any). That is, CefOwnPtr<T>
/// owns the T object that it points to. Like a T*, a CefOwnPtr<T> may hold
/// either NULL or a pointer to a T object. Also like T*, CefOwnPtr<T> is
/// thread-compatible, and once you dereference it, you get the thread safety
/// guarantees of T.
///
template <class T, class D = std::default_delete<T>>
using CefOwnPtr = std::unique_ptr<T, D>;
///
// A CefRawPtr<T> is the same as T*
/// A CefRawPtr<T> is the same as T*
///
template <class T>
using CefRawPtr = T*;

View File

@@ -39,46 +39,46 @@ extern "C" {
#endif
///
// CEF string maps are a set of key/value string pairs.
/// CEF string maps are a set of key/value string pairs.
///
typedef void* cef_string_list_t;
///
// Allocate a new string map.
/// Allocate a new string map.
///
CEF_EXPORT cef_string_list_t cef_string_list_alloc(void);
///
// Return the number of elements in the string list.
/// Return the number of elements in the string list.
///
CEF_EXPORT size_t cef_string_list_size(cef_string_list_t list);
///
// Retrieve the value at the specified zero-based string list index. Returns
// true (1) if the value was successfully retrieved.
/// Retrieve the value at the specified zero-based string list index. Returns
/// true (1) if the value was successfully retrieved.
///
CEF_EXPORT int cef_string_list_value(cef_string_list_t list,
size_t index,
cef_string_t* value);
///
// Append a new value at the end of the string list.
/// Append a new value at the end of the string list.
///
CEF_EXPORT void cef_string_list_append(cef_string_list_t list,
const cef_string_t* value);
///
// Clear the string list.
/// Clear the string list.
///
CEF_EXPORT void cef_string_list_clear(cef_string_list_t list);
///
// Free the string list.
/// Free the string list.
///
CEF_EXPORT void cef_string_list_free(cef_string_list_t list);
///
// Creates a copy of an existing string list.
/// Creates a copy of an existing string list.
///
CEF_EXPORT cef_string_list_t cef_string_list_copy(cef_string_list_t list);

View File

@@ -39,55 +39,55 @@ extern "C" {
#endif
///
// CEF string maps are a set of key/value string pairs.
/// CEF string maps are a set of key/value string pairs.
///
typedef void* cef_string_map_t;
///
// Allocate a new string map.
/// Allocate a new string map.
///
CEF_EXPORT cef_string_map_t cef_string_map_alloc(void);
///
// Return the number of elements in the string map.
/// Return the number of elements in the string map.
///
CEF_EXPORT size_t cef_string_map_size(cef_string_map_t map);
///
// Return the value assigned to the specified key.
/// Return the value assigned to the specified key.
///
CEF_EXPORT int cef_string_map_find(cef_string_map_t map,
const cef_string_t* key,
cef_string_t* value);
///
// Return the key at the specified zero-based string map index.
/// Return the key at the specified zero-based string map index.
///
CEF_EXPORT int cef_string_map_key(cef_string_map_t map,
size_t index,
cef_string_t* key);
///
// Return the value at the specified zero-based string map index.
/// Return the value at the specified zero-based string map index.
///
CEF_EXPORT int cef_string_map_value(cef_string_map_t map,
size_t index,
cef_string_t* value);
///
// Append a new key/value pair at the end of the string map.
/// Append a new key/value pair at the end of the string map.
///
CEF_EXPORT int cef_string_map_append(cef_string_map_t map,
const cef_string_t* key,
const cef_string_t* value);
///
// Clear the string map.
/// Clear the string map.
///
CEF_EXPORT void cef_string_map_clear(cef_string_map_t map);
///
// Free the string map.
/// Free the string map.
///
CEF_EXPORT void cef_string_map_free(cef_string_map_t map);

View File

@@ -39,29 +39,29 @@ extern "C" {
#endif
///
// CEF string multimaps are a set of key/value string pairs.
// More than one value can be assigned to a single key.
/// CEF string multimaps are a set of key/value string pairs.
/// More than one value can be assigned to a single key.
///
typedef void* cef_string_multimap_t;
///
// Allocate a new string multimap.
/// Allocate a new string multimap.
///
CEF_EXPORT cef_string_multimap_t cef_string_multimap_alloc(void);
///
// Return the number of elements in the string multimap.
/// Return the number of elements in the string multimap.
///
CEF_EXPORT size_t cef_string_multimap_size(cef_string_multimap_t map);
///
// Return the number of values with the specified key.
/// Return the number of values with the specified key.
///
CEF_EXPORT size_t cef_string_multimap_find_count(cef_string_multimap_t map,
const cef_string_t* key);
///
// Return the value_index-th value with the specified key.
/// Return the value_index-th value with the specified key.
///
CEF_EXPORT int cef_string_multimap_enumerate(cef_string_multimap_t map,
const cef_string_t* key,
@@ -69,33 +69,33 @@ CEF_EXPORT int cef_string_multimap_enumerate(cef_string_multimap_t map,
cef_string_t* value);
///
// Return the key at the specified zero-based string multimap index.
/// Return the key at the specified zero-based string multimap index.
///
CEF_EXPORT int cef_string_multimap_key(cef_string_multimap_t map,
size_t index,
cef_string_t* key);
///
// Return the value at the specified zero-based string multimap index.
/// Return the value at the specified zero-based string multimap index.
///
CEF_EXPORT int cef_string_multimap_value(cef_string_multimap_t map,
size_t index,
cef_string_t* value);
///
// Append a new key/value pair at the end of the string multimap.
/// Append a new key/value pair at the end of the string multimap.
///
CEF_EXPORT int cef_string_multimap_append(cef_string_multimap_t map,
const cef_string_t* key,
const cef_string_t* value);
///
// Clear the string multimap.
/// Clear the string multimap.
///
CEF_EXPORT void cef_string_multimap_clear(cef_string_multimap_t map);
///
// Free the string multimap.
/// Free the string multimap.
///
CEF_EXPORT void cef_string_multimap_free(cef_string_multimap_t map);

View File

@@ -31,26 +31,31 @@
#define CEF_INCLUDE_INTERNAL_CEF_STRING_TYPES_H_
#pragma once
// CEF provides functions for converting between UTF-8, -16 and -32 strings.
// CEF string types are safe for reading from multiple threads but not for
// modification. It is the user's responsibility to provide synchronization if
// modifying CEF strings from multiple threads.
#include <stddef.h>
#include "include/base/cef_basictypes.h"
#include "include/internal/cef_export.h"
///
/// \file
/// CEF provides functions for converting between UTF-8, -16 and -32 strings.
/// CEF string types are safe for reading from multiple threads but not for
/// modification. It is the user's responsibility to provide synchronization if
/// modifying CEF strings from multiple threads.
///
#ifdef __cplusplus
extern "C" {
#endif
// CEF string type definitions. Whomever allocates |str| is responsible for
// providing an appropriate |dtor| implementation that will free the string in
// the same memory space. When reusing an existing string structure make sure
// to call |dtor| for the old value before assigning new |str| and |dtor|
// values. Static strings will have a NULL |dtor| value. Using the below
// functions if you want this managed for you.
///
/// CEF string type definitions. Whomever allocates |str| is responsible for
/// providing an appropriate |dtor| implementation that will free the string in
/// the same memory space. When reusing an existing string structure make sure
/// to call |dtor| for the old value before assigning new |str| and |dtor|
/// values. Static strings will have a NULL |dtor| value. Using the below
/// functions if you want this managed for you.
///
typedef struct _cef_string_wide_t {
wchar_t* str;
@@ -71,9 +76,9 @@ typedef struct _cef_string_utf16_t {
} cef_string_utf16_t;
///
// These functions set string values. If |copy| is true (1) the value will be
// copied instead of referenced. It is up to the user to properly manage
// the lifespan of references.
/// These functions set string values. If |copy| is true (1) the value will be
/// copied instead of referenced. It is up to the user to properly manage
/// the lifespan of references.
///
CEF_EXPORT int cef_string_wide_set(const wchar_t* src,
@@ -90,7 +95,7 @@ CEF_EXPORT int cef_string_utf16_set(const char16* src,
int copy);
///
// Convenience macros for copying values.
/// Convenience macros for copying values.
///
#define cef_string_wide_copy(src, src_len, output) \
@@ -101,7 +106,7 @@ CEF_EXPORT int cef_string_utf16_set(const char16* src,
cef_string_utf16_set(src, src_len, output, true)
///
// These functions clear string values. The structure itself is not freed.
/// These functions clear string values. The structure itself is not freed.
///
CEF_EXPORT void cef_string_wide_clear(cef_string_wide_t* str);
@@ -109,7 +114,7 @@ CEF_EXPORT void cef_string_utf8_clear(cef_string_utf8_t* str);
CEF_EXPORT void cef_string_utf16_clear(cef_string_utf16_t* str);
///
// These functions compare two string values with the same results as strcmp().
/// These functions compare two string values with the same results as strcmp().
///
CEF_EXPORT int cef_string_wide_cmp(const cef_string_wide_t* str1,
@@ -120,10 +125,10 @@ CEF_EXPORT int cef_string_utf16_cmp(const cef_string_utf16_t* str1,
const cef_string_utf16_t* str2);
///
// These functions convert between UTF-8, -16, and -32 strings. They are
// potentially slow so unnecessary conversions should be avoided. The best
// possible result will always be written to |output| with the boolean return
// value indicating whether the conversion is 100% valid.
/// These functions convert between UTF-8, -16, and -32 strings. They are
/// potentially slow so unnecessary conversions should be avoided. The best
/// possible result will always be written to |output| with the boolean return
/// value indicating whether the conversion is 100% valid.
///
CEF_EXPORT int cef_string_wide_to_utf8(const wchar_t* src,
@@ -148,9 +153,9 @@ CEF_EXPORT int cef_string_utf16_to_utf8(const char16* src,
cef_string_utf8_t* output);
///
// These functions convert an ASCII string, typically a hardcoded constant, to a
// Wide/UTF16 string. Use instead of the UTF8 conversion routines if you know
// the string is ASCII.
/// These functions convert an ASCII string, typically a hardcoded constant, to
/// a Wide/UTF16 string. Use instead of the UTF8 conversion routines if you know
/// the string is ASCII.
///
CEF_EXPORT int cef_string_ascii_to_wide(const char* src,
@@ -161,9 +166,9 @@ CEF_EXPORT int cef_string_ascii_to_utf16(const char* src,
cef_string_utf16_t* output);
///
// It is sometimes necessary for the system to allocate string structures with
// the expectation that the user will free them. The userfree types act as a
// hint that the user is responsible for freeing the structure.
/// It is sometimes necessary for the system to allocate string structures with
/// the expectation that the user will free them. The userfree types act as a
/// hint that the user is responsible for freeing the structure.
///
typedef cef_string_wide_t* cef_string_userfree_wide_t;
@@ -171,8 +176,8 @@ typedef cef_string_utf8_t* cef_string_userfree_utf8_t;
typedef cef_string_utf16_t* cef_string_userfree_utf16_t;
///
// These functions allocate a new string structure. They must be freed by
// calling the associated free function.
/// These functions allocate a new string structure. They must be freed by
/// calling the associated free function.
///
CEF_EXPORT cef_string_userfree_wide_t cef_string_userfree_wide_alloc(void);
@@ -180,8 +185,8 @@ CEF_EXPORT cef_string_userfree_utf8_t cef_string_userfree_utf8_alloc(void);
CEF_EXPORT cef_string_userfree_utf16_t cef_string_userfree_utf16_alloc(void);
///
// These functions free the string structure allocated by the associated
// alloc function. Any string contents will first be cleared.
/// These functions free the string structure allocated by the associated
/// alloc function. Any string contents will first be cleared.
///
CEF_EXPORT void cef_string_userfree_wide_free(cef_string_userfree_wide_t str);
@@ -189,8 +194,8 @@ CEF_EXPORT void cef_string_userfree_utf8_free(cef_string_userfree_utf8_t str);
CEF_EXPORT void cef_string_userfree_utf16_free(cef_string_userfree_utf16_t str);
///
// These functions convert utf16 string case using the current ICU locale. This
// may change the length of the string in some cases.
/// These functions convert utf16 string case using the current ICU locale. This
/// may change the length of the string in some cases.
///
CEF_EXPORT int cef_string_utf16_to_lower(const char16* src,

View File

@@ -41,7 +41,7 @@
#endif
///
// Traits implementation for wide character strings.
/// Traits implementation for wide character strings.
///
struct CefStringTraitsWide {
typedef wchar_t char_type;
@@ -139,7 +139,7 @@ struct CefStringTraitsWide {
};
///
// Traits implementation for utf8 character strings.
/// Traits implementation for utf8 character strings.
///
struct CefStringTraitsUTF8 {
typedef char char_type;
@@ -222,7 +222,7 @@ struct CefStringTraitsUTF8 {
};
///
// Traits implementation for utf16 character strings.
/// Traits implementation for utf16 character strings.
///
struct CefStringTraitsUTF16 {
typedef char16 char_type;
@@ -315,32 +315,35 @@ struct CefStringTraitsUTF16 {
};
///
// CEF string classes can convert between all supported string types. For
// example, the CefStringWide class uses wchar_t as the underlying character
// type and provides two approaches for converting data to/from a UTF8 string
// (std::string).
// <p>
// 1. Implicit conversion using the assignment operator overload.
// <pre>
// CefStringWide aCefString;
// std::string aUTF8String;
// aCefString = aUTF8String; // Assign std::string to CefStringWide
// aUTF8String = aCefString; // Assign CefStringWide to std::string
// </pre>
// 2. Explicit conversion using the FromString/ToString methods.
// <pre>
// CefStringWide aCefString;
// std::string aUTF8String;
// aCefString.FromString(aUTF8String); // Assign std::string to CefStringWide
// aUTF8String = aCefString.ToString(); // Assign CefStringWide to std::string
// </pre>
// Conversion will only occur if the assigned value is a different string type.
// Assigning a std::string to a CefStringUTF8, for example, will copy the data
// without performing a conversion.
// </p>
// CEF string classes are safe for reading from multiple threads but not for
// modification. It is the user's responsibility to provide synchronization if
// modifying CEF strings from multiple threads.
/// CEF string classes can convert between all supported string types. For
/// example, the CefStringWide class uses wchar_t as the underlying character
/// type and provides two approaches for converting data to/from a UTF8 string
/// (std::string).
///
/// 1. Implicit conversion using the assignment operator overload.
/// <pre>
/// CefStringWide aCefString;
/// std::string aUTF8String;
/// aCefString = aUTF8String; // Assign std::string to CefStringWide
/// aUTF8String = aCefString; // Assign CefStringWide to std::string
/// </pre>
///
/// 2. Explicit conversion using the FromString/ToString methods.
/// <pre>
/// CefStringWide aCefString;
/// std::string aUTF8String;
/// aCefString.FromString(aUTF8String); // Assign std::string to CefStringWide
/// aUTF8String = aCefString.ToString(); // Assign CefStringWide to
/// std::string
/// </pre>
///
/// Conversion will only occur if the assigned value is a different string type.
/// Assigning a std::string to a CefStringUTF8, for example, will copy the data
/// without performing a conversion.
///
/// CEF string classes are safe for reading from multiple threads but not for
/// modification. It is the user's responsibility to provide synchronization if
/// modifying CEF strings from multiple threads.
///
template <class traits>
class CefStringBase {
@@ -350,21 +353,21 @@ class CefStringBase {
typedef typename traits::userfree_struct_type userfree_struct_type;
///
// Default constructor.
/// Default constructor.
///
CefStringBase() : string_(NULL), owner_(false) {}
///
// Create a new string from an existing string. Data will always be copied.
/// Create a new string from an existing string. Data will always be copied.
///
CefStringBase(const CefStringBase& str) : string_(NULL), owner_(false) {
FromString(str.c_str(), str.length(), true);
}
///
// Create a new string from an existing std::string. Data will be always
// copied. Translation will occur if necessary based on the underlying string
// type.
/// Create a new string from an existing std::string. Data will be always
/// copied. Translation will occur if necessary based on the underlying string
/// type.
///
CefStringBase(const std::string& src) : string_(NULL), owner_(false) {
FromString(src);
@@ -376,9 +379,9 @@ class CefStringBase {
}
///
// Create a new string from an existing std::wstring. Data will be always
// copied. Translation will occur if necessary based on the underlying string
// type.
/// Create a new string from an existing std::wstring. Data will be always
/// copied. Translation will occur if necessary based on the underlying string
/// type.
///
CefStringBase(const std::wstring& src) : string_(NULL), owner_(false) {
FromWString(src);
@@ -390,9 +393,9 @@ class CefStringBase {
}
///
// Create a new string from an existing string16. Data will be always
// copied. Translation will occur if necessary based on the underlying string
// type.
/// Create a new string from an existing string16. Data will be always
/// copied. Translation will occur if necessary based on the underlying string
/// type.
///
CefStringBase(const std::u16string& src) : string_(NULL), owner_(false) {
FromString16(src);
@@ -413,10 +416,10 @@ class CefStringBase {
#endif // WCHAR_T_IS_UTF32
///
// Create a new string from an existing character array. If |copy| is true
// this class will copy the data. Otherwise, this class will reference the
// existing data. Referenced data must exist for the lifetime of this class
// and will not be freed by this class.
/// Create a new string from an existing character array. If |copy| is true
/// this class will copy the data. Otherwise, this class will reference the
/// existing data. Referenced data must exist for the lifetime of this class
/// and will not be freed by this class.
///
CefStringBase(const char_type* src, size_t src_len, bool copy)
: string_(NULL), owner_(false) {
@@ -425,9 +428,9 @@ class CefStringBase {
}
///
// Create a new string referencing an existing string structure without taking
// ownership. Referenced structures must exist for the lifetime of this class
// and will not be freed by this class.
/// Create a new string referencing an existing string structure without
/// taking ownership. Referenced structures must exist for the lifetime of
/// this class and will not be freed by this class.
///
CefStringBase(const struct_type* src) : string_(NULL), owner_(false) {
if (!src)
@@ -438,31 +441,31 @@ class CefStringBase {
virtual ~CefStringBase() { ClearAndFree(); }
// The following methods are named for compatibility with the standard library
// string template types.
/// The following methods are named for compatibility with the standard
/// library string template types.
///
// Return a read-only pointer to the string data.
/// Return a read-only pointer to the string data.
///
const char_type* c_str() const { return (string_ ? string_->str : NULL); }
///
// Return the length of the string data.
/// Return the length of the string data.
///
size_t length() const { return (string_ ? string_->length : 0); }
///
// Return the length of the string data.
/// Return the length of the string data.
///
inline size_t size() const { return length(); }
///
// Returns true if the string is empty.
/// Returns true if the string is empty.
///
bool empty() const { return (string_ == NULL || string_->length == 0); }
///
// Compare this string to the specified string.
/// Compare this string to the specified string.
///
int compare(const CefStringBase& str) const {
if (empty() && str.empty())
@@ -475,7 +478,7 @@ class CefStringBase {
}
///
// Clear the string data.
/// Clear the string data.
///
void clear() {
if (string_)
@@ -483,7 +486,7 @@ class CefStringBase {
}
///
// Swap this string's contents with the specified string.
/// Swap this string's contents with the specified string.
///
void swap(CefStringBase& str) {
struct_type* tmp_string = string_;
@@ -497,19 +500,19 @@ class CefStringBase {
// The following methods are unique to CEF string template types.
///
// Returns true if this class owns the underlying string structure.
/// Returns true if this class owns the underlying string structure.
///
bool IsOwner() const { return owner_; }
///
// Returns a read-only pointer to the underlying string structure. May return
// NULL if no structure is currently allocated.
/// Returns a read-only pointer to the underlying string structure. May return
/// NULL if no structure is currently allocated.
///
const struct_type* GetStruct() const { return string_; }
///
// Returns a writable pointer to the underlying string structure. Will never
// return NULL.
/// Returns a writable pointer to the underlying string structure. Will never
/// return NULL.
///
struct_type* GetWritableStruct() {
AllocIfNeeded();
@@ -517,8 +520,8 @@ class CefStringBase {
}
///
// Clear the state of this class. The underlying string structure and data
// will be freed if this class owns the structure.
/// Clear the state of this class. The underlying string structure and data
/// will be freed if this class owns the structure.
///
void ClearAndFree() {
if (!string_)
@@ -532,8 +535,8 @@ class CefStringBase {
}
///
// Attach to the specified string structure. If |owner| is true this class
// will take ownership of the structure.
/// Attach to the specified string structure. If |owner| is true this class
/// will take ownership of the structure.
///
void Attach(struct_type* str, bool owner) {
// Free the previous structure and data, if any.
@@ -544,9 +547,9 @@ class CefStringBase {
}
///
// Take ownership of the specified userfree structure's string data. The
// userfree structure itself will be freed. Only use this method with userfree
// structures.
/// Take ownership of the specified userfree structure's string data. The
/// userfree structure itself will be freed. Only use this method with
/// userfree structures.
///
void AttachToUserFree(userfree_struct_type str) {
// Free the previous structure and data, if any.
@@ -559,15 +562,15 @@ class CefStringBase {
owner_ = true;
memcpy(string_, str, sizeof(struct_type));
// Free the |str| structure but not the data.
/// Free the |str| structure but not the data.
memset(str, 0, sizeof(struct_type));
traits::userfree_free(str);
}
///
// Detach from the underlying string structure. To avoid memory leaks only use
// this method if you already hold a pointer to the underlying string
// structure.
/// Detach from the underlying string structure. To avoid memory leaks only
/// use this method if you already hold a pointer to the underlying string
/// structure.
///
void Detach() {
string_ = NULL;
@@ -575,9 +578,9 @@ class CefStringBase {
}
///
// Create a userfree structure and give it ownership of this class' string
// data. This class will be disassociated from the data. May return NULL if
// this string class currently contains no data.
/// Create a userfree structure and give it ownership of this class' string
/// data. This class will be disassociated from the data. May return NULL if
/// this string class currently contains no data.
///
userfree_struct_type DetachToUserFree() {
if (empty())
@@ -600,10 +603,10 @@ class CefStringBase {
}
///
// Set this string's data to the specified character array. If |copy| is true
// this class will copy the data. Otherwise, this class will reference the
// existing data. Referenced data must exist for the lifetime of this class
// and will not be freed by this class.
/// Set this string's data to the specified character array. If |copy| is true
/// this class will copy the data. Otherwise, this class will reference the
/// existing data. Referenced data must exist for the lifetime of this class
/// and will not be freed by this class.
///
bool FromString(const char_type* src, size_t src_len, bool copy) {
if (src == NULL || src_len == 0) {
@@ -615,9 +618,9 @@ class CefStringBase {
}
///
// Set this string's data from an existing ASCII string. Data will be always
// copied. Translation will occur if necessary based on the underlying string
// type.
/// Set this string's data from an existing ASCII string. Data will be always
/// copied. Translation will occur if necessary based on the underlying string
/// type.
///
bool FromASCII(const char* str) {
size_t len = str ? strlen(str) : 0;
@@ -630,8 +633,8 @@ class CefStringBase {
}
///
// Return this string's data as a std::string. Translation will occur if
// necessary based on the underlying string type.
/// Return this string's data as a std::string. Translation will occur if
/// necessary based on the underlying string type.
///
std::string ToString() const {
if (empty())
@@ -640,9 +643,9 @@ class CefStringBase {
}
///
// Set this string's data from an existing std::string. Data will be always
// copied. Translation will occur if necessary based on the underlying string
// type.
/// Set this string's data from an existing std::string. Data will be always
/// copied. Translation will occur if necessary based on the underlying string
/// type.
///
bool FromString(const std::string& str) {
if (str.empty()) {
@@ -654,9 +657,9 @@ class CefStringBase {
}
///
// Set this string's data from existing |data| and optional |length|. Data
// will be always copied. Translation will occur if necessary based on the
// underlying string type.
/// Set this string's data from existing |data| and optional |length|. Data
/// will be always copied. Translation will occur if necessary based on the
/// underlying string type.
///
bool FromString(const std::string::value_type* data, size_t length = 0) {
if (data && length == 0) {
@@ -671,8 +674,8 @@ class CefStringBase {
}
///
// Return this string's data as a std::wstring. Translation will occur if
// necessary based on the underlying string type.
/// Return this string's data as a std::wstring. Translation will occur if
/// necessary based on the underlying string type.
///
std::wstring ToWString() const {
if (empty())
@@ -681,9 +684,9 @@ class CefStringBase {
}
///
// Set this string's data from an existing std::wstring. Data will be always
// copied. Translation will occur if necessary based on the underlying string
// type.
/// Set this string's data from an existing std::wstring. Data will be always
/// copied. Translation will occur if necessary based on the underlying string
/// type.
///
bool FromWString(const std::wstring& str) {
if (str.empty()) {
@@ -695,9 +698,9 @@ class CefStringBase {
}
///
// Set this string's data from existing |data| and optional |length|. Data
// will be always copied. Translation will occur if necessary based on the
// underlying string type.
/// Set this string's data from existing |data| and optional |length|. Data
/// will be always copied. Translation will occur if necessary based on the
/// underlying string type.
///
bool FromWString(const std::wstring::value_type* data, size_t length = 0) {
if (data && length == 0) {
@@ -710,9 +713,10 @@ class CefStringBase {
AllocIfNeeded();
return traits::from_wstring(data, length, string_);
}
///
// Return this string's data as a string16. Translation will occur if
// necessary based on the underlying string type.
/// Return this string's data as a string16. Translation will occur if
/// necessary based on the underlying string type.
///
std::u16string ToString16() const {
if (empty())
@@ -721,9 +725,9 @@ class CefStringBase {
}
///
// Set this string's data from an existing string16. Data will be always
// copied. Translation will occur if necessary based on the underlying string
// type.
/// Set this string's data from an existing string16. Data will be always
/// copied. Translation will occur if necessary based on the underlying string
/// type.
///
bool FromString16(const std::u16string& str) {
if (str.empty()) {
@@ -735,9 +739,9 @@ class CefStringBase {
}
///
// Set this string's data from existing |data| and optional |length|. Data
// will be always copied. Translation will occur if necessary based on the
// underlying string type.
/// Set this string's data from existing |data| and optional |length|. Data
/// will be always copied. Translation will occur if necessary based on the
/// underlying string type.
///
bool FromString16(const std::u16string::value_type* data, size_t length = 0) {
if (data && length == 0) {
@@ -752,7 +756,7 @@ class CefStringBase {
}
///
// Comparison operator overloads.
/// Comparison operator overloads.
///
bool operator<(const CefStringBase& str) const { return (compare(str) < 0); }
bool operator<=(const CefStringBase& str) const {
@@ -770,7 +774,7 @@ class CefStringBase {
}
///
// Assignment operator overloads.
/// Assignment operator overloads.
///
CefStringBase& operator=(const CefStringBase& str) {
FromString(str.c_str(), str.length(), true);
@@ -822,7 +826,7 @@ class CefStringBase {
#endif // USING_CHROMIUM_INCLUDES
private:
// Allocate the string structure if it doesn't already exist.
/// Allocate the string structure if it doesn't already exist.
void AllocIfNeeded() {
if (string_ == NULL) {
string_ = new struct_type;

View File

@@ -53,7 +53,7 @@ typedef pid_t cef_platform_thread_id_t;
#endif
///
// Returns the current platform thread ID.
/// Returns the current platform thread ID.
///
CEF_EXPORT cef_platform_thread_id_t cef_get_current_platform_thread_id(void);
@@ -66,7 +66,7 @@ typedef pthread_t cef_platform_thread_handle_t;
#endif
///
// Returns the current platform thread handle.
/// Returns the current platform thread handle.
///
CEF_EXPORT cef_platform_thread_handle_t
cef_get_current_platform_thread_handle(void);

View File

@@ -40,76 +40,107 @@ extern "C" {
#include "include/internal/cef_export.h"
///
// Represents a wall clock time in UTC. Values are not guaranteed to be
// monotonically non-decreasing and are subject to large amounts of skew.
// Time is stored internally as microseconds since the Windows epoch (1601).
//
// This is equivalent of Chromium `base::Time` (see base/time/time.h).
/// Represents a wall clock time in UTC. Values are not guaranteed to be
/// monotonically non-decreasing and are subject to large amounts of skew.
/// Time is stored internally as microseconds since the Windows epoch (1601).
///
/// This is equivalent of Chromium `base::Time` (see base/time/time.h).
///
typedef struct _cef_basetime_t {
int64 val;
} cef_basetime_t;
///
// Time information. Values should always be in UTC.
/// Time information. Values should always be in UTC.
///
typedef struct _cef_time_t {
int year; // Four or five digit year "2007" (1601 to 30827 on
// Windows, 1970 to 2038 on 32-bit POSIX)
int month; // 1-based month (values 1 = January, etc.)
int day_of_week; // 0-based day of week (0 = Sunday, etc.)
int day_of_month; // 1-based day of month (1-31)
int hour; // Hour within the current day (0-23)
int minute; // Minute within the current hour (0-59)
int second; // Second within the current minute (0-59 plus leap
// seconds which may take it up to 60).
int millisecond; // Milliseconds within the current second (0-999)
///
/// Four or five digit year "2007" (1601 to 30827 on Windows, 1970 to 2038 on
/// 32-bit POSIX)
///
int year;
///
/// 1-based month (values 1 = January, etc.)
///
int month;
///
/// 0-based day of week (0 = Sunday, etc.)
///
int day_of_week;
///
/// 1-based day of month (1-31)
///
int day_of_month;
///
/// Hour within the current day (0-23)
///
int hour;
///
/// Minute within the current hour (0-59)
///
int minute;
///
/// Second within the current minute (0-59 plus leap seconds which may take
/// it up to 60).
///
int second;
///
/// Milliseconds within the current second (0-999)
///
int millisecond;
} cef_time_t;
///
// Converts cef_time_t to/from time_t. Returns true (1) on success and false (0)
// on failure.
/// Converts cef_time_t to/from time_t. Returns true (1) on success and false
/// (0) on failure.
///
CEF_EXPORT int cef_time_to_timet(const cef_time_t* cef_time, time_t* time);
CEF_EXPORT int cef_time_from_timet(time_t time, cef_time_t* cef_time);
///
// Converts cef_time_t to/from a double which is the number of seconds since
// epoch (Jan 1, 1970). Webkit uses this format to represent time. A value of 0
// means "not initialized". Returns true (1) on success and false (0) on
// failure.
/// Converts cef_time_t to/from a double which is the number of seconds since
/// epoch (Jan 1, 1970). Webkit uses this format to represent time. A value of 0
/// means "not initialized". Returns true (1) on success and false (0) on
/// failure.
///
CEF_EXPORT int cef_time_to_doublet(const cef_time_t* cef_time, double* time);
CEF_EXPORT int cef_time_from_doublet(double time, cef_time_t* cef_time);
///
// Retrieve the current system time. Returns true (1) on success and false (0)
// on failure.
/// Retrieve the current system time. Returns true (1) on success and false (0)
/// on failure.
///
CEF_EXPORT int cef_time_now(cef_time_t* cef_time);
///
// Retrieve the current system time.
/// Retrieve the current system time.
///
CEF_EXPORT cef_basetime_t cef_basetime_now();
///
// Retrieve the delta in milliseconds between two time values. Returns true (1)
// on success and false (0) on failure.
/// Retrieve the delta in milliseconds between two time values. Returns true (1)
/// on success and false (0) on failure.
//
CEF_EXPORT int cef_time_delta(const cef_time_t* cef_time1,
const cef_time_t* cef_time2,
long long* delta);
///
// Converts cef_time_t to cef_basetime_t. Returns true (1) on success and
// false (0) on failure.
/// Converts cef_time_t to cef_basetime_t. Returns true (1) on success and
/// false (0) on failure.
///
CEF_EXPORT int cef_time_to_basetime(const cef_time_t* from, cef_basetime_t* to);
///
// Converts cef_basetime_t to cef_time_t. Returns true (1) on success and
// false (0) on failure.
/// Converts cef_basetime_t to cef_time_t. Returns true (1) on success and
/// false (0) on failure.
///
CEF_EXPORT int cef_time_from_basetime(const cef_basetime_t from,
cef_time_t* to);

View File

@@ -38,11 +38,11 @@
#endif
///
// Represents a wall clock time in UTC. Values are not guaranteed to be
// monotonically non-decreasing and are subject to large amounts of skew.
// Time is stored internally as microseconds since the Windows epoch (1601).
//
// This is equivalent of Chromium `base::Time` (see base/time/time.h).
/// Represents a wall clock time in UTC. Values are not guaranteed to be
/// monotonically non-decreasing and are subject to large amounts of skew.
/// Time is stored internally as microseconds since the Windows epoch (1601).
///
/// This is equivalent of Chromium `base::Time` (see base/time/time.h).
///
class CefBaseTime : public cef_basetime_t {
public:
@@ -62,7 +62,7 @@ class CefBaseTime : public cef_basetime_t {
};
///
// Class representing a time.
/// Class representing a time.
///
class CefTime : public cef_time_t {
public:
@@ -71,7 +71,9 @@ class CefTime : public cef_time_t {
explicit CefTime(time_t r) { SetTimeT(r); }
explicit CefTime(double r) { SetDoubleT(r); }
// Converts to/from time_t.
///
/// Converts to/from time_t.
///
void SetTimeT(time_t r) { cef_time_from_timet(r, this); }
time_t GetTimeT() const {
time_t time = 0;
@@ -79,9 +81,11 @@ class CefTime : public cef_time_t {
return time;
}
// Converts to/from a double which is the number of seconds since epoch
// (Jan 1, 1970). Webkit uses this format to represent time. A value of 0
// means "not initialized".
///
/// Converts to/from a double which is the number of seconds since epoch
/// (Jan 1, 1970). Webkit uses this format to represent time. A value of 0
/// means "not initialized".
///
void SetDoubleT(double r) { cef_time_from_doublet(r, this); }
double GetDoubleT() const {
double time = 0;
@@ -89,10 +93,14 @@ class CefTime : public cef_time_t {
return time;
}
// Set this object to now.
///
/// Set this object to now.
///
void Now() { cef_time_now(this); }
// Return the delta between this object and |other| in milliseconds.
///
/// Return the delta between this object and |other| in milliseconds.
///
long long Delta(const CefTime& other) {
long long delta = 0;
cef_time_delta(this, &other, &delta);

File diff suppressed because it is too large Load Diff

View File

@@ -36,7 +36,7 @@ extern "C" {
#endif
///
// Structure representing a point.
/// Structure representing a point.
///
typedef struct _cef_point_t {
int x;
@@ -44,7 +44,7 @@ typedef struct _cef_point_t {
} cef_point_t;
///
// Structure representing a rectangle.
/// Structure representing a rectangle.
///
typedef struct _cef_rect_t {
int x;
@@ -54,7 +54,7 @@ typedef struct _cef_rect_t {
} cef_rect_t;
///
// Structure representing a size.
/// Structure representing a size.
///
typedef struct _cef_size_t {
int width;
@@ -62,7 +62,7 @@ typedef struct _cef_size_t {
} cef_size_t;
///
// Structure representing insets.
/// Structure representing insets.
///
typedef struct _cef_insets_t {
int top;

View File

@@ -65,15 +65,15 @@ extern "C" {
#endif
///
// Return the singleton X11 display shared with Chromium. The display is not
// thread-safe and must only be accessed on the browser process UI thread.
/// Return the singleton X11 display shared with Chromium. The display is not
/// thread-safe and must only be accessed on the browser process UI thread.
///
#if defined(CEF_X11)
CEF_EXPORT XDisplay* cef_get_xdisplay(void);
#endif
///
// Structure representing CefExecuteProcess arguments.
/// Structure representing CefExecuteProcess arguments.
///
typedef struct _cef_main_args_t {
int argc;
@@ -81,58 +81,58 @@ typedef struct _cef_main_args_t {
} cef_main_args_t;
///
// Class representing window information.
/// Class representing window information.
///
typedef struct _cef_window_info_t {
///
// The initial title of the window, to be set when the window is created.
// Some layout managers (e.g., Compiz) can look at the window title
// in order to decide where to place the window when it is
// created. When this attribute is not empty, the window title will
// be set before the window is mapped to the dispay. Otherwise the
// title will be initially empty.
/// The initial title of the window, to be set when the window is created.
/// Some layout managers (e.g., Compiz) can look at the window title
/// in order to decide where to place the window when it is
/// created. When this attribute is not empty, the window title will
/// be set before the window is mapped to the dispay. Otherwise the
/// title will be initially empty.
///
cef_string_t window_name;
///
// Initial window bounds.
/// Initial window bounds.
///
cef_rect_t bounds;
///
// Pointer for the parent window.
/// Pointer for the parent window.
///
cef_window_handle_t parent_window;
///
// Set to true (1) to create the browser using windowless (off-screen)
// rendering. No window will be created for the browser and all rendering will
// occur via the CefRenderHandler interface. The |parent_window| value will be
// used to identify monitor info and to act as the parent window for dialogs,
// context menus, etc. If |parent_window| is not provided then the main screen
// monitor will be used and some functionality that requires a parent window
// may not function correctly. In order to create windowless browsers the
// CefSettings.windowless_rendering_enabled value must be set to true.
// Transparent painting is enabled by default but can be disabled by setting
// CefBrowserSettings.background_color to an opaque value.
/// Set to true (1) to create the browser using windowless (off-screen)
/// rendering. No window will be created for the browser and all rendering
/// will occur via the CefRenderHandler interface. The |parent_window| value
/// will be used to identify monitor info and to act as the parent window for
/// dialogs, context menus, etc. If |parent_window| is not provided then the
/// main screen monitor will be used and some functionality that requires a
/// parent window may not function correctly. In order to create windowless
/// browsers the CefSettings.windowless_rendering_enabled value must be set to
/// true. Transparent painting is enabled by default but can be disabled by
/// setting CefBrowserSettings.background_color to an opaque value.
///
int windowless_rendering_enabled;
///
// Set to true (1) to enable shared textures for windowless rendering. Only
// valid if windowless_rendering_enabled above is also set to true. Currently
// only supported on Windows (D3D11).
/// Set to true (1) to enable shared textures for windowless rendering. Only
/// valid if windowless_rendering_enabled above is also set to true. Currently
/// only supported on Windows (D3D11).
///
int shared_texture_enabled;
///
// Set to true (1) to enable the ability to issue BeginFrame requests from the
// client application by calling CefBrowserHost::SendExternalBeginFrame.
/// Set to true (1) to enable the ability to issue BeginFrame requests from
/// the client application by calling CefBrowserHost::SendExternalBeginFrame.
///
int external_begin_frame_enabled;
///
// Pointer for the new browser window. Only used with windowed rendering.
/// Pointer for the new browser window. Only used with windowed rendering.
///
cef_window_handle_t window;
} cef_window_info_t;

View File

@@ -74,7 +74,7 @@ extern "C" {
#endif
///
// Structure representing CefExecuteProcess arguments.
/// Structure representing CefExecuteProcess arguments.
///
typedef struct _cef_main_args_t {
int argc;
@@ -82,55 +82,56 @@ typedef struct _cef_main_args_t {
} cef_main_args_t;
///
// Class representing window information.
/// Class representing window information.
///
typedef struct _cef_window_info_t {
cef_string_t window_name;
///
// Initial window bounds.
/// Initial window bounds.
///
cef_rect_t bounds;
///
// Set to true (1) to create the view initially hidden.
/// Set to true (1) to create the view initially hidden.
///
int hidden;
///
// NSView pointer for the parent view.
/// NSView pointer for the parent view.
///
cef_window_handle_t parent_view;
///
// Set to true (1) to create the browser using windowless (off-screen)
// rendering. No view will be created for the browser and all rendering will
// occur via the CefRenderHandler interface. The |parent_view| value will be
// used to identify monitor info and to act as the parent view for dialogs,
// context menus, etc. If |parent_view| is not provided then the main screen
// monitor will be used and some functionality that requires a parent view
// may not function correctly. In order to create windowless browsers the
// CefSettings.windowless_rendering_enabled value must be set to true.
// Transparent painting is enabled by default but can be disabled by setting
// CefBrowserSettings.background_color to an opaque value.
/// Set to true (1) to create the browser using windowless (off-screen)
/// rendering. No view will be created for the browser and all rendering will
/// occur via the CefRenderHandler interface. The |parent_view| value will be
/// used to identify monitor info and to act as the parent view for dialogs,
/// context menus, etc. If |parent_view| is not provided then the main screen
/// monitor will be used and some functionality that requires a parent view
/// may not function correctly. In order to create windowless browsers the
/// CefSettings.windowless_rendering_enabled value must be set to true.
/// Transparent painting is enabled by default but can be disabled by setting
/// CefBrowserSettings.background_color to an opaque value.
///
int windowless_rendering_enabled;
///
// Set to true (1) to enable shared textures for windowless rendering. Only
// valid if windowless_rendering_enabled above is also set to true. Currently
// only supported on Windows (D3D11).
/// Set to true (1) to enable shared textures for windowless rendering. Only
/// valid if windowless_rendering_enabled above is also set to true. Currently
/// only supported on Windows (D3D11).
///
int shared_texture_enabled;
///
// Set to true (1) to enable the ability to issue BeginFrame from the client
// application.
/// Set to true (1) to enable the ability to issue BeginFrame from the client
/// application.
///
int external_begin_frame_enabled;
///
// NSView pointer for the new browser view. Only used with windowed rendering.
/// NSView pointer for the new browser view. Only used with windowed
/// rendering.
///
cef_window_handle_t view;
} cef_window_info_t;

View File

@@ -53,14 +53,14 @@ extern "C" {
#endif
///
// Structure representing CefExecuteProcess arguments.
/// Structure representing CefExecuteProcess arguments.
///
typedef struct _cef_main_args_t {
HINSTANCE instance;
} cef_main_args_t;
///
// Structure representing window information.
/// Structure representing window information.
///
typedef struct _cef_window_info_t {
// Standard parameters required by CreateWindowEx()
@@ -72,34 +72,34 @@ typedef struct _cef_window_info_t {
HMENU menu;
///
// Set to true (1) to create the browser using windowless (off-screen)
// rendering. No window will be created for the browser and all rendering will
// occur via the CefRenderHandler interface. The |parent_window| value will be
// used to identify monitor info and to act as the parent window for dialogs,
// context menus, etc. If |parent_window| is not provided then the main screen
// monitor will be used and some functionality that requires a parent window
// may not function correctly. In order to create windowless browsers the
// CefSettings.windowless_rendering_enabled value must be set to true.
// Transparent painting is enabled by default but can be disabled by setting
// CefBrowserSettings.background_color to an opaque value.
/// Set to true (1) to create the browser using windowless (off-screen)
/// rendering. No window will be created for the browser and all rendering
/// will occur via the CefRenderHandler interface. The |parent_window| value
/// will be used to identify monitor info and to act as the parent window for
/// dialogs, context menus, etc. If |parent_window| is not provided then the
/// main screen monitor will be used and some functionality that requires a
/// parent window may not function correctly. In order to create windowless
/// browsers the CefSettings.windowless_rendering_enabled value must be set to
/// true. Transparent painting is enabled by default but can be disabled by
/// setting CefBrowserSettings.background_color to an opaque value.
///
int windowless_rendering_enabled;
///
// Set to true (1) to enable shared textures for windowless rendering. Only
// valid if windowless_rendering_enabled above is also set to true. Currently
// only supported on Windows (D3D11).
/// Set to true (1) to enable shared textures for windowless rendering. Only
/// valid if windowless_rendering_enabled above is also set to true. Currently
/// only supported on Windows (D3D11).
///
int shared_texture_enabled;
///
// Set to true (1) to enable the ability to issue BeginFrame requests from the
// client application by calling CefBrowserHost::SendExternalBeginFrame.
/// Set to true (1) to enable the ability to issue BeginFrame requests from
/// the client application by calling CefBrowserHost::SendExternalBeginFrame.
///
int external_begin_frame_enabled;
///
// Handle for the new browser window. Only used with windowed rendering.
/// Handle for the new browser window. Only used with windowed rendering.
///
cef_window_handle_t window;
} cef_window_info_t;

View File

@@ -36,8 +36,9 @@
#include "include/internal/cef_types.h"
///
// Template class that provides common functionality for CEF structure wrapping.
// Use only with non-POD types that benefit from referencing unowned members.
/// Template class that provides common functionality for CEF structure
/// wrapping. Use only with non-POD types that benefit from referencing unowned
/// members.
///
template <class traits>
class CefStructBase : public traits::struct_type {
@@ -62,8 +63,8 @@ class CefStructBase : public traits::struct_type {
}
///
// Attach to the source structure's existing values. DetachTo() can be called
// to insert the values back into the existing structure.
/// Attach to the source structure's existing values. DetachTo() can be called
/// to insert the values back into the existing structure.
///
void AttachTo(struct_type& source) {
// Only clear this object's data if it isn't currently attached to a
@@ -79,7 +80,7 @@ class CefStructBase : public traits::struct_type {
}
///
// Relinquish ownership of values to the target structure.
/// Relinquish ownership of values to the target structure.
///
void DetachTo(struct_type& target) {
if (attached_to_ != &target) {
@@ -96,8 +97,8 @@ class CefStructBase : public traits::struct_type {
}
///
// Set this object's values. If |copy| is true the source structure's values
// will be copied instead of referenced.
/// Set this object's values. If |copy| is true the source structure's values
/// will be copied instead of referenced.
///
void Set(const struct_type& source, bool copy) {
traits::set(&source, this, copy);
@@ -125,7 +126,7 @@ class CefStructBase : public traits::struct_type {
};
///
// Class representing a point.
/// Class representing a point.
///
class CefPoint : public cef_point_t {
public:
@@ -146,7 +147,7 @@ inline bool operator!=(const CefPoint& a, const CefPoint& b) {
}
///
// Class representing a rectangle.
/// Class representing a rectangle.
///
class CefRect : public cef_rect_t {
public:
@@ -160,9 +161,11 @@ class CefRect : public cef_rect_t {
x = x_val, y = y_val, width = width_val, height = height_val;
}
// Returns true if the point identified by point_x and point_y falls inside
// this rectangle. The point (x, y) is inside the rectangle, but the
// point (x + width, y + height) is not.
///
/// Returns true if the point identified by point_x and point_y falls inside
/// this rectangle. The point (x, y) is inside the rectangle, but the
/// point (x + width, y + height) is not.
///
bool Contains(int point_x, int point_y) const {
return (point_x >= x) && (point_x < x + width) && (point_y >= y) &&
(point_y < y + height);
@@ -181,7 +184,7 @@ inline bool operator!=(const CefRect& a, const CefRect& b) {
}
///
// Class representing a size.
/// Class representing a size.
///
class CefSize : public cef_size_t {
public:
@@ -204,7 +207,7 @@ inline bool operator!=(const CefSize& a, const CefSize& b) {
}
///
// Class representing a range.
/// Class representing a range.
///
class CefRange : public cef_range_t {
public:
@@ -224,7 +227,7 @@ inline bool operator!=(const CefRange& a, const CefRange& b) {
}
///
// Class representing insets.
/// Class representing insets.
///
class CefInsets : public cef_insets_t {
public:
@@ -248,7 +251,7 @@ inline bool operator!=(const CefInsets& a, const CefInsets& b) {
}
///
// Class representing a draggable region.
/// Class representing a draggable region.
///
class CefDraggableRegion : public cef_draggable_region_t {
public:
@@ -274,8 +277,8 @@ inline bool operator!=(const CefDraggableRegion& a,
}
///
// Class representing the virtual screen information for use when window
// rendering is disabled.
/// Class representing the virtual screen information for use when window
/// rendering is disabled.
///
class CefScreenInfo : public cef_screen_info_t {
public:
@@ -306,7 +309,7 @@ class CefScreenInfo : public cef_screen_info_t {
};
///
// Class representing a a keyboard event.
/// Class representing a a keyboard event.
///
class CefKeyEvent : public cef_key_event_t {
public:
@@ -315,7 +318,7 @@ class CefKeyEvent : public cef_key_event_t {
};
///
// Class representing a mouse event.
/// Class representing a mouse event.
///
class CefMouseEvent : public cef_mouse_event_t {
public:
@@ -324,7 +327,7 @@ class CefMouseEvent : public cef_mouse_event_t {
};
///
// Class representing a touch event.
/// Class representing a touch event.
///
class CefTouchEvent : public cef_touch_event_t {
public:
@@ -333,7 +336,7 @@ class CefTouchEvent : public cef_touch_event_t {
};
///
// Class representing popup window features.
/// Class representing popup window features.
///
class CefPopupFeatures : public cef_popup_features_t {
public:
@@ -424,7 +427,7 @@ struct CefSettingsTraits {
};
///
// Class representing initialization settings.
/// Class representing initialization settings.
///
using CefSettings = CefStructBase<CefSettingsTraits>;
@@ -459,7 +462,7 @@ struct CefRequestContextSettingsTraits {
};
///
// Class representing request context initialization settings.
/// Class representing request context initialization settings.
///
using CefRequestContextSettings =
CefStructBase<CefRequestContextSettingsTraits>;
@@ -535,7 +538,7 @@ struct CefBrowserSettingsTraits {
};
///
// Class representing browser initialization settings.
/// Class representing browser initialization settings.
///
using CefBrowserSettings = CefStructBase<CefBrowserSettingsTraits>;
@@ -577,12 +580,12 @@ struct CefURLPartsTraits {
};
///
// Class representing a URL's component parts.
/// Class representing a URL's component parts.
///
using CefURLParts = CefStructBase<CefURLPartsTraits>;
///
// Class representing the state of a touch handle.
/// Class representing the state of a touch handle.
///
class CefTouchHandleState : public cef_touch_handle_state_t {
public:
@@ -622,12 +625,12 @@ struct CefCookieTraits {
};
///
// Class representing a cookie.
/// Class representing a cookie.
///
using CefCookie = CefStructBase<CefCookieTraits>;
///
// Class representing cursor information.
/// Class representing cursor information.
///
class CefCursorInfo : public cef_cursor_info_t {
public:
@@ -673,12 +676,12 @@ struct CefPdfPrintSettingsTraits {
};
///
// Class representing PDF print settings
/// Class representing PDF print settings
///
using CefPdfPrintSettings = CefStructBase<CefPdfPrintSettingsTraits>;
///
// Class representing CefBoxLayout settings.
/// Class representing CefBoxLayout settings.
///
class CefBoxLayoutSettings : public cef_box_layout_settings_t {
public:
@@ -688,7 +691,7 @@ class CefBoxLayoutSettings : public cef_box_layout_settings_t {
};
///
// Class representing IME composition underline.
/// Class representing IME composition underline.
///
class CefCompositionUnderline : public cef_composition_underline_t {
public:
@@ -698,7 +701,7 @@ class CefCompositionUnderline : public cef_composition_underline_t {
};
///
// Class representing CefAudioParameters settings
/// Class representing CefAudioParameters settings
///
class CefAudioParameters : public cef_audio_parameters_t {
public:
@@ -729,7 +732,7 @@ struct CefMediaSinkDeviceInfoTraits {
};
///
// Class representing MediaSink device info.
/// Class representing MediaSink device info.
///
using CefMediaSinkDeviceInfo = CefStructBase<CefMediaSinkDeviceInfoTraits>;

View File

@@ -34,14 +34,14 @@
#include "include/internal/cef_types_win.h"
#include "include/internal/cef_types_wrappers.h"
///
// Handle types.
///
#define CefCursorHandle cef_cursor_handle_t
#define CefEventHandle cef_event_handle_t
#define CefWindowHandle cef_window_handle_t
// Class representing CefExecuteProcess arguments.
///
/// Class representing CefExecuteProcess arguments.
///
class CefMainArgs : public cef_main_args_t {
public:
CefMainArgs() : cef_main_args_t{} {}
@@ -76,7 +76,7 @@ struct CefWindowInfoTraits {
};
///
// Class representing window information.
/// Class representing window information.
///
class CefWindowInfo : public CefStructBase<CefWindowInfoTraits> {
public:
@@ -90,7 +90,7 @@ class CefWindowInfo : public CefStructBase<CefWindowInfoTraits> {
CefWindowInfo& operator=(CefWindowInfo&&) = default;
///
// Create the browser as a child window.
/// Create the browser as a child window.
///
void SetAsChild(CefWindowHandle parent, const CefRect& windowBounds) {
style =
@@ -100,7 +100,7 @@ class CefWindowInfo : public CefStructBase<CefWindowInfoTraits> {
}
///
// Create the browser as a popup window.
/// Create the browser as a popup window.
///
void SetAsPopup(CefWindowHandle parent, const CefString& windowName) {
style =
@@ -115,16 +115,16 @@ class CefWindowInfo : public CefStructBase<CefWindowInfoTraits> {
}
///
// Create the browser using windowless (off-screen) rendering. No window
// will be created for the browser and all rendering will occur via the
// CefRenderHandler interface. The |parent| value will be used to identify
// monitor info and to act as the parent window for dialogs, context menus,
// etc. If |parent| is not provided then the main screen monitor will be used
// and some functionality that requires a parent window may not function
// correctly. In order to create windowless browsers the
// CefSettings.windowless_rendering_enabled value must be set to true.
// Transparent painting is enabled by default but can be disabled by setting
// CefBrowserSettings.background_color to an opaque value.
/// Create the browser using windowless (off-screen) rendering. No window
/// will be created for the browser and all rendering will occur via the
/// CefRenderHandler interface. The |parent| value will be used to identify
/// monitor info and to act as the parent window for dialogs, context menus,
/// etc. If |parent| is not provided then the main screen monitor will be used
/// and some functionality that requires a parent window may not function
/// correctly. In order to create windowless browsers the
/// CefSettings.windowless_rendering_enabled value must be set to true.
/// Transparent painting is enabled by default but can be disabled by setting
/// CefBrowserSettings.background_color to an opaque value.
///
void SetAsWindowless(CefWindowHandle parent) {
windowless_rendering_enabled = TRUE;