diff options
author | raymes@chromium.org <raymes@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-14 21:15:50 +0000 |
---|---|---|
committer | raymes@chromium.org <raymes@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-14 21:15:50 +0000 |
commit | 772a746250daaef9e464673d8a13359ed5f34ef3 (patch) | |
tree | 14b18be45ef79bca96f04523c14dcdfc4f1dc86c /ppapi/c | |
parent | 43e497fd5191b24542d9a0a5ac8760a572279f4f (diff) | |
download | chromium_src-772a746250daaef9e464673d8a13359ed5f34ef3.zip chromium_src-772a746250daaef9e464673d8a13359ed5f34ef3.tar.gz chromium_src-772a746250daaef9e464673d8a13359ed5f34ef3.tar.bz2 |
This returns the default print settings for the default printer. Currently this just returns some generic values until it is hooked up to the chrome printing code.
BUG=
TEST=
Review URL: https://chromiumcodereview.appspot.com/10544085
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@142232 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/c')
-rw-r--r-- | ppapi/c/dev/pp_print_settings_dev.h | 76 | ||||
-rw-r--r-- | ppapi/c/dev/ppb_printing_dev.h | 49 | ||||
-rw-r--r-- | ppapi/c/dev/ppp_printing_dev.h | 49 |
3 files changed, 128 insertions, 46 deletions
diff --git a/ppapi/c/dev/pp_print_settings_dev.h b/ppapi/c/dev/pp_print_settings_dev.h new file mode 100644 index 0000000..93e21d4 --- /dev/null +++ b/ppapi/c/dev/pp_print_settings_dev.h @@ -0,0 +1,76 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/* From dev/pp_print_settings_dev.idl modified Wed Jun 13 09:14:31 2012. */ + +#ifndef PPAPI_C_DEV_PP_PRINT_SETTINGS_DEV_H_ +#define PPAPI_C_DEV_PP_PRINT_SETTINGS_DEV_H_ + +#include "ppapi/c/pp_bool.h" +#include "ppapi/c/pp_macros.h" +#include "ppapi/c/pp_point.h" +#include "ppapi/c/pp_rect.h" +#include "ppapi/c/pp_size.h" +#include "ppapi/c/pp_stdint.h" + +/** + * @file + * This file defines the struct for PrintSettings. + */ + + +/** + * @addtogroup Enums + * @{ + */ +typedef enum { + PP_PRINTORIENTATION_NORMAL = 0, + PP_PRINTORIENTATION_ROTATED_90_CW = 1, + PP_PRINTORIENTATION_ROTATED_180 = 2, + PP_PRINTORIENTATION_ROTATED_90_CCW = 3 +} PP_PrintOrientation_Dev; +PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_PrintOrientation_Dev, 4); + +typedef enum { + PP_PRINTOUTPUTFORMAT_RASTER = 1u << 0, + PP_PRINTOUTPUTFORMAT_PDF = 1u << 1, + PP_PRINTOUTPUTFORMAT_POSTSCRIPT = 1u << 2, + PP_PRINTOUTPUTFORMAT_EMF = 1u << 3 +} PP_PrintOutputFormat_Dev; +PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_PrintOutputFormat_Dev, 4); + +typedef enum { + PP_PRINTSCALINGOPTION_NONE = 0, + PP_PRINTSCALINGOPTION_FIT_TO_PRINTABLE_AREA = 1, + PP_PRINTSCALINGOPTION_SOURCE_SIZE = 2 +} PP_PrintScalingOption_Dev; +PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_PrintScalingOption_Dev, 4); +/** + * @} + */ + +/** + * @addtogroup Structs + * @{ + */ +struct PP_PrintSettings_Dev { + /** This is the size of the printable area in points (1/72 of an inch). */ + struct PP_Rect printable_area; + struct PP_Rect content_area; + struct PP_Size paper_size; + int32_t dpi; + PP_PrintOrientation_Dev orientation; + PP_PrintScalingOption_Dev print_scaling_option; + PP_Bool grayscale; + /** Note that Chrome currently only supports PDF printing. */ + PP_PrintOutputFormat_Dev format; +}; +PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_PrintSettings_Dev, 60); +/** + * @} + */ + +#endif /* PPAPI_C_DEV_PP_PRINT_SETTINGS_DEV_H_ */ + diff --git a/ppapi/c/dev/ppb_printing_dev.h b/ppapi/c/dev/ppb_printing_dev.h new file mode 100644 index 0000000..97a59fa --- /dev/null +++ b/ppapi/c/dev/ppb_printing_dev.h @@ -0,0 +1,49 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/* From dev/ppb_printing_dev.idl modified Wed Jun 13 09:16:33 2012. */ + +#ifndef PPAPI_C_DEV_PPB_PRINTING_DEV_H_ +#define PPAPI_C_DEV_PPB_PRINTING_DEV_H_ + +#include "ppapi/c/dev/pp_print_settings_dev.h" +#include "ppapi/c/pp_bool.h" +#include "ppapi/c/pp_instance.h" +#include "ppapi/c/pp_macros.h" +#include "ppapi/c/pp_point.h" +#include "ppapi/c/pp_rect.h" +#include "ppapi/c/pp_size.h" +#include "ppapi/c/pp_stdint.h" + +#define PPB_PRINTING_DEV_INTERFACE_0_6 "PPB_Printing(Dev);0.6" +#define PPB_PRINTING_DEV_INTERFACE PPB_PRINTING_DEV_INTERFACE_0_6 + +/** + * @file + * Definition of the PPB_Printing interface. + */ + + +/** + * @addtogroup Interfaces + * @{ + */ +struct PPB_Printing_Dev_0_6 { + /** + * Outputs the default print settings for the default printer into + * <code>print_settings</code>. Returns <code>PP_FALSE</code> on error. + */ + PP_Bool (*GetDefaultPrintSettings)( + PP_Instance instance, + struct PP_PrintSettings_Dev* print_settings); +}; + +typedef struct PPB_Printing_Dev_0_6 PPB_Printing_Dev; +/** + * @} + */ + +#endif /* PPAPI_C_DEV_PPB_PRINTING_DEV_H_ */ + diff --git a/ppapi/c/dev/ppp_printing_dev.h b/ppapi/c/dev/ppp_printing_dev.h index 5da2df8..94d8ac7 100644 --- a/ppapi/c/dev/ppp_printing_dev.h +++ b/ppapi/c/dev/ppp_printing_dev.h @@ -3,11 +3,12 @@ * found in the LICENSE file. */ -/* From dev/ppp_printing_dev.idl modified Tue May 15 15:17:01 2012. */ +/* From dev/ppp_printing_dev.idl modified Wed Jun 13 09:20:40 2012. */ #ifndef PPAPI_C_DEV_PPP_PRINTING_DEV_H_ #define PPAPI_C_DEV_PPP_PRINTING_DEV_H_ +#include "ppapi/c/dev/pp_print_settings_dev.h" #include "ppapi/c/pp_bool.h" #include "ppapi/c/pp_instance.h" #include "ppapi/c/pp_macros.h" @@ -22,58 +23,14 @@ /** * @file - * Implementation of the Printing interface. + * Definition of the PPP_Printing interface. */ /** - * @addtogroup Enums - * @{ - */ -typedef enum { - PP_PRINTORIENTATION_NORMAL = 0, - PP_PRINTORIENTATION_ROTATED_90_CW = 1, - PP_PRINTORIENTATION_ROTATED_180 = 2, - PP_PRINTORIENTATION_ROTATED_90_CCW = 3 -} PP_PrintOrientation_Dev; -PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_PrintOrientation_Dev, 4); - -typedef enum { - PP_PRINTOUTPUTFORMAT_RASTER = 1u << 0, - PP_PRINTOUTPUTFORMAT_PDF = 1u << 1, - PP_PRINTOUTPUTFORMAT_POSTSCRIPT = 1u << 2, - PP_PRINTOUTPUTFORMAT_EMF = 1u << 3 -} PP_PrintOutputFormat_Dev; -PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_PrintOutputFormat_Dev, 4); - -typedef enum { - PP_PRINTSCALINGOPTION_NONE = 0, - PP_PRINTSCALINGOPTION_FIT_TO_PRINTABLE_AREA = 1, - PP_PRINTSCALINGOPTION_SOURCE_SIZE = 2 -} PP_PrintScalingOption_Dev; -PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_PrintScalingOption_Dev, 4); -/** - * @} - */ - -/** * @addtogroup Structs * @{ */ -struct PP_PrintSettings_Dev { - /** This is the size of the printable area in points (1/72 of an inch) */ - struct PP_Rect printable_area; - struct PP_Rect content_area; - struct PP_Size paper_size; - int32_t dpi; - PP_PrintOrientation_Dev orientation; - PP_PrintScalingOption_Dev print_scaling_option; - PP_Bool grayscale; - /** Note that Chrome currently only supports PDF printing. */ - PP_PrintOutputFormat_Dev format; -}; -PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_PrintSettings_Dev, 60); - /** * Specifies a contiguous range of page numbers to be printed. * The page numbers use a zero-based index. |