Chromium 中chrome.system.display扩展接口定义c++

打印 上一主题 下一主题

主题 1785|帖子 1785|积分 5355

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?立即注册

x
一、chrome.system.display

使用 system.display API 查询展示元数据。
权限

system.display
类型

ActiveState

Chrome 117 及更高版本
用于指示系统是否检测到和使用显示屏的罗列。如果系统未检测到显示屏(大概断开连接,或因就寝模式等原因而被视为断开连接),则显示屏将被视为“非活动状态”。例如,此状态用于在所有显示屏断开连接时保留现有显示屏。
chrome.system.display  |  API  |  Chrome for Developers
二、chrome.system.display c++接口定义:

1、system_display.idl

extensions\common\api\system_display.idl
  1. // Copyright 2013 The Chromium Authors
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. // Use the <code>system.display</code> API to query display metadata.
  5. namespace system.display {
  6.   dictionary Bounds {
  7.     // The x-coordinate of the upper-left corner.
  8.     long left;
  9.     // The y-coordinate of the upper-left corner.
  10.     long top;
  11.     // The width of the display in pixels.
  12.     long width;
  13.     // The height of the display in pixels.
  14.     long height;
  15.   };
  16.   dictionary Insets {
  17.     // The x-axis distance from the left bound.
  18.     long left;
  19.     // The y-axis distance from the top bound.
  20.     long top;
  21.     // The x-axis distance from the right bound.
  22.     long right;
  23.     // The y-axis distance from the bottom bound.
  24.     long bottom;
  25.   };
  26.   dictionary Point {
  27.     // The x-coordinate of the point.
  28.     long x;
  29.     // The y-coordinate of the point.
  30.     long y;
  31.   };
  32.   dictionary TouchCalibrationPair {
  33.     // The coordinates of the display point.
  34.     Point displayPoint;
  35.     // The coordinates of the touch point corresponding to the display point.
  36.     Point touchPoint;
  37.   };
  38.   dictionary TouchCalibrationPairQuad {
  39.     // First pair of touch and display point required for touch calibration.
  40.     TouchCalibrationPair pair1;
  41.     // Second pair of touch and display point required for touch calibration.
  42.     TouchCalibrationPair pair2;
  43.     // Third pair of touch and display point required for touch calibration.
  44.     TouchCalibrationPair pair3;
  45.     // Fourth pair of touch and display point required for touch calibration.
  46.     TouchCalibrationPair pair4;
  47.   };
  48.   dictionary DisplayMode {
  49.     // The display mode width in device independent (user visible) pixels.
  50.     long width;
  51.     // The display mode height in device independent (user visible) pixels.
  52.     long height;
  53.     // The display mode width in native pixels.
  54.     long widthInNativePixels;
  55.     // The display mode height in native pixels.
  56.     long heightInNativePixels;
  57.     // The display mode UI scale factor.
  58.     [deprecated="Use $(ref: displayZoomFactor)"] double? uiScale;
  59.     // The display mode device scale factor.
  60.     double deviceScaleFactor;
  61.     // The display mode refresh rate in hertz.
  62.     double refreshRate;
  63.     // True if the mode is the display's native mode.
  64.     boolean isNative;
  65.     // True if the display mode is currently selected.
  66.     boolean isSelected;
  67.     // True if this mode is interlaced, false if not provided.
  68.     boolean? isInterlaced;
  69.   };
  70.   // Layout position, i.e. edge of parent that the display is attached to.
  71.   enum LayoutPosition { top, right, bottom, left };
  72.   dictionary DisplayLayout {
  73.     // The unique identifier of the display.
  74.     DOMString id;
  75.     // The unique identifier of the parent display. Empty if this is the root.
  76.     DOMString parentId;
  77.     // The layout position of this display relative to the parent. This will
  78.     // be ignored for the root.
  79.     LayoutPosition position;
  80.     // The offset of the display along the connected edge. 0 indicates that
  81.     // the topmost or leftmost corners are aligned.
  82.     long offset;
  83.   };
  84.   // EDID extracted parameters. Field description refers to "VESA ENHANCED
  85.   // EXTENDED DISPLAY IDENTIFICATION DATA STANDARD (Defines EDID Structure
  86.   // Version 1, Revision 4)" Release A, Revision 2 September 25, 2006.
  87.   // https://www.vesa.org/vesa-standards
  88.   dictionary Edid {
  89.     // 3 character manufacturer code. See Sec. 3.4.1 page 21. Required in v1.4.
  90.     DOMString manufacturerId;
  91.     // 2 byte manufacturer-assigned code, Sec. 3.4.2 page 21. Required in v1.4.
  92.     DOMString productId;
  93.     // Year of manufacturer, Sec. 3.4.4 page 22. Required in v1.4.
  94.     long yearOfManufacture;
  95.   };
  96.   // An enum to tell if the display is detected and used by the
  97.   // system. The display is considered 'inactive', if it is not
  98.   // detected by the system (maybe disconnected, or considered
  99.   // disconnected due to sleep mode, etc). This state is used to keep
  100.   // existing display when the all displays are disconnected, for
  101.   // example.
  102.   enum ActiveState { active, inactive };
  103.   dictionary DisplayUnitInfo {
  104.     // The unique identifier of the display.
  105.     DOMString id;
  106.     // The user-friendly name (e.g. "HP LCD monitor").
  107.     DOMString name;
  108.     // NOTE: This is only available to Chrome OS Kiosk apps and Web UI.
  109.     Edid? edid;
  110.     // Chrome OS only. Identifier of the display that is being mirrored if
  111.     // mirroring is enabled, otherwise empty. This will be set for all displays
  112.     // (including the display being mirrored).
  113.     DOMString mirroringSourceId;
  114.     // Chrome OS only. Identifiers of the displays to which the source display
  115.     // is being mirrored. Empty if no displays are being mirrored. This will be
  116.     // set to the same value for all displays. This must not include
  117.     // |mirroringSourceId|.
  118.     DOMString[] mirroringDestinationIds;
  119.     // True if this is the primary display.
  120.     boolean isPrimary;
  121.     // True if this is an internal display.
  122.     boolean isInternal;
  123.     // True if this display is enabled.
  124.     boolean isEnabled;
  125.     // Active if the display is detected and used by the system.
  126.     ActiveState activeState;
  127.     // True for all displays when in unified desktop mode. See documentation
  128.     // for $(ref:enableUnifiedDesktop).
  129.     boolean isUnified;
  130.     // True when the auto-rotation is allowed. It happens when the device is in
  131.     // a tablet physical state or kSupportsClamshellAutoRotation is set.
  132.     // Provided for ChromeOS Settings UI only. TODO(stevenjb): Remove when
  133.     // Settings switches to a mojo API.
  134.     [nodoc] boolean? isAutoRotationAllowed;
  135.     // The number of pixels per inch along the x-axis.
  136.     double dpiX;
  137.     // The number of pixels per inch along the y-axis.
  138.     double dpiY;
  139.     // The display's clockwise rotation in degrees relative to the vertical
  140.     // position.
  141.     // Currently exposed only on ChromeOS. Will be set to 0 on other platforms.
  142.     // A value of -1 will be interpreted as auto-rotate when the device is in
  143.     // a physical tablet state.
  144.     long rotation;
  145.     // The display's logical bounds.
  146.     Bounds bounds;
  147.     // The display's insets within its screen's bounds.
  148.     // Currently exposed only on ChromeOS. Will be set to empty insets on
  149.     // other platforms.
  150.     Insets overscan;
  151.     // The usable work area of the display within the display bounds. The work
  152.     // area excludes areas of the display reserved for OS, for example taskbar
  153.     // and launcher.
  154.     Bounds workArea;
  155.     // The list of available display modes. The current mode will have
  156.     // isSelected=true. Only available on Chrome OS. Will be set to an empty
  157.     // array on other platforms.
  158.     DisplayMode[] modes;
  159.     // True if this display has a touch input device associated with it.
  160.     boolean hasTouchSupport;
  161.     // True if this display has an accelerometer associated with it.
  162.     // Provided for ChromeOS Settings UI only. TODO(stevenjb): Remove when
  163.     // Settings switches to a mojo API. NOTE: The name of this may change.
  164.     [nodoc] boolean hasAccelerometerSupport;
  165.     // A list of zoom factor values that can be set for the display.
  166.     double[] availableDisplayZoomFactors;
  167.     // The ratio between the display's current and default zoom.
  168.     // For example, value 1 is equivalent to 100% zoom, and value 1.5 is
  169.     // equivalent to 150% zoom.
  170.     double displayZoomFactor;
  171.   };
  172.   dictionary DisplayProperties {
  173.     // Chrome OS only. If set to true, changes the display mode to unified
  174.     // desktop (see $(ref:enableUnifiedDesktop) for details). If set to false,
  175.     // unified desktop mode will be disabled. This is only valid for the
  176.     // primary display. If provided, mirroringSourceId must not be provided and
  177.     // other properties will be ignored. This is has no effect if not provided.
  178.     boolean? isUnified;
  179.     // Chrome OS only. If set and not empty, enables mirroring for this display
  180.     // only. Otherwise disables mirroring for all displays. This value should
  181.     // indicate the id of the source display to mirror, which must not be the
  182.     // same as the id passed to setDisplayProperties. If set, no other property
  183.     // may be set.
  184.     [deprecated="Use $(ref:setMirrorMode)."] DOMString? mirroringSourceId;
  185.     // If set to true, makes the display primary. No-op if set to false.
  186.     // Note: If set, the display is considered primary for all other properties
  187.     // (i.e. $(ref:isUnified) may be set and bounds origin may not).
  188.     boolean? isPrimary;
  189.     // If set, sets the display's overscan insets to the provided values. Note
  190.     // that overscan values may not be negative or larger than a half of the
  191.     // screen's size. Overscan cannot be changed on the internal monitor.
  192.     Insets? overscan;
  193.     // If set, updates the display's rotation.
  194.     // Legal values are [0, 90, 180, 270]. The rotation is set clockwise,
  195.     // relative to the display's vertical position.
  196.     long? rotation;
  197.     // If set, updates the display's logical bounds origin along the x-axis.
  198.     // Applied together with $(ref:boundsOriginY). Defaults to the current value
  199.     // if not set and $(ref:boundsOriginY) is set. Note that when updating the
  200.     // display origin, some constraints will be applied, so the final bounds
  201.     // origin may be different than the one set. The final bounds can be
  202.     // retrieved using $(ref:getInfo). The bounds origin cannot be changed on
  203.     // the primary display.
  204.     long? boundsOriginX;
  205.     // If set, updates the display's logical bounds origin along the y-axis.
  206.     // See documentation for $(ref:boundsOriginX) parameter.
  207.     long? boundsOriginY;
  208.     // If set, updates the display mode to the mode matching this value.
  209.     // If other parameters are invalid, this will not be applied. If the
  210.     // display mode is invalid, it will not be applied and an error will be
  211.     // set, but other properties will still be applied.
  212.     DisplayMode? displayMode;
  213.     // If set, updates the zoom associated with the display. This zoom performs
  214.     // re-layout and repaint thus resulting in a better quality zoom than just
  215.     // performing a pixel by pixel stretch enlargement.
  216.     double? displayZoomFactor;
  217.   };
  218.   dictionary GetInfoFlags {
  219.     // If set to true, only a single $(ref:DisplayUnitInfo) will be returned
  220.     // by $(ref:getInfo) when in unified desktop mode (see
  221.     // $(ref:enableUnifiedDesktop)). Defaults to false.
  222.     boolean? singleUnified;
  223.   };
  224.   // Mirror mode, i.e. different ways of how a display is mirrored to other
  225.   // displays.
  226.   enum MirrorMode {
  227.     // Specifies the default mode (extended or unified desktop).
  228.     off,
  229.     // Specifies that the default source display will be mirrored to all other
  230.     // displays.
  231.     normal,
  232.     // Specifies that the specified source display will be mirrored to the
  233.     // provided destination displays. All other connected displays will be
  234.     //  extended.
  235.     mixed
  236.   };
  237.   dictionary MirrorModeInfo {
  238.     // The mirror mode that should be set.
  239.     MirrorMode mode;
  240.     // The id of the mirroring source display. This is only valid for 'mixed'.
  241.     DOMString? mirroringSourceId;
  242.     // The ids of the mirroring destination displays. This is only valid for
  243.     // 'mixed'.
  244.     DOMString[]? mirroringDestinationIds;
  245.   };
  246.   callback DisplayInfoCallback = void (DisplayUnitInfo[] displayInfo);
  247.   callback DisplayLayoutCallback = void (DisplayLayout[] layouts);
  248.   callback SetDisplayUnitInfoCallback = void();
  249.   callback SetDisplayLayoutCallback = void();
  250.   callback NativeTouchCalibrationCallback = void(boolean success);
  251.   callback SetMirrorModeCallback = void();
  252.   interface Functions {
  253.     // Requests the information for all attached display devices.
  254.     // |flags|: Options affecting how the information is returned.
  255.     // |callback|: The callback to invoke with the results.
  256.     [supportsPromises] static void getInfo(optional GetInfoFlags flags,
  257.                                            DisplayInfoCallback callback);
  258.     // Requests the layout info for all displays.
  259.     // NOTE: This is only available to Chrome OS Kiosk apps and Web UI.
  260.     // |callback|: The callback to invoke with the results.
  261.     [supportsPromises] static void getDisplayLayout(
  262.         DisplayLayoutCallback callback);
  263.     // Updates the properties for the display specified by |id|, according to
  264.     // the information provided in |info|. On failure, $(ref:runtime.lastError)
  265.     // will be set.
  266.     // NOTE: This is only available to Chrome OS Kiosk apps and Web UI.
  267.     // |id|: The display's unique identifier.
  268.     // |info|: The information about display properties that should be changed.
  269.     //     A property will be changed only if a new value for it is specified in
  270.     //     |info|.
  271.     // |callback|: Empty function called when the function finishes. To find out
  272.     //     whether the function succeeded, $(ref:runtime.lastError) should be
  273.     //     queried.
  274.     [supportsPromises] static void setDisplayProperties(
  275.         DOMString id,
  276.         DisplayProperties info,
  277.         optional SetDisplayUnitInfoCallback callback);
  278.     // Set the layout for all displays. Any display not included will use the
  279.     // default layout. If a layout would overlap or be otherwise invalid it
  280.     // will be adjusted to a valid layout. After layout is resolved, an
  281.     // onDisplayChanged event will be triggered.
  282.     // NOTE: This is only available to Chrome OS Kiosk apps and Web UI.
  283.     // |layouts|: The layout information, required for all displays except
  284.     //     the primary display.
  285.     // |callback|: Empty function called when the function finishes. To find out
  286.     //     whether the function succeeded, $(ref:runtime.lastError) should be
  287.     //     queried.
  288.     [supportsPromises] static void setDisplayLayout(
  289.         DisplayLayout[] layouts,
  290.         optional SetDisplayLayoutCallback callback);
  291.     // Enables/disables the unified desktop feature. If enabled while mirroring
  292.     // is active, the desktop mode will not change until mirroring is turned
  293.     // off. Otherwise, the desktop mode will switch to unified immediately.
  294.     // NOTE: This is only available to Chrome OS Kiosk apps and Web UI.
  295.     // |enabled|: True if unified desktop should be enabled.
  296.     static void enableUnifiedDesktop(boolean enabled);
  297.     // Starts overscan calibration for a display. This will show an overlay
  298.     // on the screen indicating the current overscan insets. If overscan
  299.     // calibration for display |id| is in progress this will reset calibration.
  300.     // |id|: The display's unique identifier.
  301.     static void overscanCalibrationStart(DOMString id);
  302.     // Adjusts the current overscan insets for a display. Typically this should
  303.     // either move the display along an axis (e.g. left+right have the same
  304.     // value) or scale it along an axis (e.g. top+bottom have opposite values).
  305.     // Each Adjust call is cumulative with previous calls since Start.
  306.     // |id|: The display's unique identifier.
  307.     // |delta|: The amount to change the overscan insets.
  308.     static void overscanCalibrationAdjust(DOMString id, Insets delta);
  309.     // Resets the overscan insets for a display to the last saved value (i.e
  310.     // before Start was called).
  311.     // |id|: The display's unique identifier.
  312.     static void overscanCalibrationReset(DOMString id);
  313.     // Complete overscan adjustments for a display  by saving the current values
  314.     // and hiding the overlay.
  315.     // |id|: The display's unique identifier.
  316.     static void overscanCalibrationComplete(DOMString id);
  317.     // Displays the native touch calibration UX for the display with |id| as
  318.     // display id. This will show an overlay on the screen with required
  319.     // instructions on how to proceed. The callback will be invoked in case of
  320.     // successful calibration only. If the calibration fails, this will throw an
  321.     // error.
  322.     // |id|: The display's unique identifier.
  323.     // |callback|: Optional callback to inform the caller that the touch
  324.     //      calibration has ended. The argument of the callback informs if the
  325.     //      calibration was a success or not.
  326.     [supportsPromises] static void showNativeTouchCalibration(
  327.         DOMString id,
  328.         optional NativeTouchCalibrationCallback callback);
  329.     // Starts custom touch calibration for a display. This should be called when
  330.     // using a custom UX for collecting calibration data. If another touch
  331.     // calibration is already in progress this will throw an error.
  332.     // |id|: The display's unique identifier.
  333.     static void startCustomTouchCalibration(DOMString id);
  334.     // Sets the touch calibration pairs for a display. These |pairs| would be
  335.     // used to calibrate the touch screen for display with |id| called in
  336.     // startCustomTouchCalibration(). Always call |startCustomTouchCalibration|
  337.     // before calling this method. If another touch calibration is already in
  338.     // progress this will throw an error.
  339.     // |pairs|: The pairs of point used to calibrate the display.
  340.     // |bounds|: Bounds of the display when the touch calibration was performed.
  341.     //     |bounds.left| and |bounds.top| values are ignored.
  342.     static void completeCustomTouchCalibration(TouchCalibrationPairQuad pairs,
  343.                                                Bounds bounds);
  344.     // Resets the touch calibration for the display and brings it back to its
  345.     // default state by clearing any touch calibration data associated with the
  346.     // display.
  347.     // |id|: The display's unique identifier.
  348.     static void clearTouchCalibration(DOMString id);
  349.     // Sets the display mode to the specified mirror mode. Each call resets the
  350.     // state from previous calls. Calling setDisplayProperties() will fail for
  351.     // the mirroring destination displays.
  352.     // NOTE: This is only available to Chrome OS Kiosk apps and Web UI.
  353.     // |info|: The information of the mirror mode that should be applied to the
  354.     //     display mode.
  355.     // |callback|: Empty function called when the function finishes. To find out
  356.     //     whether the function succeeded, $(ref:runtime.lastError) should be
  357.     //     queried.
  358.     [supportsPromises] static void setMirrorMode(
  359.         MirrorModeInfo info,
  360.         optional SetMirrorModeCallback callback);
  361.   };
  362.   interface Events {
  363.     // Fired when anything changes to the display configuration.
  364.     static void onDisplayChanged();
  365.   };
  366. };
复制代码
2、system_display.idl生成c++文件:

out\Debug\gen\extensions\common\api\system_display.h
out\Debug\gen\extensions\common\api\system_display.cc
3、chrome.system.display api接口定义c++:

extensions\browser\api\system_display\system_display_api.h
extensions\browser\api\system_display\system_display_api.cc
  1. namespace extensions {
  2. class SystemDisplayFunction : public ExtensionFunction {
  3. public:
  4.   static const char kApiNotAvailableError[];
  5. protected:
  6.   ~SystemDisplayFunction() override = default;
  7.   bool PreRunValidation(std::string* error) override;
  8. };
  9. class SystemDisplayCrOSRestrictedFunction : public SystemDisplayFunction {
  10. public:
  11.   static const char kCrosOnlyError[];
  12.   static const char kKioskOnlyError[];
  13. protected:
  14.   ~SystemDisplayCrOSRestrictedFunction() override = default;
  15.   bool PreRunValidation(std::string* error) override;
  16.   // Returns true if this function should be restricted to kiosk-mode apps and
  17.   // webui. The default is true.
  18.   virtual bool ShouldRestrictToKioskAndWebUI();
  19. };
  20. // This function inherits from SystemDisplayFunction because, unlike the
  21. // rest of this API, it's available on all platforms.
  22. class SystemDisplayGetInfoFunction : public SystemDisplayFunction {
  23. public:
  24.   DECLARE_EXTENSION_FUNCTION("system.display.getInfo", SYSTEM_DISPLAY_GETINFO)
  25. protected:
  26.   ~SystemDisplayGetInfoFunction() override = default;
  27.   ResponseAction Run() override;
  28.   void Response(
  29.       std::vector<api::system_display::DisplayUnitInfo> all_displays_info);
  30. };
  31. class SystemDisplayGetDisplayLayoutFunction
  32.     : public SystemDisplayCrOSRestrictedFunction {
  33. public:
  34.   DECLARE_EXTENSION_FUNCTION("system.display.getDisplayLayout",
  35.                              SYSTEM_DISPLAY_GETDISPLAYLAYOUT)
  36. protected:
  37.   ~SystemDisplayGetDisplayLayoutFunction() override = default;
  38.   ResponseAction Run() override;
  39.   bool ShouldRestrictToKioskAndWebUI() override;
  40.   void Response(std::vector<api::system_display::DisplayLayout> display_layout);
  41. };
  42. class SystemDisplaySetDisplayPropertiesFunction
  43.     : public SystemDisplayCrOSRestrictedFunction {
  44. public:
  45.   DECLARE_EXTENSION_FUNCTION("system.display.setDisplayProperties",
  46.                              SYSTEM_DISPLAY_SETDISPLAYPROPERTIES)
  47. protected:
  48.   ~SystemDisplaySetDisplayPropertiesFunction() override = default;
  49.   ResponseAction Run() override;
  50.   void Response(std::optional<std::string> error);
  51. };
  52. class SystemDisplaySetDisplayLayoutFunction
  53.     : public SystemDisplayCrOSRestrictedFunction {
  54. public:
  55.   DECLARE_EXTENSION_FUNCTION("system.display.setDisplayLayout",
  56.                              SYSTEM_DISPLAY_SETDISPLAYLAYOUT)
  57. protected:
  58.   ~SystemDisplaySetDisplayLayoutFunction() override = default;
  59.   ResponseAction Run() override;
  60.   void Response(std::optional<std::string> error);
  61. };
  62. class SystemDisplayEnableUnifiedDesktopFunction
  63.     : public SystemDisplayCrOSRestrictedFunction {
  64. public:
  65.   DECLARE_EXTENSION_FUNCTION("system.display.enableUnifiedDesktop",
  66.                              SYSTEM_DISPLAY_ENABLEUNIFIEDDESKTOP)
  67. protected:
  68.   ~SystemDisplayEnableUnifiedDesktopFunction() override = default;
  69.   ResponseAction Run() override;
  70. };
  71. class SystemDisplayOverscanCalibrationStartFunction
  72.     : public SystemDisplayCrOSRestrictedFunction {
  73. public:
  74.   DECLARE_EXTENSION_FUNCTION("system.display.overscanCalibrationStart",
  75.                              SYSTEM_DISPLAY_OVERSCANCALIBRATIONSTART)
  76. protected:
  77.   ~SystemDisplayOverscanCalibrationStartFunction() override = default;
  78.   ResponseAction Run() override;
  79. };
  80. class SystemDisplayOverscanCalibrationAdjustFunction
  81.     : public SystemDisplayCrOSRestrictedFunction {
  82. public:
  83.   DECLARE_EXTENSION_FUNCTION("system.display.overscanCalibrationAdjust",
  84.                              SYSTEM_DISPLAY_OVERSCANCALIBRATIONADJUST)
  85. protected:
  86.   ~SystemDisplayOverscanCalibrationAdjustFunction() override = default;
  87.   ResponseAction Run() override;
  88. };
  89. class SystemDisplayOverscanCalibrationResetFunction
  90.     : public SystemDisplayCrOSRestrictedFunction {
  91. public:
  92.   DECLARE_EXTENSION_FUNCTION("system.display.overscanCalibrationReset",
  93.                              SYSTEM_DISPLAY_OVERSCANCALIBRATIONRESET)
  94. protected:
  95.   ~SystemDisplayOverscanCalibrationResetFunction() override = default;
  96.   ResponseAction Run() override;
  97. };
  98. class SystemDisplayOverscanCalibrationCompleteFunction
  99.     : public SystemDisplayCrOSRestrictedFunction {
  100. public:
  101.   DECLARE_EXTENSION_FUNCTION("system.display.overscanCalibrationComplete",
  102.                              SYSTEM_DISPLAY_OVERSCANCALIBRATIONCOMPLETE)
  103. protected:
  104.   ~SystemDisplayOverscanCalibrationCompleteFunction() override = default;
  105.   ResponseAction Run() override;
  106. };
  107. class SystemDisplayShowNativeTouchCalibrationFunction
  108.     : public SystemDisplayCrOSRestrictedFunction {
  109. public:
  110.   DECLARE_EXTENSION_FUNCTION("system.display.showNativeTouchCalibration",
  111.                              SYSTEM_DISPLAY_SHOWNATIVETOUCHCALIBRATION)
  112. protected:
  113.   ~SystemDisplayShowNativeTouchCalibrationFunction() override = default;
  114.   ResponseAction Run() override;
  115.   void OnCalibrationComplete(std::optional<std::string> error);
  116. };
  117. class SystemDisplayStartCustomTouchCalibrationFunction
  118.     : public SystemDisplayCrOSRestrictedFunction {
  119. public:
  120.   DECLARE_EXTENSION_FUNCTION("system.display.startCustomTouchCalibration",
  121.                              SYSTEM_DISPLAY_STARTCUSTOMTOUCHCALIBRATION)
  122. protected:
  123.   ~SystemDisplayStartCustomTouchCalibrationFunction() override = default;
  124.   ResponseAction Run() override;
  125. };
  126. class SystemDisplayCompleteCustomTouchCalibrationFunction
  127.     : public SystemDisplayCrOSRestrictedFunction {
  128. public:
  129.   DECLARE_EXTENSION_FUNCTION("system.display.completeCustomTouchCalibration",
  130.                              SYSTEM_DISPLAY_COMPLETECUSTOMTOUCHCALIBRATION)
  131. protected:
  132.   ~SystemDisplayCompleteCustomTouchCalibrationFunction() override = default;
  133.   ResponseAction Run() override;
  134. };
  135. class SystemDisplayClearTouchCalibrationFunction
  136.     : public SystemDisplayCrOSRestrictedFunction {
  137. public:
  138.   DECLARE_EXTENSION_FUNCTION("system.display.clearTouchCalibration",
  139.                              SYSTEM_DISPLAY_CLEARTOUCHCALIBRATION)
  140. protected:
  141.   ~SystemDisplayClearTouchCalibrationFunction() override = default;
  142.   ResponseAction Run() override;
  143. };
  144. class SystemDisplaySetMirrorModeFunction
  145.     : public SystemDisplayCrOSRestrictedFunction {
  146. public:
  147.   DECLARE_EXTENSION_FUNCTION("system.display.setMirrorMode",
  148.                              SYSTEM_DISPLAY_SETMIRRORMODE)
  149. protected:
  150.   ~SystemDisplaySetMirrorModeFunction() override = default;
  151.   ResponseAction Run() override;
  152.   void Response(std::optional<std::string> error);
  153. };
  154. }  // namespace extensions
复制代码


免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。
回复

使用道具 举报

0 个回复

倒序浏览

快速回复

您需要登录后才可以回帖 登录 or 立即注册

本版积分规则

傲渊山岳

论坛元老
这个人很懒什么都没写!
快速回复 返回顶部 返回列表