Changes to the style guide #4

Merged
N0ffie merged 2 commits from documentation-changes into main 2025-04-12 20:34:41 +02:00

View file

@ -18,21 +18,22 @@ This document outlines the coding standards and best practices for the CIGUI lib
- Header files: `.hpp` for C++ headers, `.h` for C-compatible headers
- Implementation files: `.cpp`
- Template implementation files: `.inl`
- File names: lowercase with underscores (e.g., `grid_layout.hpp`)
- File names: PascalCase (e.g., `GridLayout.hpp`)
#### Classes and Types
- Class names: PascalCase (e.g., `Button`, `GridLayout`)
- Type aliases/typedefs: PascalCase (e.g., `using WidgetPtr = std::shared_ptr<View>`)
- Type aliases/typedefs: lowercase (e.g., `using view_ptr = std::shared_ptr<View>`)
- Enum names: PascalCase
- Enum values: PascalCase (e.g., `enum class Alignment { TopLeft, Center, BottomRight }`)
- Enum values: PascalCase/UPPERCASE (e.g., `enum class Alignment { TopLeft, Center, BottomRight }` or `enum class Direction { LEFT, UP, RIGHT, DOWN }`)
#### Functions and Variables
- Function names: camelCase (e.g., `getPosition()`, `setVisible()`)
- API function names: camelCase (e.g., `getPosition()`, `setVisible()`)
- Internal function names: lowercase (e.g. `render_view()`, `get_visibility()`)
- Variable names: camelCase (e.g., `buttonText`, `isVisible`)
- Member variables: prefix with `m_` (e.g., `m_position`, `m_size`)
- Static variables: prefix with `s_` (e.g., `s_defaultFont`)
- Member variables: prefix with `m_` + UpperCamelCase (e.g., `m_Position`, `m_Size`)
- Static variables: prefix with `s_` + UpperCamelCase (e.g., `s_DefaultFont`)
- Constants and macros: ALL_CAPS with underscores (e.g., `MAX_WIDGETS`, `CIGUI_API`)
### Code Structure