LUAEditorBlockState.h 957 B

123456789101112131415161718192021222324252627282930
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #include <AzCore/base.h>
  9. #pragma once
  10. namespace LUAEditor
  11. {
  12. union QTBlockState
  13. {
  14. struct BlockState
  15. {
  16. AZ::u32 m_uninitialized : 1; //using semantic negative here. because qt by default will set our int to -1 and we need to detect that
  17. AZ::u32 m_folded : 1; //have be careful with folded, it is handled differently, syntax highlighter must preserve existing value of it.
  18. AZ::u32 m_foldLevel : 14;
  19. AZ::u32 m_syntaxHighlighterState : 3;
  20. AZ::u32 m_syntaxHighlighterStateExtra : 13;
  21. };
  22. BlockState m_blockState;
  23. int m_qtBlockState;
  24. };
  25. static_assert(sizeof(QTBlockState) == sizeof(int), "QT stores block state in an int");
  26. }