GED 2006 (C++)
File detail
Source code
/*
* File: global.h - Some templates and configuration
* Project: GED - bitmap editor (ICP)
* Author: Kamil Dudka, xdudka00
* Team: xdudka00, xfilak01, xhefka00, xhradi08
* Created: 2006-04-08
*/
#ifndef GLOBLAL_H
#define GLOBLAL_H
#include "framebuffer.h"
namespace GlobalH {
const char szAppName[] = "GED 2006"; ///< Application name
const BoxSize newImageSize (480, 360); ///< New Image deafault size
enum { menuBarHeight = 24 }; ///< Menu bar height
enum { minDocWndWidth = 320 }; ///< Minimum Document window width
enum { minDocWndHeight = 240 }; ///< Minimum Document window height
enum { defDocWndWidth = 480 }; ///< Default Document window width
enum { defDocWndHeight = 408 }; ///< Default Document window height
/**
* Return minimum.
* \param a First value.
* \param b Second value.
* \return Return minimum from "a" and "b".
*/
template <typename T>
inline T min (T a, T b) {
return (a<b) ? a:b;
}
/**
* Return maximum.
* \param a First value.
* \param b Second value.
* \return Return maximum from "a" and "b".
*/
template <typename T>
inline T max (T a, T b) {
return (a>b) ? a:b;
}
/**
* Swap two variables.
* \param a First variable.
* \param b Second variable.
*/
template <typename T>
inline void swap (T &a, T& b) {
T tmp = a;
a = b;
b = tmp;
}
/// Just for optimalization
template<> inline void swap<int> (int &a, int &b) {
a ^= b;
b ^= a;
a ^= b;
}
}
#endif // GLOBLAL_H