#ifndef UI_LAYOUT_H_GUARD_
#define UI_LAYOUT_H_GUARD_

#include "raylib.h"

typedef struct UILayout
{
	char * layoutname;
	int screenWidth;
	int screenHeight;
	int textureW;
	int textureH;
	unsigned shortnamelen;

	/* Common elements */
	Rectangle statusbar;
	Rectangle line;
	Rectangle helphint;
	Rectangle helppanel;

	/* Ready screen */
	Rectangle dragndropprompt;
	Rectangle dragndropbox;
	Rectangle buttonLaunch;
	Rectangle buttonReset;

	/* Options */
	Rectangle optiongroup;
	Rectangle optionrecursive;
	Rectangle optiondhash256;
	Rectangle optionbiggerbetter;
	Rectangle optionthreshold;
	Rectangle optionresolution;
	Rectangle optionapply;
	Rectangle optionthreads;

	/* Sorting screen */
	Rectangle leftImage;
	Rectangle rightImage;
	Rectangle leftTopMeta;
	Rectangle rightTopMeta;
	Rectangle leftBottomMeta;
	Rectangle rightBottomMeta;
	Rectangle statsGroupSize;
	Rectangle statsGroupCount;
	Rectangle statsTotalDupes;
	Rectangle imagepaths;
	Rectangle buttonNext;
	Rectangle buttonDelLeft;
	Rectangle buttonDelRight;
	Rectangle buttonDelBoth;
	Rectangle buttonStopSorting;

	Rectangle compareRes;
	Rectangle compareResLeft;
	Rectangle compareResRight;
	Rectangle compareFsize;
	Rectangle compareFsizeLeft;
	Rectangle compareFsizeRight;
	Rectangle compareFtype;

	/* Processing screen */
	Rectangle progressbar;
	Rectangle progreessdesc;
	Rectangle buttonPause;
} UILayout;

const UILayout Ui720p =
{
	#define L_W 1280
	#define L_H 720
	#define L_PICW 500
	#define L_PICH 500
	#define L_PROGRESS_HEIGHT 40
	#define L_STATUS_HEIGHT 25
	#define L_HELP_CORNER 10
	#define L_HELP_W 500
	#define L_HELP_H 310

	/* Meta */
	.layoutname = "1280x720",
	.screenWidth = L_W,
	.screenHeight = L_H,
	.textureW = L_PICW,
	.textureH = L_PICH,
	.shortnamelen = 100,

	/* Common elements */
	.statusbar = { 0, L_H - L_STATUS_HEIGHT, L_W, L_STATUS_HEIGHT },
	.line = { 0, 125, L_W, 10 },
	.helphint = { L_W - 95, 50, 57, 39 },
	.helppanel = { L_HELP_CORNER, L_H - L_HELP_H - L_HELP_CORNER - L_STATUS_HEIGHT, L_HELP_W, L_HELP_H },

	/* Ready screen */
	.dragndropprompt = { 10, 140, L_W - 20, 25 },
	.dragndropbox = { 30, 170, L_W - 54, L_H - 215 },
	.buttonLaunch = { L_W - 495, 35, 180, 80 },
	.buttonReset = { L_W - 300, 35, 180, 80 },

	/* Options */
	.optiongroup = { 10, 35, 600, 85 },
	.optionrecursive = { 20, 45, 15, 15 },
	.optiondhash256 = { 20, 70, 15, 15 },
	.optionbiggerbetter = { 20, 95, 15, 15 },
	.optionthreshold = { 200, 45, 400, 25 },
	.optionresolution = { 390, 85, 150, 25 },
	.optionapply = { 545, 85, 55, 25 },
	.optionthreads = { 260, 85, 125, 25 },

	/* Sorting screen: images */
	.leftImage = { 25, 160, L_PICW, L_PICH },
	.rightImage = { L_PICW + 255, 160, L_PICW, L_PICH },
	.leftTopMeta = { 25, 135, L_PICW, 25 },
	.rightTopMeta = { L_PICW + 255, 135, L_PICW, 25 },
	.leftBottomMeta = { 25, L_PICH + 160, L_PICW, 25 },
	.rightBottomMeta = { L_PICW + 255, L_PICH + 160, L_PICW, 25 },

	/* Sorting screen: stats */
	.statsGroupSize = { 20, 30, 180, 25 },
	.statsGroupCount = { 20, 60, 180, 25 },
	.statsTotalDupes = { 20, 90, 180, 25 },
	.imagepaths = { 215, 30, 750, 85 },

	/* Sorting screen: buttons */
	.buttonNext = { L_PICW + 30, 310, 220, 50 },
	.buttonDelLeft = { L_PICW + 30, 375, 90, 50 },
	.buttonDelRight = { L_PICW + 160, 375, 90, 50 },
	.buttonDelBoth = { L_PICW + 30, 440, 220, 50 },
	.buttonStopSorting = { L_W - 300, 35, 180, 80 },

	/* Sorting screen: comparing */
	.compareRes = { L_PICW + 30, 160, 220, 20 },
	.compareResLeft = { L_PICW + 30, 160, 20, 20 },
	.compareResRight = { L_PICW + 230, 160, 20, 20 },
	.compareFsize = { L_PICW + 30, 190, 220, 20 },
	.compareFsizeLeft = { L_PICW + 30, 190, 20, 20 },
	.compareFsizeRight = { L_PICW + 230, 190, 20, 20 },
	.compareFtype = { L_PICW + 32, 220, 216, 20 },

	/* Progress */
	.progressbar = { 0, L_H - L_PROGRESS_HEIGHT - L_STATUS_HEIGHT + 1, L_W, L_PROGRESS_HEIGHT },
	.progreessdesc = { 0, L_H / 2, L_W, 50 },
	.buttonPause = { L_W / 2 - 100, 35, 200, 80 },

	#undef L_W
	#undef L_H
	#undef L_PICW
	#undef L_PICH
	#undef L_PROGRESS_HEIGHT
	#undef L_STATUS_HEIGHT
	#undef L_HELP_CORNER
	#undef L_HELP_W
	#undef L_HELP_H
};

const UILayout Ui900p =
{
	#define L_W 1600
	#define L_H 900
	#define L_PICW 663
	#define L_PICH 680
	#define L_PROGRESS_HEIGHT 40
	#define L_STATUS_HEIGHT 25
	#define L_HELP_CORNER 10
	#define L_HELP_W 500
	#define L_HELP_H 310

	/* Meta */
	.layoutname = "1600x900",
	.screenWidth = L_W,
	.screenHeight = L_H,
	.textureW = L_PICW,
	.textureH = L_PICH,
	.shortnamelen = 100,

	/* Common elements */
	.statusbar = { 0, L_H - L_STATUS_HEIGHT, L_W, L_STATUS_HEIGHT },
	.line = { 0, 125, L_W, 10 },
	.helphint = { L_W - 95, 50, 57, 39 },
	.helppanel = { L_HELP_CORNER, L_H - L_HELP_H - L_HELP_CORNER - L_STATUS_HEIGHT, L_HELP_W, L_HELP_H },

	/* Ready screen */
	.dragndropprompt = { 10, 140, L_W - 20, 25 },
	.dragndropbox = { 30, 170, L_W - 54, L_H - 215 },
	.buttonLaunch = { L_W - 495, 35, 180, 80 },
	.buttonReset = { L_W - 300, 35, 180, 80 },

	/* Options */
	.optiongroup = { 10, 35, 600, 85 },
	.optionrecursive = { 20, 45, 15, 15 },
	.optiondhash256 = { 20, 70, 15, 15 },
	.optionbiggerbetter = { 20, 95, 15, 15 },
	.optionthreshold = { 200, 45, 400, 25 },
	.optionresolution = { 390, 85, 150, 25 },
	.optionapply = { 545, 85, 55, 25 },
	.optionthreads = { 260, 85, 125, 25 },

	/* Sorting screen: images */
	.leftImage = { 25, 160, L_PICW, L_PICH },
	.rightImage = { L_PICW + 255, 160, L_PICW, L_PICH },
	.leftTopMeta = { 25, 135, L_PICW, 25 },
	.rightTopMeta = { L_PICW + 255, 135, L_PICW, 25 },
	.leftBottomMeta = { 25, L_PICH + 160, L_PICW, 25 },
	.rightBottomMeta = { L_PICW + 255, L_PICH + 160, L_PICW, 25 },

	/* Sorting screen: stats */
	.statsGroupSize = { 20, 30, 180, 25 },
	.statsGroupCount = { 20, 60, 180, 25 },
	.statsTotalDupes = { 20, 90, 180, 25 },
	.imagepaths = { 215, 30, 750, 85 },

	/* Sorting screen: buttons */
	.buttonNext = { L_PICW + 30, 310, 220, 50 },
	.buttonDelLeft = { L_PICW + 30, 375, 90, 50 },
	.buttonDelRight = { L_PICW + 160, 375, 90, 50 },
	.buttonDelBoth = { L_PICW + 30, 440, 220, 50 },
	.buttonStopSorting = { L_W - 300, 35, 180, 80 },

	/* Sorting screen: comparing */
	.compareRes = { L_PICW + 30, 160, 220, 20 },
	.compareResLeft = { L_PICW + 30, 160, 20, 20 },
	.compareResRight = { L_PICW + 230, 160, 20, 20 },
	.compareFsize = { L_PICW + 30, 190, 220, 20 },
	.compareFsizeLeft = { L_PICW + 30, 190, 20, 20 },
	.compareFsizeRight = { L_PICW + 230, 190, 20, 20 },
	.compareFtype = { L_PICW + 32, 220, 216, 20 },

	/* Progress */
	.progressbar = { 0, L_H - L_PROGRESS_HEIGHT - L_STATUS_HEIGHT + 1, L_W, L_PROGRESS_HEIGHT },
	.progreessdesc = { 0, L_H / 2, L_W, 50 },
	.buttonPause = { L_W / 2 - 100, 35, 200, 80 },

	#undef L_W
	#undef L_H
	#undef L_PICW
	#undef L_PICH
	#undef L_PROGRESS_HEIGHT
	#undef L_STATUS_HEIGHT
	#undef L_HELP_CORNER
	#undef L_HELP_W
	#undef L_HELP_H
};

const UILayout Ui1000p =
{
	#define L_W 1900
	#define L_H 1000
	#define L_PICW 808
	#define L_PICH 780
	#define L_PROGRESS_HEIGHT 40
	#define L_STATUS_HEIGHT 25
	#define L_HELP_CORNER 10
	#define L_HELP_W 500
	#define L_HELP_H 310

	/* Meta */
	.layoutname = "1900x1000",
	.screenWidth = L_W,
	.screenHeight = L_H,
	.textureW = L_PICW,
	.textureH = L_PICH,
	.shortnamelen = 100,

	/* Common elements */
	.statusbar = { 0, L_H - L_STATUS_HEIGHT, L_W, L_STATUS_HEIGHT },
	.line = { 0, 125, L_W, 10 },
	.helphint = { L_W - 95, 50, 57, 39 },
	.helppanel = { L_HELP_CORNER, L_H - L_HELP_H - L_HELP_CORNER - L_STATUS_HEIGHT, L_HELP_W, L_HELP_H },

	/* Ready screen */
	.dragndropprompt = { 10, 140, L_W - 20, 25 },
	.dragndropbox = { 30, 170, L_W - 54, L_H - 215 },
	.buttonLaunch = { L_W - 495, 35, 180, 80 },
	.buttonReset = { L_W - 300, 35, 180, 80 },

	/* Options */
	.optiongroup = { 10, 35, 600, 85 },
	.optionrecursive = { 20, 45, 15, 15 },
	.optiondhash256 = { 20, 70, 15, 15 },
	.optionbiggerbetter = { 20, 95, 15, 15 },
	.optionthreshold = { 200, 45, 400, 25 },
	.optionresolution = { 390, 85, 150, 25 },
	.optionapply = { 545, 85, 55, 25 },
	.optionthreads = { 260, 85, 125, 25 },

	/* Sorting screen: images */
	.leftImage = { 25, 160, L_PICW, L_PICH },
	.rightImage = { L_PICW + 255, 160, L_PICW, L_PICH },
	.leftTopMeta = { 25, 135, L_PICW, 25 },
	.rightTopMeta = { L_PICW + 255, 135, L_PICW, 25 },
	.leftBottomMeta = { 25, L_PICH + 160, L_PICW, 25 },
	.rightBottomMeta = { L_PICW + 255, L_PICH + 160, L_PICW, 25 },

	/* Sorting screen: stats */
	.statsGroupSize = { 20, 30, 180, 25 },
	.statsGroupCount = { 20, 60, 180, 25 },
	.statsTotalDupes = { 20, 90, 180, 25 },
	.imagepaths = { 215, 30, 750, 85 },

	/* Sorting screen: buttons */
	.buttonNext = { L_PICW + 30, 310, 220, 50 },
	.buttonDelLeft = { L_PICW + 30, 375, 90, 50 },
	.buttonDelRight = { L_PICW + 160, 375, 90, 50 },
	.buttonDelBoth = { L_PICW + 30, 440, 220, 50 },
	.buttonStopSorting = { L_W - 300, 35, 180, 80 },

	/* Sorting screen: comparing */
	.compareRes = { L_PICW + 30, 160, 220, 20 },
	.compareResLeft = { L_PICW + 30, 160, 20, 20 },
	.compareResRight = { L_PICW + 230, 160, 20, 20 },
	.compareFsize = { L_PICW + 30, 190, 220, 20 },
	.compareFsizeLeft = { L_PICW + 30, 190, 20, 20 },
	.compareFsizeRight = { L_PICW + 230, 190, 20, 20 },
	.compareFtype = { L_PICW + 32, 220, 216, 20 },

	/* Progress */
	.progressbar = { 0, L_H - L_PROGRESS_HEIGHT - L_STATUS_HEIGHT + 1, L_W, L_PROGRESS_HEIGHT },
	.progreessdesc = { 0, L_H / 2, L_W, 50 },
	.buttonPause = { L_W / 2 - 100, 35, 200, 80 },

	#undef L_W
	#undef L_H
	#undef L_PICW
	#undef L_PICH
	#undef L_PROGRESS_HEIGHT
	#undef L_STATUS_HEIGHT
	#undef L_HELP_CORNER
	#undef L_HELP_W
	#undef L_HELP_H
};

const UILayout Ui1000w =
{
	#define L_W 2500
	#define L_H 1000
	#define L_PICW 1110
	#define L_PICH 780
	#define L_PROGRESS_HEIGHT 40
	#define L_STATUS_HEIGHT 25
	#define L_HELP_CORNER 10
	#define L_HELP_W 500
	#define L_HELP_H 310

	/* Meta */
	.layoutname = "2500x1000",
	.screenWidth = L_W,
	.screenHeight = L_H,
	.textureW = L_PICW,
	.textureH = L_PICH,
	.shortnamelen = 100,

	/* Common elements */
	.statusbar = { 0, L_H - L_STATUS_HEIGHT, L_W, L_STATUS_HEIGHT },
	.line = { 0, 125, L_W, 10 },
	.helphint = { L_W - 95, 50, 57, 39 },
	.helppanel = { L_HELP_CORNER, L_H - L_HELP_H - L_HELP_CORNER - L_STATUS_HEIGHT, L_HELP_W, L_HELP_H },

	/* Ready screen */
	.dragndropprompt = { 10, 140, L_W - 20, 25 },
	.dragndropbox = { 30, 170, L_W - 54, L_H - 215 },
	.buttonLaunch = { L_W - 495, 35, 180, 80 },
	.buttonReset = { L_W - 300, 35, 180, 80 },

	/* Options */
	.optiongroup = { 10, 35, 600, 85 },
	.optionrecursive = { 20, 45, 15, 15 },
	.optiondhash256 = { 20, 70, 15, 15 },
	.optionbiggerbetter = { 20, 95, 15, 15 },
	.optionthreshold = { 200, 45, 400, 25 },
	.optionresolution = { 390, 85, 150, 25 },
	.optionapply = { 545, 85, 55, 25 },
	.optionthreads = { 260, 85, 125, 25 },

	/* Sorting screen: images */
	.leftImage = { 25, 160, L_PICW, L_PICH },
	.rightImage = { L_PICW + 255, 160, L_PICW, L_PICH },
	.leftTopMeta = { 25, 135, L_PICW, 25 },
	.rightTopMeta = { L_PICW + 255, 135, L_PICW, 25 },
	.leftBottomMeta = { 25, L_PICH + 160, L_PICW, 25 },
	.rightBottomMeta = { L_PICW + 255, L_PICH + 160, L_PICW, 25 },

	/* Sorting screen: stats */
	.statsGroupSize = { 20, 30, 180, 25 },
	.statsGroupCount = { 20, 60, 180, 25 },
	.statsTotalDupes = { 20, 90, 180, 25 },
	.imagepaths = { 215, 30, 750, 85 },

	/* Sorting screen: buttons */
	.buttonNext = { L_PICW + 30, 310, 220, 50 },
	.buttonDelLeft = { L_PICW + 30, 375, 90, 50 },
	.buttonDelRight = { L_PICW + 160, 375, 90, 50 },
	.buttonDelBoth = { L_PICW + 30, 440, 220, 50 },
	.buttonStopSorting = { L_W - 300, 35, 180, 80 },

	/* Sorting screen: comparing */
	.compareRes = { L_PICW + 30, 160, 220, 20 },
	.compareResLeft = { L_PICW + 30, 160, 20, 20 },
	.compareResRight = { L_PICW + 230, 160, 20, 20 },
	.compareFsize = { L_PICW + 30, 190, 220, 20 },
	.compareFsizeLeft = { L_PICW + 30, 190, 20, 20 },
	.compareFsizeRight = { L_PICW + 230, 190, 20, 20 },
	.compareFtype = { L_PICW + 32, 220, 216, 20 },

	/* Progress */
	.progressbar = { 0, L_H - L_PROGRESS_HEIGHT - L_STATUS_HEIGHT + 1, L_W, L_PROGRESS_HEIGHT },
	.progreessdesc = { 0, L_H / 2, L_W, 50 },
	.buttonPause = { L_W / 2 - 100, 35, 200, 80 },

	#undef L_W
	#undef L_H
	#undef L_PICW
	#undef L_PICH
	#undef L_PROGRESS_HEIGHT
	#undef L_STATUS_HEIGHT
	#undef L_HELP_CORNER
	#undef L_HELP_W
	#undef L_HELP_H
};

#define LAYOUTSDEF const UILayout AvailableLayouts[] = { Ui720p, Ui900p, Ui1000p, Ui1000w };

#endif
