drag_util.h 1013 B

12345678910111213141516171819202122232425262728293031323334353637
  1. // Copyright (c) 2016 GitHub, Inc.
  2. // Use of this source code is governed by the MIT license that can be
  3. // found in the LICENSE file.
  4. #ifndef ELECTRON_SHELL_BROWSER_UI_DRAG_UTIL_H_
  5. #define ELECTRON_SHELL_BROWSER_UI_DRAG_UTIL_H_
  6. #include <memory>
  7. #include <vector>
  8. #include "shell/common/api/api.mojom.h"
  9. #include "third_party/skia/include/core/SkRegion.h"
  10. #include "ui/gfx/geometry/rect.h"
  11. #include "ui/gfx/image/image.h"
  12. namespace base {
  13. class FilePath;
  14. }
  15. namespace electron {
  16. void DragFileItems(const std::vector<base::FilePath>& files,
  17. const gfx::Image& icon,
  18. gfx::NativeView view);
  19. std::vector<gfx::Rect> CalculateNonDraggableRegions(
  20. std::unique_ptr<SkRegion> draggable,
  21. int width,
  22. int height);
  23. // Convert draggable regions in raw format to SkRegion format.
  24. std::unique_ptr<SkRegion> DraggableRegionsToSkRegion(
  25. const std::vector<mojom::DraggableRegionPtr>& regions);
  26. } // namespace electron
  27. #endif // ELECTRON_SHELL_BROWSER_UI_DRAG_UTIL_H_