Home | History | Annotate | Download | only in private
      1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved.
      2  * Use of this source code is governed by a BSD-style license that can be
      3  * found in the LICENSE file.
      4  */
      5 
      6 /**
      7  * This file contains the <code>PPB_Flash</code> interface.
      8  */
      9 
     10 label Chrome {
     11   M21 = 12.4,
     12   M22 = 12.5,
     13   M24_0 = 12.6,
     14   M24_1 = 13.0
     15 };
     16 
     17 [assert_size(4)]
     18 enum PP_FlashLSORestrictions {
     19   /**
     20    * No restrictions on Flash LSOs.
     21    */
     22   PP_FLASHLSORESTRICTIONS_NONE = 1,
     23 
     24   /**
     25    * Don't allow access to Flash LSOs.
     26    */
     27   PP_FLASHLSORESTRICTIONS_BLOCK = 2,
     28 
     29   /**
     30    * Store Flash LSOs in memory only.
     31    */
     32   PP_FLASHLSORESTRICTIONS_IN_MEMORY = 3
     33 };
     34 
     35 [assert_size(4)]
     36 enum PP_FlashSetting {
     37   /**
     38    * Specifies if the system likely supports 3D hardware acceleration.
     39    *
     40    * The result is a boolean PP_Var, depending on the supported nature of 3D
     41    * acceleration. If querying this function returns true, the 3D system will
     42    * normally use the native hardware for rendering which will be much faster.
     43    *
     44    * Having this set to true only means that 3D should be used to draw 2D and
     45    * video elements. PP_FLASHSETTING_STAGE3D_ENABLED should be checked to
     46    * determine if it's ok to use 3D for arbitrary content.
     47    *
     48    * In rare cases (depending on the platform) this value will be true but a
     49    * created 3D context will use emulation because context initialization
     50    * failed.
     51    */
     52   PP_FLASHSETTING_3DENABLED = 1,
     53 
     54   /**
     55    * Specifies if the given instance is in private/incognito/off-the-record mode
     56    * (returns true) or "regular" mode (returns false). Returns an undefined
     57    * PP_Var on invalid instance.
     58    */
     59   PP_FLASHSETTING_INCOGNITO = 2,
     60 
     61   /**
     62    * Specifies if arbitrary 3d commands are supported (returns true), or if 3d
     63    * should only be used for drawing 2d and video (returns false).
     64    *
     65    * This should only be enabled if PP_FLASHSETTING_3DENABLED is true.
     66    */
     67   PP_FLASHSETTING_STAGE3DENABLED = 3,
     68 
     69   /**
     70    * Specifies the string for the language code of the UI of the browser.
     71    *
     72    * For example: "en-US" or "de".
     73    *
     74    * Returns an undefined PP_Var on invalid instance.
     75    */
     76   PP_FLASHSETTING_LANGUAGE = 4,
     77 
     78   /**
     79    * Specifies the number of CPU cores that are present on the system.
     80    */
     81   PP_FLASHSETTING_NUMCORES = 5,
     82 
     83   /**
     84    * Specifies restrictions on how flash should handle LSOs. The result is an
     85    * int from <code>PP_FlashLSORestrictions</code>.
     86    */
     87   PP_FLASHSETTING_LSORESTRICTIONS = 6,
     88 
     89   /**
     90    * Specifies if the driver is reliable enough to use Shader Model 3 commands
     91    * with it.
     92    *
     93    * This should only be enabled if PP_FLASHSETTING_STAGE3DENABLED is true.
     94    */
     95   PP_FLASHSETTING_STAGE3DBASELINEENABLED = 7
     96 };
     97 
     98 /**
     99  * This enum provides keys for setting breakpad crash report data.
    100  */
    101 [assert_size(4)]
    102 enum PP_FlashCrashKey {
    103   /**
    104    * Specifies the document URL which contains the flash instance.
    105    */
    106   PP_FLASHCRASHKEY_URL = 1,
    107 
    108   /**
    109    * Specifies the URL of the current swf.
    110    */
    111   PP_FLASHCRASHKEY_RESOURCE_URL = 2
    112 };
    113 
    114 /**
    115  * The <code>PPB_Flash</code> interface contains pointers to various functions
    116  * that are only needed to support Pepper Flash.
    117  */
    118 interface PPB_Flash {
    119   /**
    120    * Sets or clears the rendering hint that the given plugin instance is always
    121    * on top of page content. Somewhat more optimized painting can be used in
    122    * this case.
    123    */
    124   void SetInstanceAlwaysOnTop(
    125       [in] PP_Instance instance,
    126       [in] PP_Bool on_top);
    127 
    128   /**
    129    * Draws the given pre-laid-out text. It is almost equivalent to Windows'
    130    * ExtTextOut with the addition of the transformation (a 3x3 matrix given the
    131    * transform to apply before drawing). It also adds the allow_subpixel_aa
    132    * flag which when true, will use subpixel antialiasing if enabled in the
    133    * system settings. For this to work properly, the graphics layer that the
    134    * text is being drawn into must be opaque.
    135    */
    136   PP_Bool DrawGlyphs(
    137       [in] PP_Instance instance,
    138       [in] PP_Resource pp_image_data,
    139       [in] PP_BrowserFont_Trusted_Description font_desc,
    140       [in] uint32_t color,
    141       [in] PP_Point position,
    142       [in] PP_Rect clip,
    143       [in] float_t[3][3] transformation,
    144       [in] PP_Bool allow_subpixel_aa,
    145       [in] uint32_t glyph_count,
    146       [in, size_is(glyph_count)] uint16_t[] glyph_indices,
    147       [in, size_is(glyph_count)] PP_Point[] glyph_advances);
    148 
    149   /**
    150    * Retrieves the proxy that will be used for the given URL. The result will
    151    * be a string in PAC format, or an undefined var on error.
    152    */
    153   PP_Var GetProxyForURL(
    154       [in] PP_Instance instance,
    155       [in] str_t url);
    156 
    157   /**
    158    * Navigate to the URL given by the given URLRequestInfo. (This supports GETs,
    159    * POSTs, and javascript: URLs.) May open a new tab if target is not "_self".
    160    */
    161   int32_t Navigate(
    162       [in] PP_Resource request_info,
    163       [in] str_t target,
    164       [in] PP_Bool from_user_action);
    165 
    166   /**
    167    * Deprecated. Does nothing. Use PPB_Flash_MessageLoop.
    168    */
    169   [deprecate=13.0]
    170   void RunMessageLoop(
    171       [in] PP_Instance instance);
    172 
    173   /**
    174    * Deprecated. Does nothing. Use PPB_Flash_MessageLoop.
    175    */
    176   [deprecate=13.0]
    177   void QuitMessageLoop(
    178       [in] PP_Instance instance);
    179 
    180   /**
    181    * Retrieves the local time zone offset from GM time for the given UTC time.
    182    */
    183   double_t GetLocalTimeZoneOffset(
    184       [in] PP_Instance instance,
    185       [in] PP_Time t);
    186 
    187   /**
    188    * Gets a (string) with "command-line" options for Flash; used to pass
    189    * run-time debugging parameters, etc.
    190    */
    191   PP_Var GetCommandLineArgs(
    192       [in] PP_Module module);
    193 
    194   /**
    195    * Loads the given font in a more privileged process on Windows. Call this if
    196    * Windows is giving errors for font calls. See
    197    * content/renderer/font_cache_dispatcher_win.cc
    198    *
    199    * The parameter is a pointer to a LOGFONTW structure.
    200    *
    201    * On non-Windows platforms, this function does nothing.
    202    */
    203   void PreloadFontWin(
    204       [in] mem_t logfontw);
    205 
    206   /**
    207    * Returns whether the given rectangle (in the plugin) is topmost, i.e., above
    208    * all other web content.
    209    */
    210   PP_Bool IsRectTopmost(
    211       [in] PP_Instance instance,
    212       [in] PP_Rect rect);
    213 
    214   /**
    215    * Deprecated. Does nothing. Use PPB_Flash_Print.
    216    */
    217   [deprecate=13.0]
    218   int32_t InvokePrinting(
    219       [in] PP_Instance instance);
    220 
    221   /**
    222    * Indicates that there's activity and, e.g., the screensaver shouldn't kick
    223    * in.
    224    */
    225   void UpdateActivity(
    226       [in] PP_Instance instance);
    227 
    228   /**
    229    * Deprecated. Does nothing.
    230    */
    231   [deprecate=13.0]
    232   PP_Var GetDeviceID([in] PP_Instance instance);
    233 
    234   /**
    235    * Deprecated. Does nothing. See GetSetting().
    236    */
    237   [deprecate=13.0]
    238   int32_t GetSettingInt([in] PP_Instance instance,
    239                         [in] PP_FlashSetting setting);
    240 
    241   /**
    242    * Returns the value associated with the given setting. Invalid enums will
    243    * result in an undefined PP_Var return value.
    244    */
    245   PP_Var GetSetting(PP_Instance instance, PP_FlashSetting setting);
    246 
    247   /**
    248    * Allows setting breakpad crash data which will be included in plugin crash
    249    * reports. Returns PP_FALSE if crash data could not be set.
    250    */
    251   [version=12.5]
    252   PP_Bool SetCrashData([in] PP_Instance instance,
    253                        [in] PP_FlashCrashKey key,
    254                        [in] PP_Var value);
    255 
    256   /**
    257    * Enumerates video capture devices. |video_capture| is a valid
    258    * PPB_VideoCapture_Dev resource. Once the operation has completed
    259    * successfully, |devices| will be set up with an array of
    260    * PPB_DeviceRef_Dev resources.
    261    *
    262    * PP_OK is returned on success and different pepper error code on failure.
    263    * The ref count of the returned |devices| has already been increased by 1 for
    264    * the caller.
    265    *
    266    * NOTE: This method is a synchronous version of |EnumerateDevices| in
    267    * PPB_VideoCapture_Dev.
    268    */
    269   [version=12.6]
    270   int32_t EnumerateVideoCaptureDevices(
    271       [in] PP_Instance instance,
    272       [in] PP_Resource video_capture,
    273       [in] PP_ArrayOutput devices);
    274 };
    275