layout_position.h 520 B

123456789101112131415161718192021
  1. /*
  2. This file is part of Telegram Desktop,
  3. the official desktop application for the Telegram messaging service.
  4. For license and copyright information please follow this link:
  5. https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
  6. */
  7. #pragma once
  8. namespace Layout {
  9. struct Position {
  10. int row = -1;
  11. int column = -1;
  12. };
  13. [[nodiscard]] Position IndexToPosition(int index);
  14. [[nodiscard]] int PositionToIndex(int row, int column);
  15. [[nodiscard]] int PositionToIndex(const Position &position);
  16. } // namespace Layout