#ifndef GFX_OLED_EXAMPLE_H
#define GFX_OLED_EXAMPLE_H

#include "stm32f1xx_hal.h"
#include "menu_interface.h"
#include "gfx_buffer.h"
#include "oled.h"

#define font_size 				10 //refer to font_tahoma_8_prop

#define displaycenter_x		(62)
#define displaycenter_y		(18)


#define control_panel_y_shift   (2)
#define control_panel_y_height  (8)
#define control_panel_y_mid     (displaycenter_y + control_panel_y_shift)
#define control_panel_y_up      (control_panel_y_mid - (control_panel_y_height/2))
#define control_panel_y_down    (control_panel_y_mid + (control_panel_y_height/2))

#define	 play_icon_x_widht		(3)
#define	 play_icon_y_size			control_panel_y_height//(8)

#define	 play_icon_x_left			(displaycenter_x - play_icon_x_widht)
#define	 play_icon_x_rigth		(displaycenter_x + play_icon_x_widht)
#define	 play_icon_y_up				(control_panel_y_up)
#define	 play_icon_y_down			(control_panel_y_down)
#define	 play_icon_y_mid			(control_panel_y_mid)


#define	 forward_backward_icon_x_shift	(18)


#define	 forward_icon_x_left	(play_icon_x_left + forward_backward_icon_x_shift)
#define	 forward_icon_x_rigth	(play_icon_x_rigth + forward_backward_icon_x_shift+3)
#define	 forward_icon_y_up		(control_panel_y_up)
#define	 forward_icon_y_down	(control_panel_y_down)
#define	 forward_icon_y_mid		(control_panel_y_mid)

#define	 backward_icon_x_left	(play_icon_x_left - forward_backward_icon_x_shift-3)
#define	 backward_icon_x_rigth (play_icon_x_rigth - forward_backward_icon_x_shift)
#define	 backward_icon_y_up		(control_panel_y_up)
#define	 backward_icon_y_down	(control_panel_y_down)
#define	 backward_icon_y_mid	(control_panel_y_mid)


#define  speed_x_shift			(39)
#define  speed_y_shift			(-3)

#define  speed_x_cursore					(displaycenter_x+speed_x_shift)
#define  speed_y_cursore					(displaycenter_y+speed_y_shift)

#define  loop_icon_x_shift	(speed_x_shift+3)
#define  loop_icon_y_shift	(-2)

#define  loop_icon_x_start				(displaycenter_x-loop_icon_x_shift-loop_icon_width)
#define  loop_icon_y_start				(displaycenter_y+loop_icon_y_shift)
#define  loop_icon_width					(11)
#define  loop_icon_height					8

#define  selected_width           (1)

typedef struct
{
  uint8_t xPos_Start;
  uint8_t yPos_Start;
  uint8_t area_Width; 
  uint8_t area_Height;
  uint8_t selected_Width;
}PresesIconTypeDef;

typedef struct
{
  GFX_LineHandleTypeDef       play_lines[2];
  GFX_TriangleHandleTypeDef   stop;
  PresesIconTypeDef           PressedArea;
}StopPlayIconTypeDef;

typedef struct
{
  GFX_LineHandleTypeDef       line;
  GFX_TriangleHandleTypeDef   trig;
  PresesIconTypeDef           PressedArea;
}ForwardBackwardIconTypeDef;

typedef struct
{  
//  GFX_ArcHandleTypeDef        arc[4];
//  GFX_LineHandleTypeDef       line[4];
//  GFX_LineHandleTypeDef       line_arrow1[2];
//  GFX_LineHandleTypeDef       line_arrow2[2];  
  uint8_t xPos_Start;
  uint8_t yPos_Start;
  uint8_t icon_Width; 
  uint8_t icon_Height;
  PresesIconTypeDef           PressedArea;
}LoopIconTypeDef;

typedef struct
{
  StopPlayIconTypeDef         StopPlay;
  ForwardBackwardIconTypeDef  Forward;
  ForwardBackwardIconTypeDef  Backward;
  LoopIconTypeDef             Loop;
}GFXIconsTypeDef;


void Example_GFX_IconInit(void);
void Example_GFX_CreateFrame(PlayerTypeDef *player);
void Example_OLED_GFX_Update(PlayerTypeDef *player);
#endif //GFX_OLED_EXAMPLE_H
