// Copyright (c) 2021 - 2022 kio@little-bat.de
// BSD-2-Clause license
// https://opensource.org/licenses/BSD-2-Clause

#pragma once
#include "kio/kio.h"
#include <QColor>

namespace gterm
{

#define ADD_BOOLEAN_OPERATORS(T) \
	inline T operator| (T a, uint b) { return T(uint(a) | b); } \
	inline void operator|= (T& a, uint b) { a = a | b; } \
	inline T operator^ (T a, uint b) { return T(uint(a) ^ b); } \
	inline void operator^= (T& a, uint b) { a = a ^ b; } \
	inline T operator& (T a, uint b) { return T(uint(a) & b); } \
	inline void operator&= (T& a, uint b) { a = a & b; }


enum ImageType
{
	STATIC_IMAGE,
	DYNAMIC_IMAGE,
};

enum ScalingMode
{
	SM_FIXED,		// window can't be resized
	SM_SCALING,		// scale to window size, try to keep aspect
	SM_PANNING,		// e.g. scrollbars if window smaller, center display if larger
	SM_IGNORE,		// ignore scaling, client app should handle resize notification
};


enum DisplayStyle : uint
{
	DS_OPAQUE=0,
	DS_FRAMELESS=1,		// ok: QOpenGLWindow
	DS_TRANSPARENT=2,	// ok: QWidget		nok: QGLWidget
	//DS_FADING=4,		// doesn't work for window well because of double buffers
};
ADD_BOOLEAN_OPERATORS(DisplayStyle)


enum FontStyle : uint
{
	NORMAL = 0,
	BOLD = 1,
	ITALIC = 2,
	UNDERLINE = 4,
};
ADD_BOOLEAN_OPERATORS(FontStyle)


enum TransformFlag
{
	REPLACE,
	AFTER,
	BEFORE,
};


enum KeyModifiers : uint
{
	// note: same as in Qt
	KM_NONE = 0,
	KM_SPECIAL_KEY = 1 << 24,  // -> Qt::Key instead of ucs2 char
	KM_SHIFT = 2<<24,	  // shift
	KM_CONTROL = 4<<24,	  // control (CMD@macos)
	KM_ALT = 8<<24,		  // alt
	KM_META = 0x10<<24,	  // windows (CTRL@macos)
	KM_KEYPAD = 0x20<<24,
	KM_ALTGR = 0x40<<24,
};
ADD_BOOLEAN_OPERATORS(KeyModifiers)


} // namespace



