app_window.h 4.05 KB
#ifndef _APP_WINDOW_H_
#define _APP_WINDOW_H_

//#include "app_sdram.h"
#include "app_nav.h"
#include "LCDdevice.h"
#if 1//simple window

#define MAX_WINDOW_DEEPTH       6

#define MAX_CDDA_LIST_ENTRY     100

#define MAX_FOLDER_DEPTH        32

#define RTC_FLASH_CONT          20

//#define RTC_VIEW_DISP_COUNT     5
#define RTC_VIEW_DISP_COUNT     10

#define DELETE_FLASH_COUNT      21


enum {
	ITEM_NORMAL,
	ITEM_SEPERATE,
	ITEM_ENTRY,
	ITEM_FOLDER,
	ITEM_ARTIST,
	ITEM_TITLE,
	ITEM_ALBUM,
	ITEM_GENRE,
	ITEM_PLAYLIST_ENTRY
};

enum {
	ITEM_NOT_SELECTED,
	ITEM_PART_SELECTED,
	ITEM_ALL_SEELECT
};

typedef struct {
	U16	index;					//index to string menu or to disc info
	U8	attribute;
	U8	status;
} WINDOW_LIST;

typedef struct {
	I16	start_line;
	I16	end_line;
	I16 start_pos;
	I16 end_pos;
} REGION;

#define MAX_WINDOW_DEEPTH       6

/*
typedef struct {	
	void (*draw_region) (void);					//func to draw region
	APP_NAV_KEY	*window_key;					//window key handler
	U32	 window_key_number;						//window key number
	U32	 window_time;							//window time
	void (*time) (void);						//window time fuction
} WINDOW;
*/
typedef struct {
	REGION region;								//window region

	unsigned char const *title;					//window title name
	void (*draw_title) (void);					//func to draw title
	
	WINDOW_LIST	*list;							//list	
	I16 list_entry;								//total list items. if 0, pease refer dynamic list	
	
	void (*draw_region) (void);					//func to draw region
	APP_NAV_KEY	*window_key;					//window key handler
	U32	 window_key_number;						//window key number	U32	 window_time;							//window time
	U32	 window_time;							//window time
	void (*time) (void);						//window time fuction
} WINDOW;

typedef struct {
	WINDOW *window;								//please note, it may be const, so save sram space
	I16 list_index;								//first showing list entry
	I16 list_cursor;							//cursor pos

	u8	win_state;								//state for this window
	u16 win_cn;									//cn for this window	
} APP_WINDOW;


typedef struct {	
	APP_WINDOW app_window[MAX_WINDOW_DEEPTH];
	I16 window_index;
} APP_WINDOW_DATA;


#define WINDOW_RESERVES {0,MAX_LCD_LINE,0,MAX_LCD_POS},\
                         NULL,\
                         NULL,\
                         NULL,\
                         0\

#define KEY_TABLE(x)     x, (sizeof(x)/sizeof(x[0]))

#else
#define MAX_WINDOW_DEEPTH       6

#define MAX_CDDA_LIST_ENTRY     100

#define MAX_FOLDER_DEPTH        32

#define RTC_FLASH_CONT          20

//#define RTC_VIEW_DISP_COUNT     5
#define RTC_VIEW_DISP_COUNT     10

#define DELETE_FLASH_COUNT      21


enum {
	ITEM_NORMAL,
	ITEM_SEPERATE,
	ITEM_ENTRY,
	ITEM_FOLDER,
	ITEM_ARTIST,
	ITEM_TITLE,
	ITEM_ALBUM,
	ITEM_GENRE,
	ITEM_PLAYLIST_ENTRY
};

enum {
	ITEM_NOT_SELECTED,
	ITEM_PART_SELECTED,
	ITEM_ALL_SEELECT
};

typedef struct {
	U16	index;					//index to string menu or to disc info
	U8	attribute;
	U8	status;
} WINDOW_LIST;

typedef struct {
	I16	start_line;
	I16	end_line;
	I16 start_pos;
	I16 end_pos;
} REGION;

typedef struct {
	REGION region;								//window region

	unsigned char const *title;					//window title name
	void (*draw_title) (void);					//func to draw title
	
	WINDOW_LIST	*list;							//list	
	I16 list_entry;								//total list items. if 0, pease refer dynamic list	
	
	void (*draw_region) (void);					//func to draw region
	APP_NAV_KEY	*window_key;					//window key handler
	U32	 window_time;							//window time
	void (*time) (void);						//window time fuction
} WINDOW;

typedef struct {
	WINDOW *window;								//please note, it may be const, so save sram space
	I16 list_index;								//first showing list entry
	I16 list_cursor;							//cursor pos

	u8	win_state;								//state for this window
	u16 win_cn;									//cn for this window	
} APP_WINDOW;

typedef struct {
	U16	node;									
	I16 index;									
	I16 cursor;
} DYNAMIC_NODE;

typedef struct {	
	APP_WINDOW app_window[MAX_WINDOW_DEEPTH];
	I16 window_index;
	DYNAMIC_NODE dynamic_node [MAX_FOLDER_DEPTH];
	U8	dynamic_node_index;
} APP_WINDOW_DATA;
#endif

//for different application, include different pin define
#include "..\ui\oem\app_window_oem.h"




#endif //_APP_WINDOW_H_