#ifndef CCONTEXT_HPP
#define CCONTEXT_HPP

#include "../Controller/Exception/CLibException.hpp"
#include "../Controller/Exception/CExceptionManager.hpp"

#define BOOST_LOG_DYN_LINK 1
#include <boost/log/trivial.hpp>
#include <boost/log/utility/setup.hpp>

#include <SDL.h>
#ifdef WIN32
    #include <SDL_Image.h>
#else
    #include <SDL_image.h>
#endif
#include <SDL_ttf.h>
#include <string>

#ifdef _DEBUG
#define DEBUG_LOG(level, object, component, message) \
    BOOST_LOG_TRIVIAL(level) << "[" << object << "]" << "[" << component << "] : " << message;
#else
#define DEBUG_LOG(level, object, component, message)

#endif
#define ERROR_LOG(level, object, component, message) \
    BOOST_LOG_TRIVIAL(level) << "[" << object << "]" << "[" << component << "] : " << message;

#define LOG_FILE "CosmicEngine_%3N.log"
#define LOG_ROTATION_SIZE 1 * 1024 * 1024
#define LOG_MAX_SIZE 50 * 1024 * 1024

/**
 * @file CContext.hpp
 * @brief File of CContext, a class reprensenting a SDL context, using SDL2 lib.
 */

/**
 * @brief Class reprensenting a SDL context, using SDL2 lib.
 */
class CContext {
private:
    // Say if the screenSaver is enabled.
    static bool m_screenSaver;

public:
    CContext(void) = delete;

    static void init(unsigned int sdlFlags, unsigned int imageFlags);

    static void quit(void);
    /**
     * @brief Say if the screen saver is enabled.
     * @return bool, a boolean which say the screen saver status.
     */
    static bool isScreenSaverEnable(void);

    /**
     * @brief Set the screen saver status.
     * @param[in] newScreenSaver New value of screen saver status.
     */
    static void setScreenSaverEnable(bool newScreenSaver);

private:
    /**
     * @brief Init the logging system.
     */
    static void initLog(void);
};

#endif