from math import *

def DefFrontEndEmuMapX(resolution):
	SCREEN_W,SCREEN_H=resolution
	#print str(SCREEN_W) + "x" + str(SCREEN_H)
	## TAILLE DES MENU EMU

	SIZE_BIN_X_1 = int(floor(SCREEN_W /4))
	SIZE_BIN_Y_1 = SIZE_BIN_X_1
	SIZE_BIN_1 = (SIZE_BIN_X_1,SIZE_BIN_Y_1)

	SIZE_BIN_X_2 = int(floor(SIZE_BIN_X_1*2/3))
	SIZE_BIN_Y_2 = SIZE_BIN_X_2
	SIZE_BIN_2 = (SIZE_BIN_X_2,SIZE_BIN_Y_2)

	SIZE_BIN_X_3 = SIZE_BIN_X_2
	SIZE_BIN_Y_3 = SIZE_BIN_X_3
	SIZE_BIN_3 = (SIZE_BIN_X_3,SIZE_BIN_Y_3)

	##EMU CENTRE POSITION

	WHERE_BIN_1_X=int(floor((SCREEN_W / 2)-(SIZE_BIN_X_1/2)))
	WHERE_BIN_1_Y=int(floor((SCREEN_H / 2) - (SIZE_BIN_X_1/2)))
	WHERE_BIN_1=(WHERE_BIN_1_X,WHERE_BIN_1_Y)

	##EMU GAUCHE POSITION

	WHERE_BIN_2_X=int(floor((SCREEN_W / 4)-(SIZE_BIN_X_2/2)))
	WHERE_BIN_2_Y=int(floor(SCREEN_H / 3))
	WHERE_BIN_2=(WHERE_BIN_2_X,WHERE_BIN_2_Y)

	##EMU GAUCHE POSITION

	WHERE_BIN_3_X=int(floor((SCREEN_W * 3 / 4)-(SIZE_BIN_X_3/2)))
	WHERE_BIN_3_Y=int(floor(SCREEN_H / 3))
	WHERE_BIN_3=(WHERE_BIN_3_X,WHERE_BIN_3_Y)


	return(SIZE_BIN_1,SIZE_BIN_2,SIZE_BIN_3,WHERE_BIN_1,WHERE_BIN_2,WHERE_BIN_3)



def DefFrontEndEmuMapY(resolution):
	SCREEN_W,SCREEN_H=resolution
	#print str(SCREEN_W) + "x" + str(SCREEN_H)
	SIZE_BIN_X_1 = int(floor(SCREEN_W /4))
	SIZE_BIN_Y_1 = SIZE_BIN_X_1
	SIZE_BIN_1 = (SIZE_BIN_X_1,SIZE_BIN_Y_1)

	SIZE_BIN_X_2 = SIZE_BIN_X_1/2 
	SIZE_BIN_Y_2 = SIZE_BIN_X_2
	SIZE_BIN_2 = (SIZE_BIN_X_2,SIZE_BIN_Y_2)

	SIZE_BIN_X_3 = SIZE_BIN_X_2
	SIZE_BIN_Y_3 = SIZE_BIN_X_3
	SIZE_BIN_3 = (SIZE_BIN_X_3,SIZE_BIN_Y_3)

	##EMU CENTRE POSITION

	WHERE_BIN_1_X=int(floor((SCREEN_W / 2)-(SIZE_BIN_X_1/2)))
	WHERE_BIN_1_Y=int(floor((SCREEN_H / 2) - (SIZE_BIN_X_1/2)))
	WHERE_BIN_1=(WHERE_BIN_1_X,WHERE_BIN_1_Y)

	##EMU GAUCHE POSITION

	WHERE_BIN_2_X=WHERE_BIN_1_X+(SIZE_BIN_X_2/2)
	WHERE_BIN_2_Y=SCREEN_H/8
	WHERE_BIN_2=(WHERE_BIN_2_X,WHERE_BIN_2_Y)

	##EMU GAUCHE POSITION

	WHERE_BIN_3_X=WHERE_BIN_2_X
	WHERE_BIN_3_Y=SCREEN_H-SIZE_BIN_Y_3-SCREEN_H/8

	WHERE_BIN_3=(WHERE_BIN_3_X,WHERE_BIN_3_Y)


	return(SIZE_BIN_1,SIZE_BIN_2,SIZE_BIN_3,WHERE_BIN_1,WHERE_BIN_2,WHERE_BIN_3)


