mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-02-24 07:58:11 +01:00
- Fix Mac compile errors due to string type changes (issue #146).
- Fix Windows crash due to string type changes (issue #147). - Add missing svn:eol-style properties. git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@149 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
parent
81b7d378f7
commit
e826c9b1a0
@ -1,183 +1,184 @@
|
||||
// Copyright (c) 2010 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#ifndef _CEF_STRING_TYPES_T
|
||||
#define _CEF_STRING_TYPES_T
|
||||
|
||||
// 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
|
||||
|
||||
#include "cef_export.h"
|
||||
|
||||
// CEF character type definitions. wchat_t is 2 bytes on Windows and 4 bytes on
|
||||
// most other platforms.
|
||||
|
||||
#ifdef _WIN32
|
||||
typedef wchar_t char16_t;
|
||||
#else // _WIN32
|
||||
typedef uint16 char16_t;
|
||||
#ifndef WCHAR_T_IS_UTF32
|
||||
#define WCHAR_T_IS_UTF32
|
||||
#endif // WCHAR_T_IS_UTF32
|
||||
#endif // _WIN32
|
||||
|
||||
|
||||
// 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;
|
||||
size_t length;
|
||||
void (*dtor)(wchar_t* str);
|
||||
} cef_string_wide_t;
|
||||
|
||||
typedef struct _cef_string_utf8_t {
|
||||
char* str;
|
||||
size_t length;
|
||||
void (*dtor)(char* str);
|
||||
} cef_string_utf8_t;
|
||||
|
||||
typedef struct _cef_string_utf16_t {
|
||||
char16_t* str;
|
||||
size_t length;
|
||||
void (*dtor)(char16_t* str);
|
||||
} 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.
|
||||
|
||||
CEF_EXPORT int cef_string_wide_set(const wchar_t* src, size_t src_len,
|
||||
cef_string_wide_t* output, int copy);
|
||||
CEF_EXPORT int cef_string_utf8_set(const char* src, size_t src_len,
|
||||
cef_string_utf8_t* output, int copy);
|
||||
CEF_EXPORT int cef_string_utf16_set(const char16_t* src, size_t src_len,
|
||||
cef_string_utf16_t* output, int copy);
|
||||
|
||||
|
||||
// Convenience macros for copying values.
|
||||
|
||||
#define cef_string_wide_copy(src, src_len, output) \
|
||||
cef_string_wide_set(src, src_len, output, true)
|
||||
#define cef_string_utf8_copy(src, src_len, output) \
|
||||
cef_string_utf8_set(src, src_len, output, true)
|
||||
#define cef_string_utf16_copy(src, src_len, output) \
|
||||
cef_string_utf16_set(src, src_len, output, true)
|
||||
|
||||
|
||||
// These functions clear string values. The structure itself is not freed.
|
||||
|
||||
CEF_EXPORT void cef_string_wide_clear(cef_string_wide_t* str);
|
||||
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().
|
||||
|
||||
CEF_EXPORT int cef_string_wide_cmp(const cef_string_wide_t* str1,
|
||||
const cef_string_wide_t* str2);
|
||||
CEF_EXPORT int cef_string_utf8_cmp(const cef_string_utf8_t* str1,
|
||||
const cef_string_utf8_t* str2);
|
||||
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.
|
||||
|
||||
CEF_EXPORT int cef_string_wide_to_utf8(const wchar_t* src, size_t src_len,
|
||||
cef_string_utf8_t* output);
|
||||
CEF_EXPORT int cef_string_utf8_to_wide(const char* src, size_t src_len,
|
||||
cef_string_wide_t* output);
|
||||
|
||||
CEF_EXPORT int cef_string_wide_to_utf16(const wchar_t* src, size_t src_len,
|
||||
cef_string_utf16_t* output);
|
||||
CEF_EXPORT int cef_string_utf16_to_wide(const char16_t* src, size_t src_len,
|
||||
cef_string_wide_t* output);
|
||||
|
||||
CEF_EXPORT int cef_string_utf8_to_utf16(const char* src, size_t src_len,
|
||||
cef_string_utf16_t* output);
|
||||
CEF_EXPORT int cef_string_utf16_to_utf8(const char16_t* src, size_t src_len,
|
||||
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.
|
||||
|
||||
CEF_EXPORT int cef_string_ascii_to_wide(const char* src, size_t src_len,
|
||||
cef_string_wide_t* output);
|
||||
CEF_EXPORT int cef_string_ascii_to_utf16(const char* src, size_t src_len,
|
||||
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.
|
||||
|
||||
typedef cef_string_wide_t* cef_string_userfree_wide_t;
|
||||
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.
|
||||
|
||||
CEF_EXPORT cef_string_userfree_wide_t cef_string_userfree_wide_alloc();
|
||||
CEF_EXPORT cef_string_userfree_utf8_t cef_string_userfree_utf8_alloc();
|
||||
CEF_EXPORT cef_string_userfree_utf16_t cef_string_userfree_utf16_alloc();
|
||||
|
||||
|
||||
// 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);
|
||||
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);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // _CEF_STRING_TYPES_T
|
||||
// Copyright (c) 2010 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#ifndef _CEF_STRING_TYPES_T
|
||||
#define _CEF_STRING_TYPES_T
|
||||
|
||||
// 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
|
||||
|
||||
#include "cef_export.h"
|
||||
#include <stddef.h>
|
||||
|
||||
// CEF character type definitions. wchat_t is 2 bytes on Windows and 4 bytes on
|
||||
// most other platforms.
|
||||
|
||||
#ifdef _WIN32
|
||||
typedef wchar_t char16_t;
|
||||
#else // _WIN32
|
||||
typedef unsigned short char16_t;
|
||||
#ifndef WCHAR_T_IS_UTF32
|
||||
#define WCHAR_T_IS_UTF32
|
||||
#endif // WCHAR_T_IS_UTF32
|
||||
#endif // _WIN32
|
||||
|
||||
|
||||
// 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;
|
||||
size_t length;
|
||||
void (*dtor)(wchar_t* str);
|
||||
} cef_string_wide_t;
|
||||
|
||||
typedef struct _cef_string_utf8_t {
|
||||
char* str;
|
||||
size_t length;
|
||||
void (*dtor)(char* str);
|
||||
} cef_string_utf8_t;
|
||||
|
||||
typedef struct _cef_string_utf16_t {
|
||||
char16_t* str;
|
||||
size_t length;
|
||||
void (*dtor)(char16_t* str);
|
||||
} 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.
|
||||
|
||||
CEF_EXPORT int cef_string_wide_set(const wchar_t* src, size_t src_len,
|
||||
cef_string_wide_t* output, int copy);
|
||||
CEF_EXPORT int cef_string_utf8_set(const char* src, size_t src_len,
|
||||
cef_string_utf8_t* output, int copy);
|
||||
CEF_EXPORT int cef_string_utf16_set(const char16_t* src, size_t src_len,
|
||||
cef_string_utf16_t* output, int copy);
|
||||
|
||||
|
||||
// Convenience macros for copying values.
|
||||
|
||||
#define cef_string_wide_copy(src, src_len, output) \
|
||||
cef_string_wide_set(src, src_len, output, true)
|
||||
#define cef_string_utf8_copy(src, src_len, output) \
|
||||
cef_string_utf8_set(src, src_len, output, true)
|
||||
#define cef_string_utf16_copy(src, src_len, output) \
|
||||
cef_string_utf16_set(src, src_len, output, true)
|
||||
|
||||
|
||||
// These functions clear string values. The structure itself is not freed.
|
||||
|
||||
CEF_EXPORT void cef_string_wide_clear(cef_string_wide_t* str);
|
||||
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().
|
||||
|
||||
CEF_EXPORT int cef_string_wide_cmp(const cef_string_wide_t* str1,
|
||||
const cef_string_wide_t* str2);
|
||||
CEF_EXPORT int cef_string_utf8_cmp(const cef_string_utf8_t* str1,
|
||||
const cef_string_utf8_t* str2);
|
||||
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.
|
||||
|
||||
CEF_EXPORT int cef_string_wide_to_utf8(const wchar_t* src, size_t src_len,
|
||||
cef_string_utf8_t* output);
|
||||
CEF_EXPORT int cef_string_utf8_to_wide(const char* src, size_t src_len,
|
||||
cef_string_wide_t* output);
|
||||
|
||||
CEF_EXPORT int cef_string_wide_to_utf16(const wchar_t* src, size_t src_len,
|
||||
cef_string_utf16_t* output);
|
||||
CEF_EXPORT int cef_string_utf16_to_wide(const char16_t* src, size_t src_len,
|
||||
cef_string_wide_t* output);
|
||||
|
||||
CEF_EXPORT int cef_string_utf8_to_utf16(const char* src, size_t src_len,
|
||||
cef_string_utf16_t* output);
|
||||
CEF_EXPORT int cef_string_utf16_to_utf8(const char16_t* src, size_t src_len,
|
||||
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.
|
||||
|
||||
CEF_EXPORT int cef_string_ascii_to_wide(const char* src, size_t src_len,
|
||||
cef_string_wide_t* output);
|
||||
CEF_EXPORT int cef_string_ascii_to_utf16(const char* src, size_t src_len,
|
||||
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.
|
||||
|
||||
typedef cef_string_wide_t* cef_string_userfree_wide_t;
|
||||
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.
|
||||
|
||||
CEF_EXPORT cef_string_userfree_wide_t cef_string_userfree_wide_alloc();
|
||||
CEF_EXPORT cef_string_userfree_utf8_t cef_string_userfree_utf8_alloc();
|
||||
CEF_EXPORT cef_string_userfree_utf16_t cef_string_userfree_utf16_alloc();
|
||||
|
||||
|
||||
// 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);
|
||||
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);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // _CEF_STRING_TYPES_T
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -245,7 +245,7 @@ CefRefPtr<CefFrame> CefBrowserImpl::GetCefFrame(WebFrame* frame)
|
||||
cef_frame = frame_main_;
|
||||
} else {
|
||||
// Locate or create the appropriate named reference.
|
||||
CefString name = frame->name();
|
||||
CefString name = string16(frame->name());
|
||||
DCHECK(!name.empty());
|
||||
FrameMap::const_iterator it = frames_.find(name);
|
||||
if(it != frames_.end())
|
||||
@ -381,7 +381,7 @@ CefString CefBrowserImpl::GetSource(CefRefPtr<CefFrame> frame)
|
||||
// Retrieve the document string directly
|
||||
WebKit::WebFrame* web_frame = GetWebFrame(frame);
|
||||
if(web_frame)
|
||||
return web_frame->contentAsMarkup();
|
||||
return string16(web_frame->contentAsMarkup());
|
||||
return CefString();
|
||||
}
|
||||
}
|
||||
@ -474,7 +474,7 @@ CefString CefBrowserImpl::GetURL(CefRefPtr<CefFrame> frame)
|
||||
{
|
||||
WebFrame* web_frame = GetWebFrame(frame);
|
||||
if(web_frame)
|
||||
return web_frame->url().spec();
|
||||
return std::string(web_frame->url().spec());
|
||||
return CefString();
|
||||
}
|
||||
|
||||
|
@ -391,6 +391,7 @@ void CefBrowserImpl::UIT_PrintPages(WebKit::WebFrame* frame) {
|
||||
// Make a copy of settings.
|
||||
printing::PrintSettings settings = print_context_.settings();
|
||||
cef_print_options_t print_options;
|
||||
memset(&print_options, 0, sizeof(print_options));
|
||||
settings.UpdatePrintOptions(print_options);
|
||||
|
||||
// Ask the handler if they want to update the print options.
|
||||
|
@ -1,13 +1,13 @@
|
||||
// Copyright (c) 2010 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 _CEF_BROWSER_SETTINGS_H
|
||||
#define _CEF_BROWSER_SETTINGS_H
|
||||
|
||||
class CefBrowserSettings;
|
||||
struct WebPreferences;
|
||||
|
||||
void BrowserToWebSettings(const CefBrowserSettings& cef, WebPreferences& web);
|
||||
|
||||
#endif // _CEF_BROWSER_SETTINGS_H
|
||||
// Copyright (c) 2010 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 _CEF_BROWSER_SETTINGS_H
|
||||
#define _CEF_BROWSER_SETTINGS_H
|
||||
|
||||
class CefBrowserSettings;
|
||||
struct WebPreferences;
|
||||
|
||||
void BrowserToWebSettings(const CefBrowserSettings& cef, WebPreferences& web);
|
||||
|
||||
#endif // _CEF_BROWSER_SETTINGS_H
|
||||
|
@ -195,27 +195,26 @@ void BrowserWebViewDelegate::DidMovePlugin(
|
||||
// Protected methods ----------------------------------------------------------
|
||||
|
||||
void BrowserWebViewDelegate::ShowJavaScriptAlert(
|
||||
WebKit::WebFrame* webframe, const std::wstring& message) {
|
||||
NSString *text =
|
||||
[NSString stringWithUTF8String:(std::string(message).c_str())];
|
||||
WebKit::WebFrame* webframe, const CefString& message) {
|
||||
std::string messageStr(message);
|
||||
NSString *text = [NSString stringWithUTF8String:messageStr.c_str()];
|
||||
NSAlert *alert = [NSAlert alertWithMessageText:@"JavaScript Alert"
|
||||
defaultButton:@"OK"
|
||||
alternateButton:nil
|
||||
otherButton:nil
|
||||
informativeTextWithFormat:text];
|
||||
[alert runModal];
|
||||
[text release];
|
||||
}
|
||||
|
||||
bool BrowserWebViewDelegate::ShowJavaScriptConfirm(
|
||||
WebKit::WebFrame* webframe, const std::wstring& message) {
|
||||
WebKit::WebFrame* webframe, const CefString& message) {
|
||||
NOTIMPLEMENTED();
|
||||
return false;
|
||||
}
|
||||
|
||||
bool BrowserWebViewDelegate::ShowJavaScriptPrompt(
|
||||
WebKit::WebFrame* webframe, const std::wstring& message,
|
||||
const std::wstring& default_value, std::wstring* result) {
|
||||
WebKit::WebFrame* webframe, const CefString& message,
|
||||
const CefString& default_value, CefString* result) {
|
||||
NOTIMPLEMENTED();
|
||||
return false;
|
||||
}
|
||||
@ -228,17 +227,3 @@ bool BrowserWebViewDelegate::ShowFileChooser(std::vector<FilePath>& file_names,
|
||||
NOTIMPLEMENTED();
|
||||
return false;
|
||||
}
|
||||
|
||||
// Private methods ------------------------------------------------------------
|
||||
/*
|
||||
void BrowserWebViewDelegate::SetPageTitle(const std::wstring& title) {
|
||||
[[browser_->GetWebViewHost()->view_handle() window]
|
||||
setTitle:[NSString stringWithUTF8String:(std::string(title).c_str())]];
|
||||
}
|
||||
|
||||
void BrowserWebViewDelegate::SetAddressBarURL(const GURL& url) {
|
||||
const char* frameURL = url.spec().c_str();
|
||||
NSString *address = [NSString stringWithUTF8String:frameURL];
|
||||
[browser_->GetEditWnd() setStringValue:address];
|
||||
}
|
||||
*/
|
||||
|
@ -283,6 +283,8 @@ void BrowserWebViewDelegate::showContextMenu(
|
||||
if(handler.get()) {
|
||||
// Gather menu information
|
||||
CefHandler::MenuInfo menuInfo;
|
||||
memset(&menuInfo, 0, sizeof(menuInfo));
|
||||
|
||||
CefString linkStr(std::string(data.linkURL.spec()));
|
||||
CefString imageStr(std::string(data.srcURL.spec()));
|
||||
CefString pageStr(std::string(data.pageURL.spec()));
|
||||
|
@ -67,11 +67,7 @@ static void UIT_RegisterPlugin(struct CefPluginInfo* plugin_info)
|
||||
|
||||
NPAPI::PluginVersionInfo info;
|
||||
|
||||
#if defined(OS_WIN)
|
||||
info.path = FilePath(plugin_info->unique_name);
|
||||
#else
|
||||
info.path = FilePath(WideToUTF8(plugin_info->unique_name));
|
||||
#endif
|
||||
info.product_name = plugin_info->display_name;
|
||||
info.file_description = plugin_info->description;
|
||||
info.file_version =plugin_info->version;
|
||||
|
@ -167,7 +167,8 @@ CEF_EXPORT int cef_string_utf16_cmp(const cef_string_utf16_t* str1,
|
||||
if (str1->length == 0 && str2->length == 0)
|
||||
return 0;
|
||||
#if defined(WCHAR_T_IS_UTF32)
|
||||
int r = c16memcmp(str1->str, str2->str, std::min(str1->length, str2->length));
|
||||
int r = base::c16memcmp(str1->str, str2->str, std::min(str1->length,
|
||||
str2->length));
|
||||
#else
|
||||
int r = wcsncmp(str1->str, str2->str, std::min(str1->length, str2->length));
|
||||
#endif
|
||||
|
@ -448,11 +448,7 @@ void CefPostDataElementImpl::Set(const net::UploadData::Element& element)
|
||||
std::string(element.bytes().begin(),
|
||||
element.bytes().end()).c_str()));
|
||||
} else if (element.type() == net::UploadData::TYPE_FILE) {
|
||||
#if defined(OS_WIN)
|
||||
SetToFile(element.file_path().value());
|
||||
#else
|
||||
SetToFile(UTF8ToWide(element.file_path().value()));
|
||||
#endif
|
||||
} else {
|
||||
NOTREACHED();
|
||||
}
|
||||
|
@ -214,7 +214,7 @@ void WebWidgetHost::Paint() {
|
||||
}
|
||||
}
|
||||
|
||||
void WebWidgetHost::SetTooltipText(const std::string& tooltip_text) {
|
||||
void WebWidgetHost::SetTooltipText(const CefString& tooltip_text) {
|
||||
// TODO(port): Implement this method.
|
||||
}
|
||||
|
||||
|
@ -53,9 +53,10 @@ enum cef_retval_t CEF_CALLBACK handler_handle_before_created(
|
||||
if(parentBrowser)
|
||||
browserPtr = CefBrowserCToCpp::Wrap(parentBrowser);
|
||||
|
||||
CefString urlStr(url);
|
||||
enum cef_retval_t rv = CefHandlerCppToC::Get(self)->HandleBeforeCreated(
|
||||
browserPtr, wndInfo, popup?true:false, features, handlerPtr,
|
||||
CefString(url), browserSettings);
|
||||
urlStr, browserSettings);
|
||||
|
||||
if(handlerPtr.get() != origHandler) {
|
||||
// The handler has been changed.
|
||||
@ -177,9 +178,10 @@ enum cef_retval_t CEF_CALLBACK handler_handle_load_error(
|
||||
if(!self || !browser || !errorText || !frame)
|
||||
return RV_CONTINUE;
|
||||
|
||||
CefString errorTextStr(errorText);
|
||||
return CefHandlerCppToC::Get(self)->HandleLoadError(
|
||||
CefBrowserCToCpp::Wrap(browser), CefFrameCToCpp::Wrap(frame), errorCode,
|
||||
CefString(failedUrl), CefString(errorText));
|
||||
CefString(failedUrl), errorTextStr);
|
||||
}
|
||||
|
||||
enum cef_retval_t CEF_CALLBACK handler_handle_before_resource_load(
|
||||
@ -198,10 +200,12 @@ enum cef_retval_t CEF_CALLBACK handler_handle_before_resource_load(
|
||||
|
||||
CefRefPtr<CefStreamReader> streamPtr;
|
||||
|
||||
CefString redirectUrlStr(redirectUrl);
|
||||
CefString mimeTypeStr(mimeType);
|
||||
enum cef_retval_t rv = CefHandlerCppToC::Get(self)->
|
||||
HandleBeforeResourceLoad(CefBrowserCToCpp::Wrap(browser),
|
||||
CefRequestCToCpp::Wrap(request), CefString(redirectUrl), streamPtr,
|
||||
CefString(mimeType), loadFlags);
|
||||
CefRequestCToCpp::Wrap(request), redirectUrlStr, streamPtr, mimeTypeStr,
|
||||
loadFlags);
|
||||
|
||||
if(streamPtr.get())
|
||||
*resourceStream = CefStreamReaderCToCpp::Unwrap(streamPtr);
|
||||
@ -257,8 +261,9 @@ enum cef_retval_t CEF_CALLBACK handler_handle_get_menu_label(
|
||||
if(!self || !browser || !label)
|
||||
return RV_CONTINUE;
|
||||
|
||||
CefString labelStr(label);
|
||||
return CefHandlerCppToC::Get(self)->HandleGetMenuLabel(
|
||||
CefBrowserCToCpp::Wrap(browser), menuId, CefString(label));
|
||||
CefBrowserCToCpp::Wrap(browser), menuId, labelStr);
|
||||
}
|
||||
|
||||
enum cef_retval_t CEF_CALLBACK handler_handle_menu_action(
|
||||
@ -307,12 +312,17 @@ enum cef_retval_t CEF_CALLBACK handler_handle_print_header_footer(
|
||||
|
||||
CefPrintInfo info = *printInfo;
|
||||
|
||||
CefString topLeftStr(topLeft);
|
||||
CefString topCenterStr(topCenter);
|
||||
CefString topRightStr(topRight);
|
||||
CefString bottomLeftStr(bottomLeft);
|
||||
CefString bottomCenterStr(bottomCenter);
|
||||
CefString bottomRightStr(bottomRight);
|
||||
return CefHandlerCppToC::Get(self)->
|
||||
HandlePrintHeaderFooter(CefBrowserCToCpp::Wrap(browser),
|
||||
CefFrameCToCpp::Wrap(frame), info, CefString(url), CefString(title),
|
||||
currentPage, maxPages, CefString(topLeft), CefString(topCenter),
|
||||
CefString(topRight), CefString(bottomLeft), CefString(bottomCenter),
|
||||
CefString(bottomRight));
|
||||
currentPage, maxPages, topLeftStr, topCenterStr, topRightStr,
|
||||
bottomLeftStr, bottomCenterStr, bottomRightStr);
|
||||
}
|
||||
|
||||
enum cef_retval_t CEF_CALLBACK handler_handle_jsalert(
|
||||
@ -364,9 +374,10 @@ enum cef_retval_t CEF_CALLBACK handler_handle_jsprompt(
|
||||
return RV_CONTINUE;
|
||||
|
||||
bool ret = false;
|
||||
CefString resultStr(result);
|
||||
enum cef_retval_t rv = CefHandlerCppToC::Get(self)->HandleJSPrompt(
|
||||
CefBrowserCToCpp::Wrap(browser), CefFrameCToCpp::Wrap(frame),
|
||||
CefString(message), CefString(defaultValue), ret, CefString(result));
|
||||
CefString(message), CefString(defaultValue), ret, resultStr);
|
||||
*retval = (ret ? 1 : 0);
|
||||
|
||||
return rv;
|
||||
@ -448,8 +459,9 @@ enum cef_retval_t CEF_CALLBACK handler_handle_tooltip(
|
||||
if(!self || !browser || !text)
|
||||
return RV_CONTINUE;
|
||||
|
||||
CefString textStr(text);
|
||||
return CefHandlerCppToC::Get(self)->HandleTooltip(
|
||||
CefBrowserCToCpp::Wrap(browser), CefString(text));
|
||||
CefBrowserCToCpp::Wrap(browser), textStr);
|
||||
}
|
||||
|
||||
enum cef_retval_t CEF_CALLBACK handler_handle_console_message(
|
||||
|
@ -27,8 +27,9 @@ int CEF_CALLBACK scheme_handler_process_request(
|
||||
if(!self || !request || !mime_type || !response_length)
|
||||
return 0;
|
||||
|
||||
CefString mimeTypeStr(mime_type);
|
||||
return CefSchemeHandlerCppToC::Get(self)->ProcessRequest(
|
||||
CefRequestCToCpp::Wrap(request), CefString(mime_type), response_length);
|
||||
CefRequestCToCpp::Wrap(request), mimeTypeStr, response_length);
|
||||
}
|
||||
|
||||
void CEF_CALLBACK scheme_handler_cancel(struct _cef_scheme_handler_t* self)
|
||||
|
@ -35,8 +35,9 @@ int CEF_CALLBACK v8handler_execute(struct _cef_v8handler_t* self,
|
||||
}
|
||||
|
||||
CefRefPtr<CefV8Value> retValPtr;
|
||||
CefString exceptionStr(exception);
|
||||
bool rv = CefV8HandlerCppToC::Get(self)->Execute(CefString(name), objectPtr,
|
||||
list, retValPtr, CefString(exception));
|
||||
list, retValPtr, exceptionStr);
|
||||
if(rv) {
|
||||
if(retValPtr.get() && retval)
|
||||
*retval = CefV8ValueCToCpp::Unwrap(retValPtr);
|
||||
|
@ -385,8 +385,9 @@ int CEF_CALLBACK v8value_execute_function(struct _cef_v8value_t* self,
|
||||
}
|
||||
CefRefPtr<CefV8Value> retvalPtr;
|
||||
|
||||
CefString exceptionStr(exception);
|
||||
bool rv = CefV8ValueCppToC::Get(self)->ExecuteFunction(objectPtr,
|
||||
argsList, retvalPtr, CefString(exception));
|
||||
argsList, retvalPtr, exceptionStr);
|
||||
if(retvalPtr.get() && retval)
|
||||
*retval = CefV8ValueCppToC::Wrap(retvalPtr);
|
||||
|
||||
|
@ -1,384 +1,384 @@
|
||||
// Copyright (c) 2010 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.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// A portion of this file was generated by the CEF translator tool. When
|
||||
// making changes by hand only do so within the body of existing function
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
|
||||
#include "libcef_dll/cpptoc/stream_reader_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/xml_reader_cpptoc.h"
|
||||
|
||||
|
||||
// GLOBAL FUNCTIONS - Body may be edited by hand.
|
||||
|
||||
CEF_EXPORT cef_xml_reader_t* cef_xml_reader_create(cef_stream_reader_t* stream,
|
||||
enum cef_xml_encoding_type_t encodingType, const cef_string_t* URI)
|
||||
{
|
||||
CefRefPtr<CefXmlReader> impl = CefXmlReader::Create(
|
||||
CefStreamReaderCppToC::Unwrap(stream), encodingType, CefString(URI));
|
||||
if(impl.get())
|
||||
return CefXmlReaderCppToC::Wrap(impl);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
// MEMBER FUNCTIONS - Body may be edited by hand.
|
||||
|
||||
int CEF_CALLBACK xml_reader_move_to_next_node(struct _cef_xml_reader_t* self)
|
||||
{
|
||||
DCHECK(self);
|
||||
if(!self)
|
||||
return 0;
|
||||
|
||||
return CefXmlReaderCppToC::Get(self)->MoveToNextNode();
|
||||
}
|
||||
|
||||
int CEF_CALLBACK xml_reader_close(struct _cef_xml_reader_t* self)
|
||||
{
|
||||
DCHECK(self);
|
||||
if(!self)
|
||||
return 0;
|
||||
|
||||
return CefXmlReaderCppToC::Get(self)->Close();
|
||||
}
|
||||
|
||||
int CEF_CALLBACK xml_reader_has_error(struct _cef_xml_reader_t* self)
|
||||
{
|
||||
DCHECK(self);
|
||||
if(!self)
|
||||
return 0;
|
||||
|
||||
return CefXmlReaderCppToC::Get(self)->HasError();
|
||||
}
|
||||
|
||||
cef_string_userfree_t CEF_CALLBACK xml_reader_get_error(
|
||||
struct _cef_xml_reader_t* self)
|
||||
{
|
||||
DCHECK(self);
|
||||
if(!self)
|
||||
return NULL;
|
||||
|
||||
CefString retStr = CefXmlReaderCppToC::Get(self)->GetError();
|
||||
return retStr.DetachToUserFree();
|
||||
}
|
||||
|
||||
enum cef_xml_node_type_t CEF_CALLBACK xml_reader_get_type(
|
||||
struct _cef_xml_reader_t* self)
|
||||
{
|
||||
DCHECK(self);
|
||||
if(!self)
|
||||
return XML_NODE_UNSUPPORTED;
|
||||
|
||||
return CefXmlReaderCppToC::Get(self)->GetType();
|
||||
}
|
||||
|
||||
int CEF_CALLBACK xml_reader_get_depth(struct _cef_xml_reader_t* self)
|
||||
{
|
||||
DCHECK(self);
|
||||
if(!self)
|
||||
return -1;
|
||||
|
||||
return CefXmlReaderCppToC::Get(self)->GetDepth();
|
||||
}
|
||||
|
||||
cef_string_userfree_t CEF_CALLBACK xml_reader_get_local_name(
|
||||
struct _cef_xml_reader_t* self)
|
||||
{
|
||||
DCHECK(self);
|
||||
if(!self)
|
||||
return NULL;
|
||||
|
||||
CefString retStr = CefXmlReaderCppToC::Get(self)->GetLocalName();
|
||||
return retStr.DetachToUserFree();
|
||||
}
|
||||
|
||||
cef_string_userfree_t CEF_CALLBACK xml_reader_get_prefix(
|
||||
struct _cef_xml_reader_t* self)
|
||||
{
|
||||
DCHECK(self);
|
||||
if(!self)
|
||||
return NULL;
|
||||
|
||||
CefString retStr = CefXmlReaderCppToC::Get(self)->GetPrefix();
|
||||
return retStr.DetachToUserFree();
|
||||
}
|
||||
|
||||
cef_string_userfree_t CEF_CALLBACK xml_reader_get_qualified_name(
|
||||
struct _cef_xml_reader_t* self)
|
||||
{
|
||||
DCHECK(self);
|
||||
if(!self)
|
||||
return NULL;
|
||||
|
||||
CefString retStr = CefXmlReaderCppToC::Get(self)->GetQualifiedName();
|
||||
return retStr.DetachToUserFree();
|
||||
}
|
||||
|
||||
cef_string_userfree_t CEF_CALLBACK xml_reader_get_namespace_uri(
|
||||
struct _cef_xml_reader_t* self)
|
||||
{
|
||||
DCHECK(self);
|
||||
if(!self)
|
||||
return NULL;
|
||||
|
||||
CefString retStr = CefXmlReaderCppToC::Get(self)->GetNamespaceURI();
|
||||
return retStr.DetachToUserFree();
|
||||
}
|
||||
|
||||
cef_string_userfree_t CEF_CALLBACK xml_reader_get_base_uri(
|
||||
struct _cef_xml_reader_t* self)
|
||||
{
|
||||
DCHECK(self);
|
||||
if(!self)
|
||||
return NULL;
|
||||
|
||||
CefString retStr = CefXmlReaderCppToC::Get(self)->GetBaseURI();
|
||||
return retStr.DetachToUserFree();
|
||||
}
|
||||
|
||||
cef_string_userfree_t CEF_CALLBACK xml_reader_get_xml_lang(
|
||||
struct _cef_xml_reader_t* self)
|
||||
{
|
||||
DCHECK(self);
|
||||
if(!self)
|
||||
return NULL;
|
||||
|
||||
CefString retStr = CefXmlReaderCppToC::Get(self)->GetXmlLang();
|
||||
return retStr.DetachToUserFree();
|
||||
}
|
||||
|
||||
int CEF_CALLBACK xml_reader_is_empty_element(struct _cef_xml_reader_t* self)
|
||||
{
|
||||
DCHECK(self);
|
||||
if(!self)
|
||||
return 0;
|
||||
|
||||
return CefXmlReaderCppToC::Get(self)->IsEmptyElement();
|
||||
}
|
||||
|
||||
int CEF_CALLBACK xml_reader_has_value(struct _cef_xml_reader_t* self)
|
||||
{
|
||||
DCHECK(self);
|
||||
if(!self)
|
||||
return 0;
|
||||
|
||||
return CefXmlReaderCppToC::Get(self)->HasValue();
|
||||
}
|
||||
|
||||
cef_string_userfree_t CEF_CALLBACK xml_reader_get_value(
|
||||
struct _cef_xml_reader_t* self)
|
||||
{
|
||||
DCHECK(self);
|
||||
if(!self)
|
||||
return NULL;
|
||||
|
||||
CefString retStr = CefXmlReaderCppToC::Get(self)->GetValue();
|
||||
return retStr.DetachToUserFree();
|
||||
}
|
||||
|
||||
int CEF_CALLBACK xml_reader_has_attributes(struct _cef_xml_reader_t* self)
|
||||
{
|
||||
DCHECK(self);
|
||||
if(!self)
|
||||
return 0;
|
||||
|
||||
return CefXmlReaderCppToC::Get(self)->HasAttributes();
|
||||
}
|
||||
|
||||
size_t CEF_CALLBACK xml_reader_get_attribute_count(
|
||||
struct _cef_xml_reader_t* self)
|
||||
{
|
||||
DCHECK(self);
|
||||
if(!self)
|
||||
return 0;
|
||||
|
||||
return CefXmlReaderCppToC::Get(self)->GetAttributeCount();
|
||||
}
|
||||
|
||||
cef_string_userfree_t CEF_CALLBACK xml_reader_get_attribute_byindex(
|
||||
struct _cef_xml_reader_t* self, int index)
|
||||
{
|
||||
DCHECK(self);
|
||||
if(!self)
|
||||
return NULL;
|
||||
|
||||
CefString retStr = CefXmlReaderCppToC::Get(self)->GetAttribute(index);
|
||||
return retStr.DetachToUserFree();
|
||||
}
|
||||
|
||||
cef_string_userfree_t CEF_CALLBACK xml_reader_get_attribute_byqname(
|
||||
struct _cef_xml_reader_t* self, const cef_string_t* qualifiedName)
|
||||
{
|
||||
DCHECK(self);
|
||||
DCHECK(qualifiedName);
|
||||
if(!self || !qualifiedName)
|
||||
return NULL;
|
||||
|
||||
CefString retStr = CefXmlReaderCppToC::Get(self)->GetAttribute(
|
||||
CefString(qualifiedName));
|
||||
return retStr.DetachToUserFree();
|
||||
}
|
||||
|
||||
cef_string_userfree_t CEF_CALLBACK xml_reader_get_attribute_bylname(
|
||||
struct _cef_xml_reader_t* self, const cef_string_t* localName,
|
||||
const cef_string_t* namespaceURI)
|
||||
{
|
||||
DCHECK(self);
|
||||
DCHECK(localName);
|
||||
DCHECK(namespaceURI);
|
||||
if(!self || !localName || !namespaceURI)
|
||||
return NULL;
|
||||
|
||||
CefString retStr = CefXmlReaderCppToC::Get(self)->GetAttribute(
|
||||
CefString(localName), CefString(namespaceURI));
|
||||
return retStr.DetachToUserFree();
|
||||
}
|
||||
|
||||
cef_string_userfree_t CEF_CALLBACK xml_reader_get_inner_xml(
|
||||
struct _cef_xml_reader_t* self)
|
||||
{
|
||||
DCHECK(self);
|
||||
if(!self)
|
||||
return NULL;
|
||||
|
||||
CefString retStr = CefXmlReaderCppToC::Get(self)->GetInnerXml();
|
||||
return retStr.DetachToUserFree();
|
||||
}
|
||||
|
||||
cef_string_userfree_t CEF_CALLBACK xml_reader_get_outer_xml(
|
||||
struct _cef_xml_reader_t* self)
|
||||
{
|
||||
DCHECK(self);
|
||||
if(!self)
|
||||
return NULL;
|
||||
|
||||
CefString retStr = CefXmlReaderCppToC::Get(self)->GetOuterXml();
|
||||
return retStr.DetachToUserFree();
|
||||
}
|
||||
|
||||
int CEF_CALLBACK xml_reader_get_line_number(struct _cef_xml_reader_t* self)
|
||||
{
|
||||
DCHECK(self);
|
||||
if(!self)
|
||||
return 0;
|
||||
|
||||
return CefXmlReaderCppToC::Get(self)->GetLineNumber();
|
||||
}
|
||||
|
||||
int CEF_CALLBACK xml_reader_move_to_attribute_byindex(
|
||||
struct _cef_xml_reader_t* self, int index)
|
||||
{
|
||||
DCHECK(self);
|
||||
if(!self)
|
||||
return 0;
|
||||
|
||||
return CefXmlReaderCppToC::Get(self)->MoveToAttribute(index);
|
||||
}
|
||||
|
||||
int CEF_CALLBACK xml_reader_move_to_attribute_byqname(
|
||||
struct _cef_xml_reader_t* self, const cef_string_t* qualifiedName)
|
||||
{
|
||||
DCHECK(self);
|
||||
DCHECK(qualifiedName);
|
||||
if(!self || !qualifiedName)
|
||||
return 0;
|
||||
|
||||
return CefXmlReaderCppToC::Get(self)->MoveToAttribute(
|
||||
CefString(qualifiedName));
|
||||
}
|
||||
|
||||
int CEF_CALLBACK xml_reader_move_to_attribute_bylname(
|
||||
struct _cef_xml_reader_t* self, const cef_string_t* localName,
|
||||
const cef_string_t* namespaceURI)
|
||||
{
|
||||
DCHECK(self);
|
||||
DCHECK(localName);
|
||||
DCHECK(namespaceURI);
|
||||
if(!self || !localName || !namespaceURI)
|
||||
return 0;
|
||||
|
||||
return CefXmlReaderCppToC::Get(self)->MoveToAttribute(CefString(localName),
|
||||
CefString(namespaceURI));
|
||||
}
|
||||
|
||||
int CEF_CALLBACK xml_reader_move_to_first_attribute(
|
||||
struct _cef_xml_reader_t* self)
|
||||
{
|
||||
DCHECK(self);
|
||||
if(!self)
|
||||
return 0;
|
||||
|
||||
return CefXmlReaderCppToC::Get(self)->MoveToFirstAttribute();
|
||||
}
|
||||
|
||||
int CEF_CALLBACK xml_reader_move_to_next_attribute(
|
||||
struct _cef_xml_reader_t* self)
|
||||
{
|
||||
DCHECK(self);
|
||||
if(!self)
|
||||
return 0;
|
||||
|
||||
return CefXmlReaderCppToC::Get(self)->MoveToNextAttribute();
|
||||
}
|
||||
|
||||
int CEF_CALLBACK xml_reader_move_to_carrying_element(
|
||||
struct _cef_xml_reader_t* self)
|
||||
{
|
||||
DCHECK(self);
|
||||
if(!self)
|
||||
return 0;
|
||||
|
||||
return CefXmlReaderCppToC::Get(self)->MoveToCarryingElement();
|
||||
}
|
||||
|
||||
|
||||
// CONSTRUCTOR - Do not edit by hand.
|
||||
|
||||
CefXmlReaderCppToC::CefXmlReaderCppToC(CefXmlReader* cls)
|
||||
: CefCppToC<CefXmlReaderCppToC, CefXmlReader, cef_xml_reader_t>(cls)
|
||||
{
|
||||
struct_.struct_.move_to_next_node = xml_reader_move_to_next_node;
|
||||
struct_.struct_.close = xml_reader_close;
|
||||
struct_.struct_.has_error = xml_reader_has_error;
|
||||
struct_.struct_.get_error = xml_reader_get_error;
|
||||
struct_.struct_.get_type = xml_reader_get_type;
|
||||
struct_.struct_.get_depth = xml_reader_get_depth;
|
||||
struct_.struct_.get_local_name = xml_reader_get_local_name;
|
||||
struct_.struct_.get_prefix = xml_reader_get_prefix;
|
||||
struct_.struct_.get_qualified_name = xml_reader_get_qualified_name;
|
||||
struct_.struct_.get_namespace_uri = xml_reader_get_namespace_uri;
|
||||
struct_.struct_.get_base_uri = xml_reader_get_base_uri;
|
||||
struct_.struct_.get_xml_lang = xml_reader_get_xml_lang;
|
||||
struct_.struct_.is_empty_element = xml_reader_is_empty_element;
|
||||
struct_.struct_.has_value = xml_reader_has_value;
|
||||
struct_.struct_.get_value = xml_reader_get_value;
|
||||
struct_.struct_.has_attributes = xml_reader_has_attributes;
|
||||
struct_.struct_.get_attribute_count = xml_reader_get_attribute_count;
|
||||
struct_.struct_.get_attribute_byindex = xml_reader_get_attribute_byindex;
|
||||
struct_.struct_.get_attribute_byqname = xml_reader_get_attribute_byqname;
|
||||
struct_.struct_.get_attribute_bylname = xml_reader_get_attribute_bylname;
|
||||
struct_.struct_.get_inner_xml = xml_reader_get_inner_xml;
|
||||
struct_.struct_.get_outer_xml = xml_reader_get_outer_xml;
|
||||
struct_.struct_.get_line_number = xml_reader_get_line_number;
|
||||
struct_.struct_.move_to_attribute_byindex =
|
||||
xml_reader_move_to_attribute_byindex;
|
||||
struct_.struct_.move_to_attribute_byqname =
|
||||
xml_reader_move_to_attribute_byqname;
|
||||
struct_.struct_.move_to_attribute_bylname =
|
||||
xml_reader_move_to_attribute_bylname;
|
||||
struct_.struct_.move_to_first_attribute = xml_reader_move_to_first_attribute;
|
||||
struct_.struct_.move_to_next_attribute = xml_reader_move_to_next_attribute;
|
||||
struct_.struct_.move_to_carrying_element =
|
||||
xml_reader_move_to_carrying_element;
|
||||
}
|
||||
|
||||
#ifdef _DEBUG
|
||||
long CefCppToC<CefXmlReaderCppToC, CefXmlReader, cef_xml_reader_t>::DebugObjCt =
|
||||
0;
|
||||
#endif
|
||||
|
||||
// Copyright (c) 2010 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.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// A portion of this file was generated by the CEF translator tool. When
|
||||
// making changes by hand only do so within the body of existing function
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
|
||||
#include "libcef_dll/cpptoc/stream_reader_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/xml_reader_cpptoc.h"
|
||||
|
||||
|
||||
// GLOBAL FUNCTIONS - Body may be edited by hand.
|
||||
|
||||
CEF_EXPORT cef_xml_reader_t* cef_xml_reader_create(cef_stream_reader_t* stream,
|
||||
enum cef_xml_encoding_type_t encodingType, const cef_string_t* URI)
|
||||
{
|
||||
CefRefPtr<CefXmlReader> impl = CefXmlReader::Create(
|
||||
CefStreamReaderCppToC::Unwrap(stream), encodingType, CefString(URI));
|
||||
if(impl.get())
|
||||
return CefXmlReaderCppToC::Wrap(impl);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
// MEMBER FUNCTIONS - Body may be edited by hand.
|
||||
|
||||
int CEF_CALLBACK xml_reader_move_to_next_node(struct _cef_xml_reader_t* self)
|
||||
{
|
||||
DCHECK(self);
|
||||
if(!self)
|
||||
return 0;
|
||||
|
||||
return CefXmlReaderCppToC::Get(self)->MoveToNextNode();
|
||||
}
|
||||
|
||||
int CEF_CALLBACK xml_reader_close(struct _cef_xml_reader_t* self)
|
||||
{
|
||||
DCHECK(self);
|
||||
if(!self)
|
||||
return 0;
|
||||
|
||||
return CefXmlReaderCppToC::Get(self)->Close();
|
||||
}
|
||||
|
||||
int CEF_CALLBACK xml_reader_has_error(struct _cef_xml_reader_t* self)
|
||||
{
|
||||
DCHECK(self);
|
||||
if(!self)
|
||||
return 0;
|
||||
|
||||
return CefXmlReaderCppToC::Get(self)->HasError();
|
||||
}
|
||||
|
||||
cef_string_userfree_t CEF_CALLBACK xml_reader_get_error(
|
||||
struct _cef_xml_reader_t* self)
|
||||
{
|
||||
DCHECK(self);
|
||||
if(!self)
|
||||
return NULL;
|
||||
|
||||
CefString retStr = CefXmlReaderCppToC::Get(self)->GetError();
|
||||
return retStr.DetachToUserFree();
|
||||
}
|
||||
|
||||
enum cef_xml_node_type_t CEF_CALLBACK xml_reader_get_type(
|
||||
struct _cef_xml_reader_t* self)
|
||||
{
|
||||
DCHECK(self);
|
||||
if(!self)
|
||||
return XML_NODE_UNSUPPORTED;
|
||||
|
||||
return CefXmlReaderCppToC::Get(self)->GetType();
|
||||
}
|
||||
|
||||
int CEF_CALLBACK xml_reader_get_depth(struct _cef_xml_reader_t* self)
|
||||
{
|
||||
DCHECK(self);
|
||||
if(!self)
|
||||
return -1;
|
||||
|
||||
return CefXmlReaderCppToC::Get(self)->GetDepth();
|
||||
}
|
||||
|
||||
cef_string_userfree_t CEF_CALLBACK xml_reader_get_local_name(
|
||||
struct _cef_xml_reader_t* self)
|
||||
{
|
||||
DCHECK(self);
|
||||
if(!self)
|
||||
return NULL;
|
||||
|
||||
CefString retStr = CefXmlReaderCppToC::Get(self)->GetLocalName();
|
||||
return retStr.DetachToUserFree();
|
||||
}
|
||||
|
||||
cef_string_userfree_t CEF_CALLBACK xml_reader_get_prefix(
|
||||
struct _cef_xml_reader_t* self)
|
||||
{
|
||||
DCHECK(self);
|
||||
if(!self)
|
||||
return NULL;
|
||||
|
||||
CefString retStr = CefXmlReaderCppToC::Get(self)->GetPrefix();
|
||||
return retStr.DetachToUserFree();
|
||||
}
|
||||
|
||||
cef_string_userfree_t CEF_CALLBACK xml_reader_get_qualified_name(
|
||||
struct _cef_xml_reader_t* self)
|
||||
{
|
||||
DCHECK(self);
|
||||
if(!self)
|
||||
return NULL;
|
||||
|
||||
CefString retStr = CefXmlReaderCppToC::Get(self)->GetQualifiedName();
|
||||
return retStr.DetachToUserFree();
|
||||
}
|
||||
|
||||
cef_string_userfree_t CEF_CALLBACK xml_reader_get_namespace_uri(
|
||||
struct _cef_xml_reader_t* self)
|
||||
{
|
||||
DCHECK(self);
|
||||
if(!self)
|
||||
return NULL;
|
||||
|
||||
CefString retStr = CefXmlReaderCppToC::Get(self)->GetNamespaceURI();
|
||||
return retStr.DetachToUserFree();
|
||||
}
|
||||
|
||||
cef_string_userfree_t CEF_CALLBACK xml_reader_get_base_uri(
|
||||
struct _cef_xml_reader_t* self)
|
||||
{
|
||||
DCHECK(self);
|
||||
if(!self)
|
||||
return NULL;
|
||||
|
||||
CefString retStr = CefXmlReaderCppToC::Get(self)->GetBaseURI();
|
||||
return retStr.DetachToUserFree();
|
||||
}
|
||||
|
||||
cef_string_userfree_t CEF_CALLBACK xml_reader_get_xml_lang(
|
||||
struct _cef_xml_reader_t* self)
|
||||
{
|
||||
DCHECK(self);
|
||||
if(!self)
|
||||
return NULL;
|
||||
|
||||
CefString retStr = CefXmlReaderCppToC::Get(self)->GetXmlLang();
|
||||
return retStr.DetachToUserFree();
|
||||
}
|
||||
|
||||
int CEF_CALLBACK xml_reader_is_empty_element(struct _cef_xml_reader_t* self)
|
||||
{
|
||||
DCHECK(self);
|
||||
if(!self)
|
||||
return 0;
|
||||
|
||||
return CefXmlReaderCppToC::Get(self)->IsEmptyElement();
|
||||
}
|
||||
|
||||
int CEF_CALLBACK xml_reader_has_value(struct _cef_xml_reader_t* self)
|
||||
{
|
||||
DCHECK(self);
|
||||
if(!self)
|
||||
return 0;
|
||||
|
||||
return CefXmlReaderCppToC::Get(self)->HasValue();
|
||||
}
|
||||
|
||||
cef_string_userfree_t CEF_CALLBACK xml_reader_get_value(
|
||||
struct _cef_xml_reader_t* self)
|
||||
{
|
||||
DCHECK(self);
|
||||
if(!self)
|
||||
return NULL;
|
||||
|
||||
CefString retStr = CefXmlReaderCppToC::Get(self)->GetValue();
|
||||
return retStr.DetachToUserFree();
|
||||
}
|
||||
|
||||
int CEF_CALLBACK xml_reader_has_attributes(struct _cef_xml_reader_t* self)
|
||||
{
|
||||
DCHECK(self);
|
||||
if(!self)
|
||||
return 0;
|
||||
|
||||
return CefXmlReaderCppToC::Get(self)->HasAttributes();
|
||||
}
|
||||
|
||||
size_t CEF_CALLBACK xml_reader_get_attribute_count(
|
||||
struct _cef_xml_reader_t* self)
|
||||
{
|
||||
DCHECK(self);
|
||||
if(!self)
|
||||
return 0;
|
||||
|
||||
return CefXmlReaderCppToC::Get(self)->GetAttributeCount();
|
||||
}
|
||||
|
||||
cef_string_userfree_t CEF_CALLBACK xml_reader_get_attribute_byindex(
|
||||
struct _cef_xml_reader_t* self, int index)
|
||||
{
|
||||
DCHECK(self);
|
||||
if(!self)
|
||||
return NULL;
|
||||
|
||||
CefString retStr = CefXmlReaderCppToC::Get(self)->GetAttribute(index);
|
||||
return retStr.DetachToUserFree();
|
||||
}
|
||||
|
||||
cef_string_userfree_t CEF_CALLBACK xml_reader_get_attribute_byqname(
|
||||
struct _cef_xml_reader_t* self, const cef_string_t* qualifiedName)
|
||||
{
|
||||
DCHECK(self);
|
||||
DCHECK(qualifiedName);
|
||||
if(!self || !qualifiedName)
|
||||
return NULL;
|
||||
|
||||
CefString retStr = CefXmlReaderCppToC::Get(self)->GetAttribute(
|
||||
CefString(qualifiedName));
|
||||
return retStr.DetachToUserFree();
|
||||
}
|
||||
|
||||
cef_string_userfree_t CEF_CALLBACK xml_reader_get_attribute_bylname(
|
||||
struct _cef_xml_reader_t* self, const cef_string_t* localName,
|
||||
const cef_string_t* namespaceURI)
|
||||
{
|
||||
DCHECK(self);
|
||||
DCHECK(localName);
|
||||
DCHECK(namespaceURI);
|
||||
if(!self || !localName || !namespaceURI)
|
||||
return NULL;
|
||||
|
||||
CefString retStr = CefXmlReaderCppToC::Get(self)->GetAttribute(
|
||||
CefString(localName), CefString(namespaceURI));
|
||||
return retStr.DetachToUserFree();
|
||||
}
|
||||
|
||||
cef_string_userfree_t CEF_CALLBACK xml_reader_get_inner_xml(
|
||||
struct _cef_xml_reader_t* self)
|
||||
{
|
||||
DCHECK(self);
|
||||
if(!self)
|
||||
return NULL;
|
||||
|
||||
CefString retStr = CefXmlReaderCppToC::Get(self)->GetInnerXml();
|
||||
return retStr.DetachToUserFree();
|
||||
}
|
||||
|
||||
cef_string_userfree_t CEF_CALLBACK xml_reader_get_outer_xml(
|
||||
struct _cef_xml_reader_t* self)
|
||||
{
|
||||
DCHECK(self);
|
||||
if(!self)
|
||||
return NULL;
|
||||
|
||||
CefString retStr = CefXmlReaderCppToC::Get(self)->GetOuterXml();
|
||||
return retStr.DetachToUserFree();
|
||||
}
|
||||
|
||||
int CEF_CALLBACK xml_reader_get_line_number(struct _cef_xml_reader_t* self)
|
||||
{
|
||||
DCHECK(self);
|
||||
if(!self)
|
||||
return 0;
|
||||
|
||||
return CefXmlReaderCppToC::Get(self)->GetLineNumber();
|
||||
}
|
||||
|
||||
int CEF_CALLBACK xml_reader_move_to_attribute_byindex(
|
||||
struct _cef_xml_reader_t* self, int index)
|
||||
{
|
||||
DCHECK(self);
|
||||
if(!self)
|
||||
return 0;
|
||||
|
||||
return CefXmlReaderCppToC::Get(self)->MoveToAttribute(index);
|
||||
}
|
||||
|
||||
int CEF_CALLBACK xml_reader_move_to_attribute_byqname(
|
||||
struct _cef_xml_reader_t* self, const cef_string_t* qualifiedName)
|
||||
{
|
||||
DCHECK(self);
|
||||
DCHECK(qualifiedName);
|
||||
if(!self || !qualifiedName)
|
||||
return 0;
|
||||
|
||||
return CefXmlReaderCppToC::Get(self)->MoveToAttribute(
|
||||
CefString(qualifiedName));
|
||||
}
|
||||
|
||||
int CEF_CALLBACK xml_reader_move_to_attribute_bylname(
|
||||
struct _cef_xml_reader_t* self, const cef_string_t* localName,
|
||||
const cef_string_t* namespaceURI)
|
||||
{
|
||||
DCHECK(self);
|
||||
DCHECK(localName);
|
||||
DCHECK(namespaceURI);
|
||||
if(!self || !localName || !namespaceURI)
|
||||
return 0;
|
||||
|
||||
return CefXmlReaderCppToC::Get(self)->MoveToAttribute(CefString(localName),
|
||||
CefString(namespaceURI));
|
||||
}
|
||||
|
||||
int CEF_CALLBACK xml_reader_move_to_first_attribute(
|
||||
struct _cef_xml_reader_t* self)
|
||||
{
|
||||
DCHECK(self);
|
||||
if(!self)
|
||||
return 0;
|
||||
|
||||
return CefXmlReaderCppToC::Get(self)->MoveToFirstAttribute();
|
||||
}
|
||||
|
||||
int CEF_CALLBACK xml_reader_move_to_next_attribute(
|
||||
struct _cef_xml_reader_t* self)
|
||||
{
|
||||
DCHECK(self);
|
||||
if(!self)
|
||||
return 0;
|
||||
|
||||
return CefXmlReaderCppToC::Get(self)->MoveToNextAttribute();
|
||||
}
|
||||
|
||||
int CEF_CALLBACK xml_reader_move_to_carrying_element(
|
||||
struct _cef_xml_reader_t* self)
|
||||
{
|
||||
DCHECK(self);
|
||||
if(!self)
|
||||
return 0;
|
||||
|
||||
return CefXmlReaderCppToC::Get(self)->MoveToCarryingElement();
|
||||
}
|
||||
|
||||
|
||||
// CONSTRUCTOR - Do not edit by hand.
|
||||
|
||||
CefXmlReaderCppToC::CefXmlReaderCppToC(CefXmlReader* cls)
|
||||
: CefCppToC<CefXmlReaderCppToC, CefXmlReader, cef_xml_reader_t>(cls)
|
||||
{
|
||||
struct_.struct_.move_to_next_node = xml_reader_move_to_next_node;
|
||||
struct_.struct_.close = xml_reader_close;
|
||||
struct_.struct_.has_error = xml_reader_has_error;
|
||||
struct_.struct_.get_error = xml_reader_get_error;
|
||||
struct_.struct_.get_type = xml_reader_get_type;
|
||||
struct_.struct_.get_depth = xml_reader_get_depth;
|
||||
struct_.struct_.get_local_name = xml_reader_get_local_name;
|
||||
struct_.struct_.get_prefix = xml_reader_get_prefix;
|
||||
struct_.struct_.get_qualified_name = xml_reader_get_qualified_name;
|
||||
struct_.struct_.get_namespace_uri = xml_reader_get_namespace_uri;
|
||||
struct_.struct_.get_base_uri = xml_reader_get_base_uri;
|
||||
struct_.struct_.get_xml_lang = xml_reader_get_xml_lang;
|
||||
struct_.struct_.is_empty_element = xml_reader_is_empty_element;
|
||||
struct_.struct_.has_value = xml_reader_has_value;
|
||||
struct_.struct_.get_value = xml_reader_get_value;
|
||||
struct_.struct_.has_attributes = xml_reader_has_attributes;
|
||||
struct_.struct_.get_attribute_count = xml_reader_get_attribute_count;
|
||||
struct_.struct_.get_attribute_byindex = xml_reader_get_attribute_byindex;
|
||||
struct_.struct_.get_attribute_byqname = xml_reader_get_attribute_byqname;
|
||||
struct_.struct_.get_attribute_bylname = xml_reader_get_attribute_bylname;
|
||||
struct_.struct_.get_inner_xml = xml_reader_get_inner_xml;
|
||||
struct_.struct_.get_outer_xml = xml_reader_get_outer_xml;
|
||||
struct_.struct_.get_line_number = xml_reader_get_line_number;
|
||||
struct_.struct_.move_to_attribute_byindex =
|
||||
xml_reader_move_to_attribute_byindex;
|
||||
struct_.struct_.move_to_attribute_byqname =
|
||||
xml_reader_move_to_attribute_byqname;
|
||||
struct_.struct_.move_to_attribute_bylname =
|
||||
xml_reader_move_to_attribute_bylname;
|
||||
struct_.struct_.move_to_first_attribute = xml_reader_move_to_first_attribute;
|
||||
struct_.struct_.move_to_next_attribute = xml_reader_move_to_next_attribute;
|
||||
struct_.struct_.move_to_carrying_element =
|
||||
xml_reader_move_to_carrying_element;
|
||||
}
|
||||
|
||||
#ifdef _DEBUG
|
||||
long CefCppToC<CefXmlReaderCppToC, CefXmlReader, cef_xml_reader_t>::DebugObjCt =
|
||||
0;
|
||||
#endif
|
||||
|
||||
|
@ -1,34 +1,34 @@
|
||||
// Copyright (c) 2010 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.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// This file was generated by the CEF translator tool and should not edited
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
#ifndef _XMLREADER_CPPTOC_H
|
||||
#define _XMLREADER_CPPTOC_H
|
||||
|
||||
#ifndef BUILDING_CEF_SHARED
|
||||
#pragma message("Warning: "__FILE__" may be accessed DLL-side only")
|
||||
#else // BUILDING_CEF_SHARED
|
||||
|
||||
#include "include/cef.h"
|
||||
#include "include/cef_capi.h"
|
||||
#include "libcef_dll/cpptoc/cpptoc.h"
|
||||
|
||||
// Wrap a C++ class with a C structure.
|
||||
// This class may be instantiated and accessed DLL-side only.
|
||||
class CefXmlReaderCppToC
|
||||
: public CefCppToC<CefXmlReaderCppToC, CefXmlReader, cef_xml_reader_t>
|
||||
{
|
||||
public:
|
||||
CefXmlReaderCppToC(CefXmlReader* cls);
|
||||
virtual ~CefXmlReaderCppToC() {}
|
||||
};
|
||||
|
||||
#endif // BUILDING_CEF_SHARED
|
||||
#endif // _XMLREADER_CPPTOC_H
|
||||
|
||||
// Copyright (c) 2010 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.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// This file was generated by the CEF translator tool and should not edited
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
#ifndef _XMLREADER_CPPTOC_H
|
||||
#define _XMLREADER_CPPTOC_H
|
||||
|
||||
#ifndef BUILDING_CEF_SHARED
|
||||
#pragma message("Warning: "__FILE__" may be accessed DLL-side only")
|
||||
#else // BUILDING_CEF_SHARED
|
||||
|
||||
#include "include/cef.h"
|
||||
#include "include/cef_capi.h"
|
||||
#include "libcef_dll/cpptoc/cpptoc.h"
|
||||
|
||||
// Wrap a C++ class with a C structure.
|
||||
// This class may be instantiated and accessed DLL-side only.
|
||||
class CefXmlReaderCppToC
|
||||
: public CefCppToC<CefXmlReaderCppToC, CefXmlReader, cef_xml_reader_t>
|
||||
{
|
||||
public:
|
||||
CefXmlReaderCppToC(CefXmlReader* cls);
|
||||
virtual ~CefXmlReaderCppToC() {}
|
||||
};
|
||||
|
||||
#endif // BUILDING_CEF_SHARED
|
||||
#endif // _XMLREADER_CPPTOC_H
|
||||
|
||||
|
@ -1,314 +1,314 @@
|
||||
// Copyright (c) 2010 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.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// A portion of this file was generated by the CEF translator tool. When
|
||||
// making changes by hand only do so within the body of existing static and
|
||||
// virtual method implementations. See the translator.README.txt file in the
|
||||
// tools directory for more information.
|
||||
//
|
||||
|
||||
#include "libcef_dll/ctocpp/stream_reader_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/xml_reader_ctocpp.h"
|
||||
|
||||
|
||||
// STATIC METHODS - Body may be edited by hand.
|
||||
|
||||
CefRefPtr<CefXmlReader> CefXmlReader::Create(CefRefPtr<CefStreamReader> stream,
|
||||
EncodingType encodingType, const CefString& URI)
|
||||
{
|
||||
cef_xml_reader_t* impl = cef_xml_reader_create(
|
||||
CefStreamReaderCToCpp::Unwrap(stream), encodingType, URI.GetStruct());
|
||||
if(impl)
|
||||
return CefXmlReaderCToCpp::Wrap(impl);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
// VIRTUAL METHODS - Body may be edited by hand.
|
||||
|
||||
bool CefXmlReaderCToCpp::MoveToNextNode()
|
||||
{
|
||||
if(CEF_MEMBER_MISSING(struct_, move_to_next_node))
|
||||
return false;
|
||||
|
||||
return struct_->move_to_next_node(struct_) ? true : false;
|
||||
}
|
||||
|
||||
bool CefXmlReaderCToCpp::Close()
|
||||
{
|
||||
if(CEF_MEMBER_MISSING(struct_, close))
|
||||
return false;
|
||||
|
||||
return struct_->close(struct_) ? true : false;
|
||||
}
|
||||
|
||||
bool CefXmlReaderCToCpp::HasError()
|
||||
{
|
||||
if(CEF_MEMBER_MISSING(struct_, has_error))
|
||||
return false;
|
||||
|
||||
return struct_->has_error(struct_) ? true : false;
|
||||
}
|
||||
|
||||
CefString CefXmlReaderCToCpp::GetError()
|
||||
{
|
||||
CefString str;
|
||||
if(CEF_MEMBER_MISSING(struct_, get_error))
|
||||
return str;
|
||||
|
||||
cef_string_userfree_t strPtr = struct_->get_error(struct_);
|
||||
str.AttachToUserFree(strPtr);
|
||||
return str;
|
||||
}
|
||||
|
||||
CefXmlReader::NodeType CefXmlReaderCToCpp::GetType()
|
||||
{
|
||||
if(CEF_MEMBER_MISSING(struct_, get_type))
|
||||
return XML_NODE_UNSUPPORTED;
|
||||
|
||||
return struct_->get_type(struct_);
|
||||
}
|
||||
|
||||
int CefXmlReaderCToCpp::GetDepth()
|
||||
{
|
||||
if(CEF_MEMBER_MISSING(struct_, get_depth))
|
||||
return -1;
|
||||
|
||||
return struct_->get_depth(struct_);
|
||||
}
|
||||
|
||||
CefString CefXmlReaderCToCpp::GetLocalName()
|
||||
{
|
||||
CefString str;
|
||||
if(CEF_MEMBER_MISSING(struct_, get_local_name))
|
||||
return str;
|
||||
|
||||
cef_string_userfree_t strPtr = struct_->get_local_name(struct_);
|
||||
str.AttachToUserFree(strPtr);
|
||||
return str;
|
||||
}
|
||||
|
||||
CefString CefXmlReaderCToCpp::GetPrefix()
|
||||
{
|
||||
CefString str;
|
||||
if(CEF_MEMBER_MISSING(struct_, get_prefix))
|
||||
return str;
|
||||
|
||||
cef_string_userfree_t strPtr = struct_->get_prefix(struct_);
|
||||
str.AttachToUserFree(strPtr);
|
||||
return str;
|
||||
}
|
||||
|
||||
CefString CefXmlReaderCToCpp::GetQualifiedName()
|
||||
{
|
||||
CefString str;
|
||||
if(CEF_MEMBER_MISSING(struct_, get_qualified_name))
|
||||
return str;
|
||||
|
||||
cef_string_userfree_t strPtr = struct_->get_qualified_name(struct_);
|
||||
str.AttachToUserFree(strPtr);
|
||||
return str;
|
||||
}
|
||||
|
||||
CefString CefXmlReaderCToCpp::GetNamespaceURI()
|
||||
{
|
||||
CefString str;
|
||||
if(CEF_MEMBER_MISSING(struct_, get_namespace_uri))
|
||||
return str;
|
||||
|
||||
cef_string_userfree_t strPtr = struct_->get_namespace_uri(struct_);
|
||||
str.AttachToUserFree(strPtr);
|
||||
return str;
|
||||
}
|
||||
|
||||
CefString CefXmlReaderCToCpp::GetBaseURI()
|
||||
{
|
||||
CefString str;
|
||||
if(CEF_MEMBER_MISSING(struct_, get_base_uri))
|
||||
return str;
|
||||
|
||||
cef_string_userfree_t strPtr = struct_->get_base_uri(struct_);
|
||||
str.AttachToUserFree(strPtr);
|
||||
return str;
|
||||
}
|
||||
|
||||
CefString CefXmlReaderCToCpp::GetXmlLang()
|
||||
{
|
||||
CefString str;
|
||||
if(CEF_MEMBER_MISSING(struct_, get_xml_lang))
|
||||
return str;
|
||||
|
||||
cef_string_userfree_t strPtr = struct_->get_xml_lang(struct_);
|
||||
str.AttachToUserFree(strPtr);
|
||||
return str;
|
||||
}
|
||||
|
||||
bool CefXmlReaderCToCpp::IsEmptyElement()
|
||||
{
|
||||
if(CEF_MEMBER_MISSING(struct_, is_empty_element))
|
||||
return false;
|
||||
|
||||
return struct_->is_empty_element(struct_) ? true : false;
|
||||
}
|
||||
|
||||
bool CefXmlReaderCToCpp::HasValue()
|
||||
{
|
||||
if(CEF_MEMBER_MISSING(struct_, has_value))
|
||||
return false;
|
||||
|
||||
return struct_->has_value(struct_) ? true : false;
|
||||
}
|
||||
|
||||
CefString CefXmlReaderCToCpp::GetValue()
|
||||
{
|
||||
CefString str;
|
||||
if(CEF_MEMBER_MISSING(struct_, get_value))
|
||||
return str;
|
||||
|
||||
cef_string_userfree_t strPtr = struct_->get_value(struct_);
|
||||
str.AttachToUserFree(strPtr);
|
||||
return str;
|
||||
}
|
||||
|
||||
bool CefXmlReaderCToCpp::HasAttributes()
|
||||
{
|
||||
if(CEF_MEMBER_MISSING(struct_, has_attributes))
|
||||
return false;
|
||||
|
||||
return struct_->has_attributes(struct_) ? true : false;
|
||||
}
|
||||
|
||||
size_t CefXmlReaderCToCpp::GetAttributeCount()
|
||||
{
|
||||
if(CEF_MEMBER_MISSING(struct_, get_attribute_count))
|
||||
return 0;
|
||||
|
||||
return struct_->get_attribute_count(struct_);
|
||||
}
|
||||
|
||||
CefString CefXmlReaderCToCpp::GetAttribute(int index)
|
||||
{
|
||||
CefString str;
|
||||
if(CEF_MEMBER_MISSING(struct_, get_attribute_byindex))
|
||||
return str;
|
||||
|
||||
cef_string_userfree_t strPtr = struct_->get_attribute_byindex(struct_, index);
|
||||
str.AttachToUserFree(strPtr);
|
||||
return str;
|
||||
}
|
||||
|
||||
CefString CefXmlReaderCToCpp::GetAttribute(const CefString& qualifiedName)
|
||||
{
|
||||
CefString str;
|
||||
if(CEF_MEMBER_MISSING(struct_, get_attribute_byqname))
|
||||
return str;
|
||||
|
||||
cef_string_userfree_t strPtr = struct_->get_attribute_byqname(struct_,
|
||||
qualifiedName.GetStruct());
|
||||
str.AttachToUserFree(strPtr);
|
||||
return str;
|
||||
}
|
||||
|
||||
CefString CefXmlReaderCToCpp::GetAttribute(const CefString& localName,
|
||||
const CefString& namespaceURI)
|
||||
{
|
||||
CefString str;
|
||||
if(CEF_MEMBER_MISSING(struct_, get_attribute_bylname))
|
||||
return str;
|
||||
|
||||
cef_string_userfree_t strPtr = struct_->get_attribute_bylname(struct_,
|
||||
localName.GetStruct(), namespaceURI.GetStruct());
|
||||
str.AttachToUserFree(strPtr);
|
||||
return str;
|
||||
}
|
||||
|
||||
CefString CefXmlReaderCToCpp::GetInnerXml()
|
||||
{
|
||||
CefString str;
|
||||
if(CEF_MEMBER_MISSING(struct_, get_inner_xml))
|
||||
return str;
|
||||
|
||||
cef_string_userfree_t strPtr = struct_->get_inner_xml(struct_);
|
||||
str.AttachToUserFree(strPtr);
|
||||
return str;
|
||||
}
|
||||
|
||||
CefString CefXmlReaderCToCpp::GetOuterXml()
|
||||
{
|
||||
CefString str;
|
||||
if(CEF_MEMBER_MISSING(struct_, get_outer_xml))
|
||||
return str;
|
||||
|
||||
cef_string_userfree_t strPtr = struct_->get_outer_xml(struct_);
|
||||
str.AttachToUserFree(strPtr);
|
||||
return str;
|
||||
}
|
||||
|
||||
int CefXmlReaderCToCpp::GetLineNumber()
|
||||
{
|
||||
if(CEF_MEMBER_MISSING(struct_, get_line_number))
|
||||
return false;
|
||||
|
||||
return struct_->get_line_number(struct_);
|
||||
}
|
||||
|
||||
bool CefXmlReaderCToCpp::MoveToAttribute(int index)
|
||||
{
|
||||
if(CEF_MEMBER_MISSING(struct_, move_to_attribute_byindex))
|
||||
return false;
|
||||
|
||||
return struct_->move_to_attribute_byindex(struct_, index) ? true : false;
|
||||
}
|
||||
|
||||
bool CefXmlReaderCToCpp::MoveToAttribute(const CefString& qualifiedName)
|
||||
{
|
||||
if(CEF_MEMBER_MISSING(struct_, move_to_attribute_byqname))
|
||||
return false;
|
||||
|
||||
return struct_->move_to_attribute_byqname(struct_, qualifiedName.GetStruct())?
|
||||
true : false;
|
||||
}
|
||||
|
||||
bool CefXmlReaderCToCpp::MoveToAttribute(const CefString& localName,
|
||||
const CefString& namespaceURI)
|
||||
{
|
||||
if(CEF_MEMBER_MISSING(struct_, move_to_attribute_bylname))
|
||||
return false;
|
||||
|
||||
return struct_->move_to_attribute_bylname(struct_, localName.GetStruct(),
|
||||
namespaceURI.GetStruct()) ? true : false;
|
||||
}
|
||||
|
||||
bool CefXmlReaderCToCpp::MoveToFirstAttribute()
|
||||
{
|
||||
if(CEF_MEMBER_MISSING(struct_, move_to_first_attribute))
|
||||
return false;
|
||||
|
||||
return struct_->move_to_first_attribute(struct_) ? true : false;
|
||||
}
|
||||
|
||||
bool CefXmlReaderCToCpp::MoveToNextAttribute()
|
||||
{
|
||||
if(CEF_MEMBER_MISSING(struct_, move_to_next_attribute))
|
||||
return false;
|
||||
|
||||
return struct_->move_to_next_attribute(struct_) ? true : false;
|
||||
}
|
||||
|
||||
bool CefXmlReaderCToCpp::MoveToCarryingElement()
|
||||
{
|
||||
if(CEF_MEMBER_MISSING(struct_, move_to_carrying_element))
|
||||
return false;
|
||||
|
||||
return struct_->move_to_carrying_element(struct_) ? true : false;
|
||||
}
|
||||
|
||||
|
||||
#ifdef _DEBUG
|
||||
long CefCToCpp<CefXmlReaderCToCpp, CefXmlReader, cef_xml_reader_t>::DebugObjCt =
|
||||
0;
|
||||
#endif
|
||||
|
||||
// Copyright (c) 2010 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.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// A portion of this file was generated by the CEF translator tool. When
|
||||
// making changes by hand only do so within the body of existing static and
|
||||
// virtual method implementations. See the translator.README.txt file in the
|
||||
// tools directory for more information.
|
||||
//
|
||||
|
||||
#include "libcef_dll/ctocpp/stream_reader_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/xml_reader_ctocpp.h"
|
||||
|
||||
|
||||
// STATIC METHODS - Body may be edited by hand.
|
||||
|
||||
CefRefPtr<CefXmlReader> CefXmlReader::Create(CefRefPtr<CefStreamReader> stream,
|
||||
EncodingType encodingType, const CefString& URI)
|
||||
{
|
||||
cef_xml_reader_t* impl = cef_xml_reader_create(
|
||||
CefStreamReaderCToCpp::Unwrap(stream), encodingType, URI.GetStruct());
|
||||
if(impl)
|
||||
return CefXmlReaderCToCpp::Wrap(impl);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
// VIRTUAL METHODS - Body may be edited by hand.
|
||||
|
||||
bool CefXmlReaderCToCpp::MoveToNextNode()
|
||||
{
|
||||
if(CEF_MEMBER_MISSING(struct_, move_to_next_node))
|
||||
return false;
|
||||
|
||||
return struct_->move_to_next_node(struct_) ? true : false;
|
||||
}
|
||||
|
||||
bool CefXmlReaderCToCpp::Close()
|
||||
{
|
||||
if(CEF_MEMBER_MISSING(struct_, close))
|
||||
return false;
|
||||
|
||||
return struct_->close(struct_) ? true : false;
|
||||
}
|
||||
|
||||
bool CefXmlReaderCToCpp::HasError()
|
||||
{
|
||||
if(CEF_MEMBER_MISSING(struct_, has_error))
|
||||
return false;
|
||||
|
||||
return struct_->has_error(struct_) ? true : false;
|
||||
}
|
||||
|
||||
CefString CefXmlReaderCToCpp::GetError()
|
||||
{
|
||||
CefString str;
|
||||
if(CEF_MEMBER_MISSING(struct_, get_error))
|
||||
return str;
|
||||
|
||||
cef_string_userfree_t strPtr = struct_->get_error(struct_);
|
||||
str.AttachToUserFree(strPtr);
|
||||
return str;
|
||||
}
|
||||
|
||||
CefXmlReader::NodeType CefXmlReaderCToCpp::GetType()
|
||||
{
|
||||
if(CEF_MEMBER_MISSING(struct_, get_type))
|
||||
return XML_NODE_UNSUPPORTED;
|
||||
|
||||
return struct_->get_type(struct_);
|
||||
}
|
||||
|
||||
int CefXmlReaderCToCpp::GetDepth()
|
||||
{
|
||||
if(CEF_MEMBER_MISSING(struct_, get_depth))
|
||||
return -1;
|
||||
|
||||
return struct_->get_depth(struct_);
|
||||
}
|
||||
|
||||
CefString CefXmlReaderCToCpp::GetLocalName()
|
||||
{
|
||||
CefString str;
|
||||
if(CEF_MEMBER_MISSING(struct_, get_local_name))
|
||||
return str;
|
||||
|
||||
cef_string_userfree_t strPtr = struct_->get_local_name(struct_);
|
||||
str.AttachToUserFree(strPtr);
|
||||
return str;
|
||||
}
|
||||
|
||||
CefString CefXmlReaderCToCpp::GetPrefix()
|
||||
{
|
||||
CefString str;
|
||||
if(CEF_MEMBER_MISSING(struct_, get_prefix))
|
||||
return str;
|
||||
|
||||
cef_string_userfree_t strPtr = struct_->get_prefix(struct_);
|
||||
str.AttachToUserFree(strPtr);
|
||||
return str;
|
||||
}
|
||||
|
||||
CefString CefXmlReaderCToCpp::GetQualifiedName()
|
||||
{
|
||||
CefString str;
|
||||
if(CEF_MEMBER_MISSING(struct_, get_qualified_name))
|
||||
return str;
|
||||
|
||||
cef_string_userfree_t strPtr = struct_->get_qualified_name(struct_);
|
||||
str.AttachToUserFree(strPtr);
|
||||
return str;
|
||||
}
|
||||
|
||||
CefString CefXmlReaderCToCpp::GetNamespaceURI()
|
||||
{
|
||||
CefString str;
|
||||
if(CEF_MEMBER_MISSING(struct_, get_namespace_uri))
|
||||
return str;
|
||||
|
||||
cef_string_userfree_t strPtr = struct_->get_namespace_uri(struct_);
|
||||
str.AttachToUserFree(strPtr);
|
||||
return str;
|
||||
}
|
||||
|
||||
CefString CefXmlReaderCToCpp::GetBaseURI()
|
||||
{
|
||||
CefString str;
|
||||
if(CEF_MEMBER_MISSING(struct_, get_base_uri))
|
||||
return str;
|
||||
|
||||
cef_string_userfree_t strPtr = struct_->get_base_uri(struct_);
|
||||
str.AttachToUserFree(strPtr);
|
||||
return str;
|
||||
}
|
||||
|
||||
CefString CefXmlReaderCToCpp::GetXmlLang()
|
||||
{
|
||||
CefString str;
|
||||
if(CEF_MEMBER_MISSING(struct_, get_xml_lang))
|
||||
return str;
|
||||
|
||||
cef_string_userfree_t strPtr = struct_->get_xml_lang(struct_);
|
||||
str.AttachToUserFree(strPtr);
|
||||
return str;
|
||||
}
|
||||
|
||||
bool CefXmlReaderCToCpp::IsEmptyElement()
|
||||
{
|
||||
if(CEF_MEMBER_MISSING(struct_, is_empty_element))
|
||||
return false;
|
||||
|
||||
return struct_->is_empty_element(struct_) ? true : false;
|
||||
}
|
||||
|
||||
bool CefXmlReaderCToCpp::HasValue()
|
||||
{
|
||||
if(CEF_MEMBER_MISSING(struct_, has_value))
|
||||
return false;
|
||||
|
||||
return struct_->has_value(struct_) ? true : false;
|
||||
}
|
||||
|
||||
CefString CefXmlReaderCToCpp::GetValue()
|
||||
{
|
||||
CefString str;
|
||||
if(CEF_MEMBER_MISSING(struct_, get_value))
|
||||
return str;
|
||||
|
||||
cef_string_userfree_t strPtr = struct_->get_value(struct_);
|
||||
str.AttachToUserFree(strPtr);
|
||||
return str;
|
||||
}
|
||||
|
||||
bool CefXmlReaderCToCpp::HasAttributes()
|
||||
{
|
||||
if(CEF_MEMBER_MISSING(struct_, has_attributes))
|
||||
return false;
|
||||
|
||||
return struct_->has_attributes(struct_) ? true : false;
|
||||
}
|
||||
|
||||
size_t CefXmlReaderCToCpp::GetAttributeCount()
|
||||
{
|
||||
if(CEF_MEMBER_MISSING(struct_, get_attribute_count))
|
||||
return 0;
|
||||
|
||||
return struct_->get_attribute_count(struct_);
|
||||
}
|
||||
|
||||
CefString CefXmlReaderCToCpp::GetAttribute(int index)
|
||||
{
|
||||
CefString str;
|
||||
if(CEF_MEMBER_MISSING(struct_, get_attribute_byindex))
|
||||
return str;
|
||||
|
||||
cef_string_userfree_t strPtr = struct_->get_attribute_byindex(struct_, index);
|
||||
str.AttachToUserFree(strPtr);
|
||||
return str;
|
||||
}
|
||||
|
||||
CefString CefXmlReaderCToCpp::GetAttribute(const CefString& qualifiedName)
|
||||
{
|
||||
CefString str;
|
||||
if(CEF_MEMBER_MISSING(struct_, get_attribute_byqname))
|
||||
return str;
|
||||
|
||||
cef_string_userfree_t strPtr = struct_->get_attribute_byqname(struct_,
|
||||
qualifiedName.GetStruct());
|
||||
str.AttachToUserFree(strPtr);
|
||||
return str;
|
||||
}
|
||||
|
||||
CefString CefXmlReaderCToCpp::GetAttribute(const CefString& localName,
|
||||
const CefString& namespaceURI)
|
||||
{
|
||||
CefString str;
|
||||
if(CEF_MEMBER_MISSING(struct_, get_attribute_bylname))
|
||||
return str;
|
||||
|
||||
cef_string_userfree_t strPtr = struct_->get_attribute_bylname(struct_,
|
||||
localName.GetStruct(), namespaceURI.GetStruct());
|
||||
str.AttachToUserFree(strPtr);
|
||||
return str;
|
||||
}
|
||||
|
||||
CefString CefXmlReaderCToCpp::GetInnerXml()
|
||||
{
|
||||
CefString str;
|
||||
if(CEF_MEMBER_MISSING(struct_, get_inner_xml))
|
||||
return str;
|
||||
|
||||
cef_string_userfree_t strPtr = struct_->get_inner_xml(struct_);
|
||||
str.AttachToUserFree(strPtr);
|
||||
return str;
|
||||
}
|
||||
|
||||
CefString CefXmlReaderCToCpp::GetOuterXml()
|
||||
{
|
||||
CefString str;
|
||||
if(CEF_MEMBER_MISSING(struct_, get_outer_xml))
|
||||
return str;
|
||||
|
||||
cef_string_userfree_t strPtr = struct_->get_outer_xml(struct_);
|
||||
str.AttachToUserFree(strPtr);
|
||||
return str;
|
||||
}
|
||||
|
||||
int CefXmlReaderCToCpp::GetLineNumber()
|
||||
{
|
||||
if(CEF_MEMBER_MISSING(struct_, get_line_number))
|
||||
return false;
|
||||
|
||||
return struct_->get_line_number(struct_);
|
||||
}
|
||||
|
||||
bool CefXmlReaderCToCpp::MoveToAttribute(int index)
|
||||
{
|
||||
if(CEF_MEMBER_MISSING(struct_, move_to_attribute_byindex))
|
||||
return false;
|
||||
|
||||
return struct_->move_to_attribute_byindex(struct_, index) ? true : false;
|
||||
}
|
||||
|
||||
bool CefXmlReaderCToCpp::MoveToAttribute(const CefString& qualifiedName)
|
||||
{
|
||||
if(CEF_MEMBER_MISSING(struct_, move_to_attribute_byqname))
|
||||
return false;
|
||||
|
||||
return struct_->move_to_attribute_byqname(struct_, qualifiedName.GetStruct())?
|
||||
true : false;
|
||||
}
|
||||
|
||||
bool CefXmlReaderCToCpp::MoveToAttribute(const CefString& localName,
|
||||
const CefString& namespaceURI)
|
||||
{
|
||||
if(CEF_MEMBER_MISSING(struct_, move_to_attribute_bylname))
|
||||
return false;
|
||||
|
||||
return struct_->move_to_attribute_bylname(struct_, localName.GetStruct(),
|
||||
namespaceURI.GetStruct()) ? true : false;
|
||||
}
|
||||
|
||||
bool CefXmlReaderCToCpp::MoveToFirstAttribute()
|
||||
{
|
||||
if(CEF_MEMBER_MISSING(struct_, move_to_first_attribute))
|
||||
return false;
|
||||
|
||||
return struct_->move_to_first_attribute(struct_) ? true : false;
|
||||
}
|
||||
|
||||
bool CefXmlReaderCToCpp::MoveToNextAttribute()
|
||||
{
|
||||
if(CEF_MEMBER_MISSING(struct_, move_to_next_attribute))
|
||||
return false;
|
||||
|
||||
return struct_->move_to_next_attribute(struct_) ? true : false;
|
||||
}
|
||||
|
||||
bool CefXmlReaderCToCpp::MoveToCarryingElement()
|
||||
{
|
||||
if(CEF_MEMBER_MISSING(struct_, move_to_carrying_element))
|
||||
return false;
|
||||
|
||||
return struct_->move_to_carrying_element(struct_) ? true : false;
|
||||
}
|
||||
|
||||
|
||||
#ifdef _DEBUG
|
||||
long CefCToCpp<CefXmlReaderCToCpp, CefXmlReader, cef_xml_reader_t>::DebugObjCt =
|
||||
0;
|
||||
#endif
|
||||
|
||||
|
@ -1,69 +1,69 @@
|
||||
// Copyright (c) 2010 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.
|
||||
//
|
||||
// -------------------------------------------------------------------------
|
||||
//
|
||||
// This file was generated by the CEF translator tool and should not edited
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
|
||||
#ifndef _XMLREADER_CTOCPP_H
|
||||
#define _XMLREADER_CTOCPP_H
|
||||
|
||||
#ifndef USING_CEF_SHARED
|
||||
#pragma message("Warning: "__FILE__" may be accessed wrapper-side only")
|
||||
#else // USING_CEF_SHARED
|
||||
|
||||
#include "include/cef.h"
|
||||
#include "include/cef_capi.h"
|
||||
#include "libcef_dll/ctocpp/ctocpp.h"
|
||||
|
||||
// Wrap a C structure with a C++ class.
|
||||
// This class may be instantiated and accessed wrapper-side only.
|
||||
class CefXmlReaderCToCpp
|
||||
: public CefCToCpp<CefXmlReaderCToCpp, CefXmlReader, cef_xml_reader_t>
|
||||
{
|
||||
public:
|
||||
CefXmlReaderCToCpp(cef_xml_reader_t* str)
|
||||
: CefCToCpp<CefXmlReaderCToCpp, CefXmlReader, cef_xml_reader_t>(str) {}
|
||||
virtual ~CefXmlReaderCToCpp() {}
|
||||
|
||||
// CefXmlReader methods
|
||||
virtual bool MoveToNextNode();
|
||||
virtual bool Close();
|
||||
virtual bool HasError();
|
||||
virtual CefString GetError();
|
||||
virtual NodeType GetType();
|
||||
virtual int GetDepth();
|
||||
virtual CefString GetLocalName();
|
||||
virtual CefString GetPrefix();
|
||||
virtual CefString GetQualifiedName();
|
||||
virtual CefString GetNamespaceURI();
|
||||
virtual CefString GetBaseURI();
|
||||
virtual CefString GetXmlLang();
|
||||
virtual bool IsEmptyElement();
|
||||
virtual bool HasValue();
|
||||
virtual CefString GetValue();
|
||||
virtual bool HasAttributes();
|
||||
virtual size_t GetAttributeCount();
|
||||
virtual CefString GetAttribute(int index);
|
||||
virtual CefString GetAttribute(const CefString& qualifiedName);
|
||||
virtual CefString GetAttribute(const CefString& localName,
|
||||
const CefString& namespaceURI);
|
||||
virtual CefString GetInnerXml();
|
||||
virtual CefString GetOuterXml();
|
||||
virtual int GetLineNumber();
|
||||
virtual bool MoveToAttribute(int index);
|
||||
virtual bool MoveToAttribute(const CefString& qualifiedName);
|
||||
virtual bool MoveToAttribute(const CefString& localName,
|
||||
const CefString& namespaceURI);
|
||||
virtual bool MoveToFirstAttribute();
|
||||
virtual bool MoveToNextAttribute();
|
||||
virtual bool MoveToCarryingElement();
|
||||
};
|
||||
|
||||
#endif // USING_CEF_SHARED
|
||||
#endif // _XMLREADER_CTOCPP_H
|
||||
|
||||
// Copyright (c) 2010 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.
|
||||
//
|
||||
// -------------------------------------------------------------------------
|
||||
//
|
||||
// This file was generated by the CEF translator tool and should not edited
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
|
||||
#ifndef _XMLREADER_CTOCPP_H
|
||||
#define _XMLREADER_CTOCPP_H
|
||||
|
||||
#ifndef USING_CEF_SHARED
|
||||
#pragma message("Warning: "__FILE__" may be accessed wrapper-side only")
|
||||
#else // USING_CEF_SHARED
|
||||
|
||||
#include "include/cef.h"
|
||||
#include "include/cef_capi.h"
|
||||
#include "libcef_dll/ctocpp/ctocpp.h"
|
||||
|
||||
// Wrap a C structure with a C++ class.
|
||||
// This class may be instantiated and accessed wrapper-side only.
|
||||
class CefXmlReaderCToCpp
|
||||
: public CefCToCpp<CefXmlReaderCToCpp, CefXmlReader, cef_xml_reader_t>
|
||||
{
|
||||
public:
|
||||
CefXmlReaderCToCpp(cef_xml_reader_t* str)
|
||||
: CefCToCpp<CefXmlReaderCToCpp, CefXmlReader, cef_xml_reader_t>(str) {}
|
||||
virtual ~CefXmlReaderCToCpp() {}
|
||||
|
||||
// CefXmlReader methods
|
||||
virtual bool MoveToNextNode();
|
||||
virtual bool Close();
|
||||
virtual bool HasError();
|
||||
virtual CefString GetError();
|
||||
virtual NodeType GetType();
|
||||
virtual int GetDepth();
|
||||
virtual CefString GetLocalName();
|
||||
virtual CefString GetPrefix();
|
||||
virtual CefString GetQualifiedName();
|
||||
virtual CefString GetNamespaceURI();
|
||||
virtual CefString GetBaseURI();
|
||||
virtual CefString GetXmlLang();
|
||||
virtual bool IsEmptyElement();
|
||||
virtual bool HasValue();
|
||||
virtual CefString GetValue();
|
||||
virtual bool HasAttributes();
|
||||
virtual size_t GetAttributeCount();
|
||||
virtual CefString GetAttribute(int index);
|
||||
virtual CefString GetAttribute(const CefString& qualifiedName);
|
||||
virtual CefString GetAttribute(const CefString& localName,
|
||||
const CefString& namespaceURI);
|
||||
virtual CefString GetInnerXml();
|
||||
virtual CefString GetOuterXml();
|
||||
virtual int GetLineNumber();
|
||||
virtual bool MoveToAttribute(int index);
|
||||
virtual bool MoveToAttribute(const CefString& qualifiedName);
|
||||
virtual bool MoveToAttribute(const CefString& localName,
|
||||
const CefString& namespaceURI);
|
||||
virtual bool MoveToFirstAttribute();
|
||||
virtual bool MoveToNextAttribute();
|
||||
virtual bool MoveToCarryingElement();
|
||||
};
|
||||
|
||||
#endif // USING_CEF_SHARED
|
||||
#endif // _XMLREADER_CTOCPP_H
|
||||
|
||||
|
@ -95,7 +95,6 @@ const int kWindowHeight = 600;
|
||||
ss << "Console messages will be written to " << g_handler->GetLogFile();
|
||||
NSString* str = [NSString stringWithUTF8String:(ss.str().c_str())];
|
||||
[self alert:@"Console Messages" withMessage:str];
|
||||
[str release];
|
||||
}
|
||||
|
||||
- (void)notifyDownloadComplete:(id)object {
|
||||
@ -104,7 +103,6 @@ const int kWindowHeight = 600;
|
||||
"\" downloaded successfully.";
|
||||
NSString* str = [NSString stringWithUTF8String:(ss.str().c_str())];
|
||||
[self alert:@"File Download" withMessage:str];
|
||||
[str release];
|
||||
}
|
||||
|
||||
- (void)notifyDownloadError:(id)object {
|
||||
@ -113,7 +111,6 @@ const int kWindowHeight = 600;
|
||||
"\" failed to download.";
|
||||
NSString* str = [NSString stringWithUTF8String:(ss.str().c_str())];
|
||||
[self alert:@"File Download" withMessage:str];
|
||||
[str release];
|
||||
}
|
||||
|
||||
- (void)windowDidBecomeKey:(NSNotification*)notification {
|
||||
@ -236,7 +233,7 @@ NSButton* MakeButton(NSRect* rect, NSString* title, NSView* parent) {
|
||||
// Create the buttons.
|
||||
NSRect button_rect = [[mainWnd contentView] bounds];
|
||||
button_rect.origin.y = window_rect.size.height - URLBAR_HEIGHT +
|
||||
(URLBAR_HEIGHT - BUTTON_HEIGHT) / 2;
|
||||
(URLBAR_HEIGHT - BUTTON_HEIGHT) / 2;
|
||||
button_rect.size.height = BUTTON_HEIGHT;
|
||||
button_rect.origin.x += BUTTON_MARGIN;
|
||||
button_rect.size.width = BUTTON_WIDTH;
|
||||
@ -281,7 +278,7 @@ NSButton* MakeButton(NSRect* rect, NSString* title, NSView* parent) {
|
||||
window_info.SetAsChild((void*)[mainWnd contentView], 0, 0,
|
||||
kWindowWidth, kWindowHeight);
|
||||
CefBrowser::CreateBrowser(window_info, false, g_handler.get(),
|
||||
L"http://www.google.com");
|
||||
"http://www.google.com");
|
||||
|
||||
// Show the window.
|
||||
[mainWnd makeKeyAndOrderFront: nil];
|
||||
@ -378,10 +375,9 @@ CefHandler::RetVal ClientHandler::HandleAddressChange(
|
||||
{
|
||||
// Set the edit window text
|
||||
NSTextField* textField = (NSTextField*)m_EditHwnd;
|
||||
NSString* str =
|
||||
[NSString stringWithUTF8String:(std::string(url).c_str())];
|
||||
std::string urlStr(url);
|
||||
NSString* str = [NSString stringWithUTF8String:urlStr.c_str()];
|
||||
[textField setStringValue:str];
|
||||
[str release];
|
||||
}
|
||||
return RV_CONTINUE;
|
||||
}
|
||||
@ -391,10 +387,9 @@ CefHandler::RetVal ClientHandler::HandleTitleChange(
|
||||
{
|
||||
// Set the frame window title bar
|
||||
NSWindow* window = (NSWindow*)m_MainHwnd;
|
||||
NSString* str =
|
||||
[NSString stringWithUTF8String:(std::string(title).c_str())];
|
||||
std::string titleStr(title);
|
||||
NSString* str = [NSString stringWithUTF8String:titleStr.c_str()];
|
||||
[window setTitle:str];
|
||||
[str release];
|
||||
return RV_CONTINUE;
|
||||
}
|
||||
|
||||
|
@ -1,24 +1,24 @@
|
||||
<html>
|
||||
<body>
|
||||
<script language="JavaScript">
|
||||
var val = window.localStorage.getItem('val');
|
||||
function addLine() {
|
||||
if(val == null)
|
||||
val = '<br/>One Line.';
|
||||
else
|
||||
val += '<br/>Another Line.';
|
||||
window.localStorage.setItem('val', val);
|
||||
document.getElementById('out').innerHTML = val;
|
||||
}
|
||||
</script>
|
||||
Click the "Add Line" button to add a line or the "Clear" button to clear.<br/>
|
||||
This data will persist across sessions if a cache path was specified.<br/>
|
||||
<input type="button" value="Add Line" onClick="addLine();"/>
|
||||
<input type="button" value="Clear" onClick="window.localStorage.removeItem('val'); window.location.reload();"/>
|
||||
<div id="out"></div>
|
||||
<script language="JavaScript">
|
||||
if(val != null)
|
||||
document.getElementById('out').innerHTML = val;
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
<html>
|
||||
<body>
|
||||
<script language="JavaScript">
|
||||
var val = window.localStorage.getItem('val');
|
||||
function addLine() {
|
||||
if(val == null)
|
||||
val = '<br/>One Line.';
|
||||
else
|
||||
val += '<br/>Another Line.';
|
||||
window.localStorage.setItem('val', val);
|
||||
document.getElementById('out').innerHTML = val;
|
||||
}
|
||||
</script>
|
||||
Click the "Add Line" button to add a line or the "Clear" button to clear.<br/>
|
||||
This data will persist across sessions if a cache path was specified.<br/>
|
||||
<input type="button" value="Add Line" onClick="addLine();"/>
|
||||
<input type="button" value="Clear" onClick="window.localStorage.removeItem('val'); window.location.reload();"/>
|
||||
<div id="out"></div>
|
||||
<script language="JavaScript">
|
||||
if(val != null)
|
||||
document.getElementById('out').innerHTML = val;
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -13,7 +13,7 @@
|
||||
TEST(StringTest, UTF8)
|
||||
{
|
||||
CefStringUTF8 str1("Test String");
|
||||
ASSERT_EQ(str1.length(), 11);
|
||||
ASSERT_EQ(str1.length(), (size_t)11);
|
||||
ASSERT_FALSE(str1.empty());
|
||||
ASSERT_TRUE(str1.IsOwner());
|
||||
|
||||
@ -52,7 +52,7 @@ TEST(StringTest, UTF8)
|
||||
TEST(StringTest, UTF16)
|
||||
{
|
||||
CefStringUTF16 str1("Test String");
|
||||
ASSERT_EQ(str1.length(), 11);
|
||||
ASSERT_EQ(str1.length(), (size_t)11);
|
||||
ASSERT_FALSE(str1.empty());
|
||||
ASSERT_TRUE(str1.IsOwner());
|
||||
|
||||
@ -91,7 +91,7 @@ TEST(StringTest, UTF16)
|
||||
TEST(StringTest, Wide)
|
||||
{
|
||||
CefStringWide str1("Test String");
|
||||
ASSERT_EQ(str1.length(), 11);
|
||||
ASSERT_EQ(str1.length(), (size_t)11);
|
||||
ASSERT_FALSE(str1.empty());
|
||||
ASSERT_TRUE(str1.IsOwner());
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user