mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Linux: Add new CefPrintHandler and CefPrintSettings classes to support printing and a GTK implementation in cefclient (issue #1258).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1762 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
@ -11,6 +11,7 @@
|
||||
//
|
||||
|
||||
#include "libcef_dll/cpptoc/browser_process_handler_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/print_handler_cpptoc.h"
|
||||
#include "libcef_dll/ctocpp/command_line_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/list_value_ctocpp.h"
|
||||
|
||||
@ -65,6 +66,22 @@ void CEF_CALLBACK browser_process_handler_on_render_process_thread_created(
|
||||
CefListValueCToCpp::Wrap(extra_info));
|
||||
}
|
||||
|
||||
struct _cef_print_handler_t* CEF_CALLBACK browser_process_handler_get_print_handler(
|
||||
struct _cef_browser_process_handler_t* self) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return NULL;
|
||||
|
||||
// Execute
|
||||
CefRefPtr<CefPrintHandler> _retval = CefBrowserProcessHandlerCppToC::Get(
|
||||
self)->GetPrintHandler();
|
||||
|
||||
// Return type: refptr_same
|
||||
return CefPrintHandlerCppToC::Wrap(_retval);
|
||||
}
|
||||
|
||||
|
||||
// CONSTRUCTOR - Do not edit by hand.
|
||||
|
||||
@ -78,6 +95,7 @@ CefBrowserProcessHandlerCppToC::CefBrowserProcessHandlerCppToC(
|
||||
browser_process_handler_on_before_child_process_launch;
|
||||
struct_.struct_.on_render_process_thread_created =
|
||||
browser_process_handler_on_render_process_thread_created;
|
||||
struct_.struct_.get_print_handler = browser_process_handler_get_print_handler;
|
||||
}
|
||||
|
||||
#ifndef NDEBUG
|
||||
|
64
libcef_dll/cpptoc/print_dialog_callback_cpptoc.cc
Normal file
64
libcef_dll/cpptoc/print_dialog_callback_cpptoc.cc
Normal file
@ -0,0 +1,64 @@
|
||||
// Copyright (c) 2014 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/print_dialog_callback_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/print_settings_cpptoc.h"
|
||||
|
||||
|
||||
// MEMBER FUNCTIONS - Body may be edited by hand.
|
||||
|
||||
void CEF_CALLBACK print_dialog_callback_cont(
|
||||
struct _cef_print_dialog_callback_t* self,
|
||||
struct _cef_print_settings_t* settings) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return;
|
||||
// Verify param: settings; type: refptr_same
|
||||
DCHECK(settings);
|
||||
if (!settings)
|
||||
return;
|
||||
|
||||
// Execute
|
||||
CefPrintDialogCallbackCppToC::Get(self)->Continue(
|
||||
CefPrintSettingsCppToC::Unwrap(settings));
|
||||
}
|
||||
|
||||
void CEF_CALLBACK print_dialog_callback_cancel(
|
||||
struct _cef_print_dialog_callback_t* self) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return;
|
||||
|
||||
// Execute
|
||||
CefPrintDialogCallbackCppToC::Get(self)->Cancel();
|
||||
}
|
||||
|
||||
|
||||
// CONSTRUCTOR - Do not edit by hand.
|
||||
|
||||
CefPrintDialogCallbackCppToC::CefPrintDialogCallbackCppToC(
|
||||
CefPrintDialogCallback* cls)
|
||||
: CefCppToC<CefPrintDialogCallbackCppToC, CefPrintDialogCallback,
|
||||
cef_print_dialog_callback_t>(cls) {
|
||||
struct_.struct_.cont = print_dialog_callback_cont;
|
||||
struct_.struct_.cancel = print_dialog_callback_cancel;
|
||||
}
|
||||
|
||||
#ifndef NDEBUG
|
||||
template<> long CefCppToC<CefPrintDialogCallbackCppToC, CefPrintDialogCallback,
|
||||
cef_print_dialog_callback_t>::DebugObjCt = 0;
|
||||
#endif
|
||||
|
37
libcef_dll/cpptoc/print_dialog_callback_cpptoc.h
Normal file
37
libcef_dll/cpptoc/print_dialog_callback_cpptoc.h
Normal file
@ -0,0 +1,37 @@
|
||||
// Copyright (c) 2014 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_CPPTOC_PRINT_DIALOG_CALLBACK_CPPTOC_H_
|
||||
#define CEF_LIBCEF_DLL_CPPTOC_PRINT_DIALOG_CALLBACK_CPPTOC_H_
|
||||
#pragma once
|
||||
|
||||
#ifndef BUILDING_CEF_SHARED
|
||||
#pragma message("Warning: "__FILE__" may be accessed DLL-side only")
|
||||
#else // BUILDING_CEF_SHARED
|
||||
|
||||
#include "include/cef_print_handler.h"
|
||||
#include "include/capi/cef_print_handler_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 CefPrintDialogCallbackCppToC
|
||||
: public CefCppToC<CefPrintDialogCallbackCppToC, CefPrintDialogCallback,
|
||||
cef_print_dialog_callback_t> {
|
||||
public:
|
||||
explicit CefPrintDialogCallbackCppToC(CefPrintDialogCallback* cls);
|
||||
virtual ~CefPrintDialogCallbackCppToC() {}
|
||||
};
|
||||
|
||||
#endif // BUILDING_CEF_SHARED
|
||||
#endif // CEF_LIBCEF_DLL_CPPTOC_PRINT_DIALOG_CALLBACK_CPPTOC_H_
|
||||
|
121
libcef_dll/cpptoc/print_handler_cpptoc.cc
Normal file
121
libcef_dll/cpptoc/print_handler_cpptoc.cc
Normal file
@ -0,0 +1,121 @@
|
||||
// Copyright (c) 2014 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/print_handler_cpptoc.h"
|
||||
#include "libcef_dll/ctocpp/print_dialog_callback_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/print_job_callback_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/print_settings_ctocpp.h"
|
||||
|
||||
|
||||
// MEMBER FUNCTIONS - Body may be edited by hand.
|
||||
|
||||
void CEF_CALLBACK print_handler_on_print_settings(
|
||||
struct _cef_print_handler_t* self, struct _cef_print_settings_t* settings,
|
||||
int get_defaults) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return;
|
||||
// Verify param: settings; type: refptr_diff
|
||||
DCHECK(settings);
|
||||
if (!settings)
|
||||
return;
|
||||
|
||||
// Execute
|
||||
CefPrintHandlerCppToC::Get(self)->OnPrintSettings(
|
||||
CefPrintSettingsCToCpp::Wrap(settings),
|
||||
get_defaults?true:false);
|
||||
}
|
||||
|
||||
int CEF_CALLBACK print_handler_on_print_dialog(
|
||||
struct _cef_print_handler_t* self, int has_selection,
|
||||
cef_print_dialog_callback_t* callback) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return 0;
|
||||
// Verify param: callback; type: refptr_diff
|
||||
DCHECK(callback);
|
||||
if (!callback)
|
||||
return 0;
|
||||
|
||||
// Execute
|
||||
bool _retval = CefPrintHandlerCppToC::Get(self)->OnPrintDialog(
|
||||
has_selection?true:false,
|
||||
CefPrintDialogCallbackCToCpp::Wrap(callback));
|
||||
|
||||
// Return type: bool
|
||||
return _retval;
|
||||
}
|
||||
|
||||
int CEF_CALLBACK print_handler_on_print_job(struct _cef_print_handler_t* self,
|
||||
const cef_string_t* document_name, const cef_string_t* pdf_file_path,
|
||||
cef_print_job_callback_t* callback) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return 0;
|
||||
// Verify param: document_name; type: string_byref_const
|
||||
DCHECK(document_name);
|
||||
if (!document_name)
|
||||
return 0;
|
||||
// Verify param: pdf_file_path; type: string_byref_const
|
||||
DCHECK(pdf_file_path);
|
||||
if (!pdf_file_path)
|
||||
return 0;
|
||||
// Verify param: callback; type: refptr_diff
|
||||
DCHECK(callback);
|
||||
if (!callback)
|
||||
return 0;
|
||||
|
||||
// Execute
|
||||
bool _retval = CefPrintHandlerCppToC::Get(self)->OnPrintJob(
|
||||
CefString(document_name),
|
||||
CefString(pdf_file_path),
|
||||
CefPrintJobCallbackCToCpp::Wrap(callback));
|
||||
|
||||
// Return type: bool
|
||||
return _retval;
|
||||
}
|
||||
|
||||
void CEF_CALLBACK print_handler_on_print_reset(
|
||||
struct _cef_print_handler_t* self) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return;
|
||||
|
||||
// Execute
|
||||
CefPrintHandlerCppToC::Get(self)->OnPrintReset();
|
||||
}
|
||||
|
||||
|
||||
// CONSTRUCTOR - Do not edit by hand.
|
||||
|
||||
CefPrintHandlerCppToC::CefPrintHandlerCppToC(CefPrintHandler* cls)
|
||||
: CefCppToC<CefPrintHandlerCppToC, CefPrintHandler, cef_print_handler_t>(
|
||||
cls) {
|
||||
struct_.struct_.on_print_settings = print_handler_on_print_settings;
|
||||
struct_.struct_.on_print_dialog = print_handler_on_print_dialog;
|
||||
struct_.struct_.on_print_job = print_handler_on_print_job;
|
||||
struct_.struct_.on_print_reset = print_handler_on_print_reset;
|
||||
}
|
||||
|
||||
#ifndef NDEBUG
|
||||
template<> long CefCppToC<CefPrintHandlerCppToC, CefPrintHandler,
|
||||
cef_print_handler_t>::DebugObjCt = 0;
|
||||
#endif
|
||||
|
37
libcef_dll/cpptoc/print_handler_cpptoc.h
Normal file
37
libcef_dll/cpptoc/print_handler_cpptoc.h
Normal file
@ -0,0 +1,37 @@
|
||||
// Copyright (c) 2014 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_CPPTOC_PRINT_HANDLER_CPPTOC_H_
|
||||
#define CEF_LIBCEF_DLL_CPPTOC_PRINT_HANDLER_CPPTOC_H_
|
||||
#pragma once
|
||||
|
||||
#ifndef USING_CEF_SHARED
|
||||
#pragma message("Warning: "__FILE__" may be accessed wrapper-side only")
|
||||
#else // USING_CEF_SHARED
|
||||
|
||||
#include "include/cef_print_handler.h"
|
||||
#include "include/capi/cef_print_handler_capi.h"
|
||||
#include "libcef_dll/cpptoc/cpptoc.h"
|
||||
|
||||
// Wrap a C++ class with a C structure.
|
||||
// This class may be instantiated and accessed wrapper-side only.
|
||||
class CefPrintHandlerCppToC
|
||||
: public CefCppToC<CefPrintHandlerCppToC, CefPrintHandler,
|
||||
cef_print_handler_t> {
|
||||
public:
|
||||
explicit CefPrintHandlerCppToC(CefPrintHandler* cls);
|
||||
virtual ~CefPrintHandlerCppToC() {}
|
||||
};
|
||||
|
||||
#endif // USING_CEF_SHARED
|
||||
#endif // CEF_LIBCEF_DLL_CPPTOC_PRINT_HANDLER_CPPTOC_H_
|
||||
|
43
libcef_dll/cpptoc/print_job_callback_cpptoc.cc
Normal file
43
libcef_dll/cpptoc/print_job_callback_cpptoc.cc
Normal file
@ -0,0 +1,43 @@
|
||||
// Copyright (c) 2014 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/print_job_callback_cpptoc.h"
|
||||
|
||||
|
||||
// MEMBER FUNCTIONS - Body may be edited by hand.
|
||||
|
||||
void CEF_CALLBACK print_job_callback_cont(
|
||||
struct _cef_print_job_callback_t* self) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return;
|
||||
|
||||
// Execute
|
||||
CefPrintJobCallbackCppToC::Get(self)->Continue();
|
||||
}
|
||||
|
||||
|
||||
// CONSTRUCTOR - Do not edit by hand.
|
||||
|
||||
CefPrintJobCallbackCppToC::CefPrintJobCallbackCppToC(CefPrintJobCallback* cls)
|
||||
: CefCppToC<CefPrintJobCallbackCppToC, CefPrintJobCallback,
|
||||
cef_print_job_callback_t>(cls) {
|
||||
struct_.struct_.cont = print_job_callback_cont;
|
||||
}
|
||||
|
||||
#ifndef NDEBUG
|
||||
template<> long CefCppToC<CefPrintJobCallbackCppToC, CefPrintJobCallback,
|
||||
cef_print_job_callback_t>::DebugObjCt = 0;
|
||||
#endif
|
||||
|
37
libcef_dll/cpptoc/print_job_callback_cpptoc.h
Normal file
37
libcef_dll/cpptoc/print_job_callback_cpptoc.h
Normal file
@ -0,0 +1,37 @@
|
||||
// Copyright (c) 2014 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_CPPTOC_PRINT_JOB_CALLBACK_CPPTOC_H_
|
||||
#define CEF_LIBCEF_DLL_CPPTOC_PRINT_JOB_CALLBACK_CPPTOC_H_
|
||||
#pragma once
|
||||
|
||||
#ifndef BUILDING_CEF_SHARED
|
||||
#pragma message("Warning: "__FILE__" may be accessed DLL-side only")
|
||||
#else // BUILDING_CEF_SHARED
|
||||
|
||||
#include "include/cef_print_handler.h"
|
||||
#include "include/capi/cef_print_handler_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 CefPrintJobCallbackCppToC
|
||||
: public CefCppToC<CefPrintJobCallbackCppToC, CefPrintJobCallback,
|
||||
cef_print_job_callback_t> {
|
||||
public:
|
||||
explicit CefPrintJobCallbackCppToC(CefPrintJobCallback* cls);
|
||||
virtual ~CefPrintJobCallbackCppToC() {}
|
||||
};
|
||||
|
||||
#endif // BUILDING_CEF_SHARED
|
||||
#endif // CEF_LIBCEF_DLL_CPPTOC_PRINT_JOB_CALLBACK_CPPTOC_H_
|
||||
|
447
libcef_dll/cpptoc/print_settings_cpptoc.cc
Normal file
447
libcef_dll/cpptoc/print_settings_cpptoc.cc
Normal file
@ -0,0 +1,447 @@
|
||||
// Copyright (c) 2014 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 <algorithm>
|
||||
#include "libcef_dll/cpptoc/print_settings_cpptoc.h"
|
||||
|
||||
|
||||
// GLOBAL FUNCTIONS - Body may be edited by hand.
|
||||
|
||||
CEF_EXPORT cef_print_settings_t* cef_print_settings_create() {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
CefRefPtr<CefPrintSettings> _retval = CefPrintSettings::Create();
|
||||
|
||||
// Return type: refptr_same
|
||||
return CefPrintSettingsCppToC::Wrap(_retval);
|
||||
}
|
||||
|
||||
|
||||
// MEMBER FUNCTIONS - Body may be edited by hand.
|
||||
|
||||
int CEF_CALLBACK print_settings_is_valid(struct _cef_print_settings_t* self) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return 0;
|
||||
|
||||
// Execute
|
||||
bool _retval = CefPrintSettingsCppToC::Get(self)->IsValid();
|
||||
|
||||
// Return type: bool
|
||||
return _retval;
|
||||
}
|
||||
|
||||
int CEF_CALLBACK print_settings_is_read_only(
|
||||
struct _cef_print_settings_t* self) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return 0;
|
||||
|
||||
// Execute
|
||||
bool _retval = CefPrintSettingsCppToC::Get(self)->IsReadOnly();
|
||||
|
||||
// Return type: bool
|
||||
return _retval;
|
||||
}
|
||||
|
||||
struct _cef_print_settings_t* CEF_CALLBACK print_settings_copy(
|
||||
struct _cef_print_settings_t* self) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return NULL;
|
||||
|
||||
// Execute
|
||||
CefRefPtr<CefPrintSettings> _retval = CefPrintSettingsCppToC::Get(self)->Copy(
|
||||
);
|
||||
|
||||
// Return type: refptr_same
|
||||
return CefPrintSettingsCppToC::Wrap(_retval);
|
||||
}
|
||||
|
||||
void CEF_CALLBACK print_settings_set_orientation(
|
||||
struct _cef_print_settings_t* self, int landscape) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return;
|
||||
|
||||
// Execute
|
||||
CefPrintSettingsCppToC::Get(self)->SetOrientation(
|
||||
landscape?true:false);
|
||||
}
|
||||
|
||||
int CEF_CALLBACK print_settings_is_landscape(
|
||||
struct _cef_print_settings_t* self) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return 0;
|
||||
|
||||
// Execute
|
||||
bool _retval = CefPrintSettingsCppToC::Get(self)->IsLandscape();
|
||||
|
||||
// Return type: bool
|
||||
return _retval;
|
||||
}
|
||||
|
||||
void CEF_CALLBACK print_settings_set_printer_printable_area(
|
||||
struct _cef_print_settings_t* self,
|
||||
const cef_size_t* physical_size_device_units,
|
||||
const cef_rect_t* printable_area_device_units, int landscape_needs_flip) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return;
|
||||
// Verify param: physical_size_device_units; type: simple_byref_const
|
||||
DCHECK(physical_size_device_units);
|
||||
if (!physical_size_device_units)
|
||||
return;
|
||||
// Verify param: printable_area_device_units; type: simple_byref_const
|
||||
DCHECK(printable_area_device_units);
|
||||
if (!printable_area_device_units)
|
||||
return;
|
||||
|
||||
// Translate param: physical_size_device_units; type: simple_byref_const
|
||||
CefSize physical_size_device_unitsVal =
|
||||
physical_size_device_units?*physical_size_device_units:CefSize();
|
||||
// Translate param: printable_area_device_units; type: simple_byref_const
|
||||
CefRect printable_area_device_unitsVal =
|
||||
printable_area_device_units?*printable_area_device_units:CefRect();
|
||||
|
||||
// Execute
|
||||
CefPrintSettingsCppToC::Get(self)->SetPrinterPrintableArea(
|
||||
physical_size_device_unitsVal,
|
||||
printable_area_device_unitsVal,
|
||||
landscape_needs_flip?true:false);
|
||||
}
|
||||
|
||||
void CEF_CALLBACK print_settings_set_device_name(
|
||||
struct _cef_print_settings_t* self, const cef_string_t* name) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return;
|
||||
// Unverified params: name
|
||||
|
||||
// Execute
|
||||
CefPrintSettingsCppToC::Get(self)->SetDeviceName(
|
||||
CefString(name));
|
||||
}
|
||||
|
||||
cef_string_userfree_t CEF_CALLBACK print_settings_get_device_name(
|
||||
struct _cef_print_settings_t* self) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return NULL;
|
||||
|
||||
// Execute
|
||||
CefString _retval = CefPrintSettingsCppToC::Get(self)->GetDeviceName();
|
||||
|
||||
// Return type: string
|
||||
return _retval.DetachToUserFree();
|
||||
}
|
||||
|
||||
void CEF_CALLBACK print_settings_set_dpi(struct _cef_print_settings_t* self,
|
||||
int dpi) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return;
|
||||
|
||||
// Execute
|
||||
CefPrintSettingsCppToC::Get(self)->SetDPI(
|
||||
dpi);
|
||||
}
|
||||
|
||||
int CEF_CALLBACK print_settings_get_dpi(struct _cef_print_settings_t* self) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return 0;
|
||||
|
||||
// Execute
|
||||
int _retval = CefPrintSettingsCppToC::Get(self)->GetDPI();
|
||||
|
||||
// Return type: simple
|
||||
return _retval;
|
||||
}
|
||||
|
||||
void CEF_CALLBACK print_settings_set_page_ranges(
|
||||
struct _cef_print_settings_t* self, size_t rangesCount,
|
||||
cef_page_range_t const* ranges) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return;
|
||||
// Verify param: ranges; type: simple_vec_byref_const
|
||||
DCHECK(rangesCount == 0 || ranges);
|
||||
if (rangesCount > 0 && !ranges)
|
||||
return;
|
||||
|
||||
// Translate param: ranges; type: simple_vec_byref_const
|
||||
std::vector<CefPageRange > rangesList;
|
||||
if (rangesCount > 0) {
|
||||
for (size_t i = 0; i < rangesCount; ++i) {
|
||||
rangesList.push_back(ranges[i]);
|
||||
}
|
||||
}
|
||||
|
||||
// Execute
|
||||
CefPrintSettingsCppToC::Get(self)->SetPageRanges(
|
||||
rangesList);
|
||||
}
|
||||
|
||||
size_t CEF_CALLBACK print_settings_get_page_ranges_count(
|
||||
struct _cef_print_settings_t* self) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return 0;
|
||||
|
||||
// Execute
|
||||
size_t _retval = CefPrintSettingsCppToC::Get(self)->GetPageRangesCount();
|
||||
|
||||
// Return type: simple
|
||||
return _retval;
|
||||
}
|
||||
|
||||
void CEF_CALLBACK print_settings_get_page_ranges(
|
||||
struct _cef_print_settings_t* self, size_t* rangesCount,
|
||||
cef_page_range_t* ranges) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return;
|
||||
// Verify param: ranges; type: simple_vec_byref
|
||||
DCHECK(rangesCount && (*rangesCount == 0 || ranges));
|
||||
if (!rangesCount || (*rangesCount > 0 && !ranges))
|
||||
return;
|
||||
|
||||
// Translate param: ranges; type: simple_vec_byref
|
||||
std::vector<CefPageRange > rangesList;
|
||||
if (rangesCount && *rangesCount > 0 && ranges) {
|
||||
for (size_t i = 0; i < *rangesCount; ++i) {
|
||||
rangesList.push_back(ranges[i]);
|
||||
}
|
||||
}
|
||||
|
||||
// Execute
|
||||
CefPrintSettingsCppToC::Get(self)->GetPageRanges(
|
||||
rangesList);
|
||||
|
||||
// Restore param: ranges; type: simple_vec_byref
|
||||
if (rangesCount && ranges) {
|
||||
*rangesCount = std::min(rangesList.size(), *rangesCount);
|
||||
if (*rangesCount > 0) {
|
||||
for (size_t i = 0; i < *rangesCount; ++i) {
|
||||
ranges[i] = rangesList[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CEF_CALLBACK print_settings_set_selection_only(
|
||||
struct _cef_print_settings_t* self, int selection_only) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return;
|
||||
|
||||
// Execute
|
||||
CefPrintSettingsCppToC::Get(self)->SetSelectionOnly(
|
||||
selection_only?true:false);
|
||||
}
|
||||
|
||||
int CEF_CALLBACK print_settings_is_selection_only(
|
||||
struct _cef_print_settings_t* self) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return 0;
|
||||
|
||||
// Execute
|
||||
bool _retval = CefPrintSettingsCppToC::Get(self)->IsSelectionOnly();
|
||||
|
||||
// Return type: bool
|
||||
return _retval;
|
||||
}
|
||||
|
||||
void CEF_CALLBACK print_settings_set_collate(struct _cef_print_settings_t* self,
|
||||
int collate) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return;
|
||||
|
||||
// Execute
|
||||
CefPrintSettingsCppToC::Get(self)->SetCollate(
|
||||
collate?true:false);
|
||||
}
|
||||
|
||||
int CEF_CALLBACK print_settings_will_collate(
|
||||
struct _cef_print_settings_t* self) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return 0;
|
||||
|
||||
// Execute
|
||||
bool _retval = CefPrintSettingsCppToC::Get(self)->WillCollate();
|
||||
|
||||
// Return type: bool
|
||||
return _retval;
|
||||
}
|
||||
|
||||
void CEF_CALLBACK print_settings_set_color_model(
|
||||
struct _cef_print_settings_t* self, cef_color_model_t model) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return;
|
||||
|
||||
// Execute
|
||||
CefPrintSettingsCppToC::Get(self)->SetColorModel(
|
||||
model);
|
||||
}
|
||||
|
||||
cef_color_model_t CEF_CALLBACK print_settings_get_color_model(
|
||||
struct _cef_print_settings_t* self) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return COLOR_MODEL_UNKNOWN;
|
||||
|
||||
// Execute
|
||||
cef_color_model_t _retval = CefPrintSettingsCppToC::Get(self)->GetColorModel(
|
||||
);
|
||||
|
||||
// Return type: simple
|
||||
return _retval;
|
||||
}
|
||||
|
||||
void CEF_CALLBACK print_settings_set_copies(struct _cef_print_settings_t* self,
|
||||
int copies) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return;
|
||||
|
||||
// Execute
|
||||
CefPrintSettingsCppToC::Get(self)->SetCopies(
|
||||
copies);
|
||||
}
|
||||
|
||||
int CEF_CALLBACK print_settings_get_copies(struct _cef_print_settings_t* self) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return 0;
|
||||
|
||||
// Execute
|
||||
int _retval = CefPrintSettingsCppToC::Get(self)->GetCopies();
|
||||
|
||||
// Return type: simple
|
||||
return _retval;
|
||||
}
|
||||
|
||||
void CEF_CALLBACK print_settings_set_duplex_mode(
|
||||
struct _cef_print_settings_t* self, cef_duplex_mode_t mode) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return;
|
||||
|
||||
// Execute
|
||||
CefPrintSettingsCppToC::Get(self)->SetDuplexMode(
|
||||
mode);
|
||||
}
|
||||
|
||||
cef_duplex_mode_t CEF_CALLBACK print_settings_get_duplex_mode(
|
||||
struct _cef_print_settings_t* self) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return DUPLEX_MODE_UNKNOWN;
|
||||
|
||||
// Execute
|
||||
cef_duplex_mode_t _retval = CefPrintSettingsCppToC::Get(self)->GetDuplexMode(
|
||||
);
|
||||
|
||||
// Return type: simple
|
||||
return _retval;
|
||||
}
|
||||
|
||||
|
||||
// CONSTRUCTOR - Do not edit by hand.
|
||||
|
||||
CefPrintSettingsCppToC::CefPrintSettingsCppToC(CefPrintSettings* cls)
|
||||
: CefCppToC<CefPrintSettingsCppToC, CefPrintSettings, cef_print_settings_t>(
|
||||
cls) {
|
||||
struct_.struct_.is_valid = print_settings_is_valid;
|
||||
struct_.struct_.is_read_only = print_settings_is_read_only;
|
||||
struct_.struct_.copy = print_settings_copy;
|
||||
struct_.struct_.set_orientation = print_settings_set_orientation;
|
||||
struct_.struct_.is_landscape = print_settings_is_landscape;
|
||||
struct_.struct_.set_printer_printable_area =
|
||||
print_settings_set_printer_printable_area;
|
||||
struct_.struct_.set_device_name = print_settings_set_device_name;
|
||||
struct_.struct_.get_device_name = print_settings_get_device_name;
|
||||
struct_.struct_.set_dpi = print_settings_set_dpi;
|
||||
struct_.struct_.get_dpi = print_settings_get_dpi;
|
||||
struct_.struct_.set_page_ranges = print_settings_set_page_ranges;
|
||||
struct_.struct_.get_page_ranges_count = print_settings_get_page_ranges_count;
|
||||
struct_.struct_.get_page_ranges = print_settings_get_page_ranges;
|
||||
struct_.struct_.set_selection_only = print_settings_set_selection_only;
|
||||
struct_.struct_.is_selection_only = print_settings_is_selection_only;
|
||||
struct_.struct_.set_collate = print_settings_set_collate;
|
||||
struct_.struct_.will_collate = print_settings_will_collate;
|
||||
struct_.struct_.set_color_model = print_settings_set_color_model;
|
||||
struct_.struct_.get_color_model = print_settings_get_color_model;
|
||||
struct_.struct_.set_copies = print_settings_set_copies;
|
||||
struct_.struct_.get_copies = print_settings_get_copies;
|
||||
struct_.struct_.set_duplex_mode = print_settings_set_duplex_mode;
|
||||
struct_.struct_.get_duplex_mode = print_settings_get_duplex_mode;
|
||||
}
|
||||
|
||||
#ifndef NDEBUG
|
||||
template<> long CefCppToC<CefPrintSettingsCppToC, CefPrintSettings,
|
||||
cef_print_settings_t>::DebugObjCt = 0;
|
||||
#endif
|
||||
|
37
libcef_dll/cpptoc/print_settings_cpptoc.h
Normal file
37
libcef_dll/cpptoc/print_settings_cpptoc.h
Normal file
@ -0,0 +1,37 @@
|
||||
// Copyright (c) 2014 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_CPPTOC_PRINT_SETTINGS_CPPTOC_H_
|
||||
#define CEF_LIBCEF_DLL_CPPTOC_PRINT_SETTINGS_CPPTOC_H_
|
||||
#pragma once
|
||||
|
||||
#ifndef BUILDING_CEF_SHARED
|
||||
#pragma message("Warning: "__FILE__" may be accessed DLL-side only")
|
||||
#else // BUILDING_CEF_SHARED
|
||||
|
||||
#include "include/cef_print_settings.h"
|
||||
#include "include/capi/cef_print_settings_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 CefPrintSettingsCppToC
|
||||
: public CefCppToC<CefPrintSettingsCppToC, CefPrintSettings,
|
||||
cef_print_settings_t> {
|
||||
public:
|
||||
explicit CefPrintSettingsCppToC(CefPrintSettings* cls);
|
||||
virtual ~CefPrintSettingsCppToC() {}
|
||||
};
|
||||
|
||||
#endif // BUILDING_CEF_SHARED
|
||||
#endif // CEF_LIBCEF_DLL_CPPTOC_PRINT_SETTINGS_CPPTOC_H_
|
||||
|
Reference in New Issue
Block a user