mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Add support for CefDragHandler::OnDragEnter (issue #601).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1282 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
#include "libcef_dll/ctocpp/dialog_handler_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/display_handler_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/download_handler_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/drag_handler_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/focus_handler_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/geolocation_handler_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/jsdialog_handler_ctocpp.h"
|
||||
@@ -82,6 +83,19 @@ CefRefPtr<CefDownloadHandler> CefClientCToCpp::GetDownloadHandler() {
|
||||
return CefDownloadHandlerCToCpp::Wrap(_retval);
|
||||
}
|
||||
|
||||
CefRefPtr<CefDragHandler> CefClientCToCpp::GetDragHandler() {
|
||||
if (CEF_MEMBER_MISSING(struct_, get_drag_handler))
|
||||
return NULL;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
cef_drag_handler_t* _retval = struct_->get_drag_handler(struct_);
|
||||
|
||||
// Return type: refptr_same
|
||||
return CefDragHandlerCToCpp::Wrap(_retval);
|
||||
}
|
||||
|
||||
CefRefPtr<CefFocusHandler> CefClientCToCpp::GetFocusHandler() {
|
||||
if (CEF_MEMBER_MISSING(struct_, get_focus_handler))
|
||||
return NULL;
|
||||
|
@@ -36,6 +36,7 @@ class CefClientCToCpp
|
||||
virtual CefRefPtr<CefDialogHandler> GetDialogHandler() OVERRIDE;
|
||||
virtual CefRefPtr<CefDisplayHandler> GetDisplayHandler() OVERRIDE;
|
||||
virtual CefRefPtr<CefDownloadHandler> GetDownloadHandler() OVERRIDE;
|
||||
virtual CefRefPtr<CefDragHandler> GetDragHandler() OVERRIDE;
|
||||
virtual CefRefPtr<CefFocusHandler> GetFocusHandler() OVERRIDE;
|
||||
virtual CefRefPtr<CefGeolocationHandler> GetGeolocationHandler() OVERRIDE;
|
||||
virtual CefRefPtr<CefJSDialogHandler> GetJSDialogHandler() OVERRIDE;
|
||||
|
195
libcef_dll/ctocpp/drag_data_ctocpp.cc
Normal file
195
libcef_dll/ctocpp/drag_data_ctocpp.cc
Normal file
@@ -0,0 +1,195 @@
|
||||
// Copyright (c) 2013 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. If making changes by
|
||||
// hand only do so within the body of existing method and function
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
|
||||
#include "libcef_dll/ctocpp/drag_data_ctocpp.h"
|
||||
#include "libcef_dll/transfer_util.h"
|
||||
|
||||
|
||||
// VIRTUAL METHODS - Body may be edited by hand.
|
||||
|
||||
bool CefDragDataCToCpp::IsLink() {
|
||||
if (CEF_MEMBER_MISSING(struct_, is_link))
|
||||
return false;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
int _retval = struct_->is_link(struct_);
|
||||
|
||||
// Return type: bool
|
||||
return _retval?true:false;
|
||||
}
|
||||
|
||||
bool CefDragDataCToCpp::IsFragment() {
|
||||
if (CEF_MEMBER_MISSING(struct_, is_fragment))
|
||||
return false;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
int _retval = struct_->is_fragment(struct_);
|
||||
|
||||
// Return type: bool
|
||||
return _retval?true:false;
|
||||
}
|
||||
|
||||
bool CefDragDataCToCpp::IsFile() {
|
||||
if (CEF_MEMBER_MISSING(struct_, is_file))
|
||||
return false;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
int _retval = struct_->is_file(struct_);
|
||||
|
||||
// Return type: bool
|
||||
return _retval?true:false;
|
||||
}
|
||||
|
||||
CefString CefDragDataCToCpp::GetLinkURL() {
|
||||
if (CEF_MEMBER_MISSING(struct_, get_link_url))
|
||||
return CefString();
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
cef_string_userfree_t _retval = struct_->get_link_url(struct_);
|
||||
|
||||
// Return type: string
|
||||
CefString _retvalStr;
|
||||
_retvalStr.AttachToUserFree(_retval);
|
||||
return _retvalStr;
|
||||
}
|
||||
|
||||
CefString CefDragDataCToCpp::GetLinkTitle() {
|
||||
if (CEF_MEMBER_MISSING(struct_, get_link_title))
|
||||
return CefString();
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
cef_string_userfree_t _retval = struct_->get_link_title(struct_);
|
||||
|
||||
// Return type: string
|
||||
CefString _retvalStr;
|
||||
_retvalStr.AttachToUserFree(_retval);
|
||||
return _retvalStr;
|
||||
}
|
||||
|
||||
CefString CefDragDataCToCpp::GetLinkMetadata() {
|
||||
if (CEF_MEMBER_MISSING(struct_, get_link_metadata))
|
||||
return CefString();
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
cef_string_userfree_t _retval = struct_->get_link_metadata(struct_);
|
||||
|
||||
// Return type: string
|
||||
CefString _retvalStr;
|
||||
_retvalStr.AttachToUserFree(_retval);
|
||||
return _retvalStr;
|
||||
}
|
||||
|
||||
CefString CefDragDataCToCpp::GetFragmentText() {
|
||||
if (CEF_MEMBER_MISSING(struct_, get_fragment_text))
|
||||
return CefString();
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
cef_string_userfree_t _retval = struct_->get_fragment_text(struct_);
|
||||
|
||||
// Return type: string
|
||||
CefString _retvalStr;
|
||||
_retvalStr.AttachToUserFree(_retval);
|
||||
return _retvalStr;
|
||||
}
|
||||
|
||||
CefString CefDragDataCToCpp::GetFragmentHtml() {
|
||||
if (CEF_MEMBER_MISSING(struct_, get_fragment_html))
|
||||
return CefString();
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
cef_string_userfree_t _retval = struct_->get_fragment_html(struct_);
|
||||
|
||||
// Return type: string
|
||||
CefString _retvalStr;
|
||||
_retvalStr.AttachToUserFree(_retval);
|
||||
return _retvalStr;
|
||||
}
|
||||
|
||||
CefString CefDragDataCToCpp::GetFragmentBaseURL() {
|
||||
if (CEF_MEMBER_MISSING(struct_, get_fragment_base_url))
|
||||
return CefString();
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
cef_string_userfree_t _retval = struct_->get_fragment_base_url(struct_);
|
||||
|
||||
// Return type: string
|
||||
CefString _retvalStr;
|
||||
_retvalStr.AttachToUserFree(_retval);
|
||||
return _retvalStr;
|
||||
}
|
||||
|
||||
CefString CefDragDataCToCpp::GetFileName() {
|
||||
if (CEF_MEMBER_MISSING(struct_, get_file_name))
|
||||
return CefString();
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
cef_string_userfree_t _retval = struct_->get_file_name(struct_);
|
||||
|
||||
// Return type: string
|
||||
CefString _retvalStr;
|
||||
_retvalStr.AttachToUserFree(_retval);
|
||||
return _retvalStr;
|
||||
}
|
||||
|
||||
bool CefDragDataCToCpp::GetFileNames(std::vector<CefString>& names) {
|
||||
if (CEF_MEMBER_MISSING(struct_, get_file_names))
|
||||
return false;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Translate param: names; type: string_vec_byref
|
||||
cef_string_list_t namesList = cef_string_list_alloc();
|
||||
DCHECK(namesList);
|
||||
if (namesList)
|
||||
transfer_string_list_contents(names, namesList);
|
||||
|
||||
// Execute
|
||||
int _retval = struct_->get_file_names(struct_,
|
||||
namesList);
|
||||
|
||||
// Restore param:names; type: string_vec_byref
|
||||
if (namesList) {
|
||||
names.clear();
|
||||
transfer_string_list_contents(namesList, names);
|
||||
cef_string_list_free(namesList);
|
||||
}
|
||||
|
||||
// Return type: bool
|
||||
return _retval?true:false;
|
||||
}
|
||||
|
||||
|
||||
#ifndef NDEBUG
|
||||
template<> long CefCToCpp<CefDragDataCToCpp, CefDragData,
|
||||
cef_drag_data_t>::DebugObjCt = 0;
|
||||
#endif
|
||||
|
51
libcef_dll/ctocpp/drag_data_ctocpp.h
Normal file
51
libcef_dll/ctocpp/drag_data_ctocpp.h
Normal file
@@ -0,0 +1,51 @@
|
||||
// Copyright (c) 2013 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. If making changes by
|
||||
// hand only do so within the body of existing method and function
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
|
||||
#ifndef CEF_LIBCEF_DLL_CTOCPP_DRAG_DATA_CTOCPP_H_
|
||||
#define CEF_LIBCEF_DLL_CTOCPP_DRAG_DATA_CTOCPP_H_
|
||||
#pragma once
|
||||
|
||||
#ifndef USING_CEF_SHARED
|
||||
#pragma message("Warning: "__FILE__" may be accessed wrapper-side only")
|
||||
#else // USING_CEF_SHARED
|
||||
|
||||
#include <vector>
|
||||
#include "include/cef_drag_data.h"
|
||||
#include "include/capi/cef_drag_data_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 CefDragDataCToCpp
|
||||
: public CefCToCpp<CefDragDataCToCpp, CefDragData, cef_drag_data_t> {
|
||||
public:
|
||||
explicit CefDragDataCToCpp(cef_drag_data_t* str)
|
||||
: CefCToCpp<CefDragDataCToCpp, CefDragData, cef_drag_data_t>(str) {}
|
||||
virtual ~CefDragDataCToCpp() {}
|
||||
|
||||
// CefDragData methods
|
||||
virtual bool IsLink() OVERRIDE;
|
||||
virtual bool IsFragment() OVERRIDE;
|
||||
virtual bool IsFile() OVERRIDE;
|
||||
virtual CefString GetLinkURL() OVERRIDE;
|
||||
virtual CefString GetLinkTitle() OVERRIDE;
|
||||
virtual CefString GetLinkMetadata() OVERRIDE;
|
||||
virtual CefString GetFragmentText() OVERRIDE;
|
||||
virtual CefString GetFragmentHtml() OVERRIDE;
|
||||
virtual CefString GetFragmentBaseURL() OVERRIDE;
|
||||
virtual CefString GetFileName() OVERRIDE;
|
||||
virtual bool GetFileNames(std::vector<CefString>& names) OVERRIDE;
|
||||
};
|
||||
|
||||
#endif // USING_CEF_SHARED
|
||||
#endif // CEF_LIBCEF_DLL_CTOCPP_DRAG_DATA_CTOCPP_H_
|
||||
|
51
libcef_dll/ctocpp/drag_handler_ctocpp.cc
Normal file
51
libcef_dll/ctocpp/drag_handler_ctocpp.cc
Normal file
@@ -0,0 +1,51 @@
|
||||
// Copyright (c) 2013 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. If making changes by
|
||||
// hand only do so within the body of existing method and function
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
|
||||
#include "libcef_dll/cpptoc/browser_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/drag_data_cpptoc.h"
|
||||
#include "libcef_dll/ctocpp/drag_handler_ctocpp.h"
|
||||
|
||||
|
||||
// VIRTUAL METHODS - Body may be edited by hand.
|
||||
|
||||
bool CefDragHandlerCToCpp::OnDragEnter(CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefDragData> dragData, DragOperationsMask mask) {
|
||||
if (CEF_MEMBER_MISSING(struct_, on_drag_enter))
|
||||
return false;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Verify param: browser; type: refptr_diff
|
||||
DCHECK(browser.get());
|
||||
if (!browser.get())
|
||||
return false;
|
||||
// Verify param: dragData; type: refptr_diff
|
||||
DCHECK(dragData.get());
|
||||
if (!dragData.get())
|
||||
return false;
|
||||
|
||||
// Execute
|
||||
int _retval = struct_->on_drag_enter(struct_,
|
||||
CefBrowserCppToC::Wrap(browser),
|
||||
CefDragDataCppToC::Wrap(dragData),
|
||||
mask);
|
||||
|
||||
// Return type: bool
|
||||
return _retval?true:false;
|
||||
}
|
||||
|
||||
|
||||
#ifndef NDEBUG
|
||||
template<> long CefCToCpp<CefDragHandlerCToCpp, CefDragHandler,
|
||||
cef_drag_handler_t>::DebugObjCt = 0;
|
||||
#endif
|
||||
|
43
libcef_dll/ctocpp/drag_handler_ctocpp.h
Normal file
43
libcef_dll/ctocpp/drag_handler_ctocpp.h
Normal file
@@ -0,0 +1,43 @@
|
||||
// Copyright (c) 2013 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. If making changes by
|
||||
// hand only do so within the body of existing method and function
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
|
||||
#ifndef CEF_LIBCEF_DLL_CTOCPP_DRAG_HANDLER_CTOCPP_H_
|
||||
#define CEF_LIBCEF_DLL_CTOCPP_DRAG_HANDLER_CTOCPP_H_
|
||||
#pragma once
|
||||
|
||||
#ifndef BUILDING_CEF_SHARED
|
||||
#pragma message("Warning: "__FILE__" may be accessed DLL-side only")
|
||||
#else // BUILDING_CEF_SHARED
|
||||
|
||||
#include "include/cef_drag_handler.h"
|
||||
#include "include/capi/cef_drag_handler_capi.h"
|
||||
#include "libcef_dll/ctocpp/ctocpp.h"
|
||||
|
||||
// Wrap a C structure with a C++ class.
|
||||
// This class may be instantiated and accessed DLL-side only.
|
||||
class CefDragHandlerCToCpp
|
||||
: public CefCToCpp<CefDragHandlerCToCpp, CefDragHandler,
|
||||
cef_drag_handler_t> {
|
||||
public:
|
||||
explicit CefDragHandlerCToCpp(cef_drag_handler_t* str)
|
||||
: CefCToCpp<CefDragHandlerCToCpp, CefDragHandler, cef_drag_handler_t>(
|
||||
str) {}
|
||||
virtual ~CefDragHandlerCToCpp() {}
|
||||
|
||||
// CefDragHandler methods
|
||||
virtual bool OnDragEnter(CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefDragData> dragData, DragOperationsMask mask) OVERRIDE;
|
||||
};
|
||||
|
||||
#endif // BUILDING_CEF_SHARED
|
||||
#endif // CEF_LIBCEF_DLL_CTOCPP_DRAG_HANDLER_CTOCPP_H_
|
||||
|
Reference in New Issue
Block a user