display_finder.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. // Copyright 2016 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. #ifndef UI_DISPLAY_DISPLAY_FINDER_H_
  5. #define UI_DISPLAY_DISPLAY_FINDER_H_
  6. #include <vector>
  7. #include "ui/display/display_export.h"
  8. namespace gfx {
  9. class Point;
  10. class Rect;
  11. }
  12. namespace display {
  13. class Display;
  14. // Returns the display containing |point|. If no displays contain |point|, then
  15. // this returns the display closest to |point|.
  16. DISPLAY_EXPORT const Display* FindDisplayNearestPoint(
  17. const std::vector<Display>& displays,
  18. const gfx::Point& point);
  19. // Returns the display in |displays| with the biggest intersection of |rect|.
  20. // If none of the displays intersect |rect| null is returned.
  21. DISPLAY_EXPORT const Display* FindDisplayWithBiggestIntersection(
  22. const std::vector<Display>& displays,
  23. const gfx::Rect& rect);
  24. // Returns an iterator into |displays| of the Display whose bounds contains
  25. // |point_in_screen|, or displays.end() if no Displays contains
  26. // |point_in_screen|.
  27. DISPLAY_EXPORT std::vector<Display>::const_iterator FindDisplayContainingPoint(
  28. const std::vector<Display>& displays,
  29. const gfx::Point& point_in_screen);
  30. } // namespace display
  31. #endif // UI_DISPLAY_DISPLAY_FINDER_H_