                             SFGUI code guidelines

1. INTRODUCTION

This file gives information about some code guidelines for the SFGUI project.
The main reason is to keep the code style and behaviour of the whole library as
consistent as possible.


2. COMMITS/CONTRIBUTIONS TO THE REPOSITORY

The repository uses two special branches:

	- master: Includes commits that will definitely be in the next version.
	- dev: Includes commits that are most likely accepted to be merged to the
		master branch. Might be unstable/rewritten.

When sending in patches, make sure to use "git format-patch" or give us access
to your Git repository, so that we can pull from it.

A real advantage for us is if you rebase your commits onto our latest commits
of the dev branch. This minimizes the merge effort we might have to spend when
applying your patch, and it makes sure that your changes work with our latest
changes.


3. CODE STYLE

Check the sources of SFGUI to see how code is formatted. Formatting code is
like a religion for programmers, but please stick to SFGUI's style if you're
about to contribute source code.


4. GENERAL RULES

  1. No definitions in class declarations: Do not define something within a
     class declaration. That includes methods: Even if they're short, do not
     auto-inline by defining it.

     NO:
     class Foo {
       void Bar() { ... }
     };

     YES:
     class Foo {
       void Bar();
     };

  2. Pay attention at const-correct method signatures. Getters mostly return
     const references — an exception are built-in C++ types like int, char etc.

     NO:
     sf::String GetText();

     YES:
     const sf::String& GetText() const;

  3. Use clear and full names, especially for method names.

     NO:
     void SetPos();

     YES:
     void SetPosition();

  4. Always use new-style casts. Avoid reinterpret_cast and const_cast whenever
     possible.

     NO:
     float foo = (float)4;

     YES:
     float foo = static_cast<float>( 4 );
