#ifndef _ANOD_TEXT_PAGE_ #define _ANOD_TEXT_PAGE_ #include #define INPUT(type) type #define OUTPUT(type) type* typedef uint32_t atp_counter_t; typedef int32_t atp_itemval_t; typedef const char* atp_text_t; typedef uint8_t atp_boolean_t; typedef uint8_t atp_pageopt_t; typedef uint8_t atp_color_t; typedef uint8_t atp_placement_t; typedef uint8_t atp_error_t; typedef void * atp_callerdata_t; // error type #define ATP_SUCCESS 0 #define ATP_POWER_OFF 1 #define ATP_INDEX_OUTOFRANGE 2 // color type SAME AS console #define ATP_COLOR_BLACK 0 #define ATP_COLOR_RED 1 #define ATP_COLOR_GREEN 2 #define ATP_COLOR_YELLOW 3 #define ATP_COLOR_BLUE 4 #define ATP_COLOR_MAGENTA 5 #define ATP_COLOR_CYAN 6 #define ATP_COLOR_WHITE 7 // text align #define ATP_PLACEMENT_LEFT 0 #define ATP_PLACEMENT_RIGHT 1 #define ATP_PLACEMENT_CENTER 2 // page option #define ATP_PAGE_NOOPTION 0 #define ATP_PAGE_UPDATE 1 // UPDATE THE CURSOR ROW #define ATP_PAGE_REFRESH 2 // UPDATE THE WHOLE PAGE typedef atp_error_t (*atp_lineinfo_t)( INPUT(atp_callerdata_t) some_data_provided_by_caller, INPUT(atp_counter_t) line_index_of_this_page, OUTPUT(atp_text_t) line_text_of_this_line, OUTPUT(atp_itemval_t) option_value_of_this_item, OUTPUT(atp_color_t) value_of_atp_color, OUTPUT(atp_placement_t) value_of_atp_placement ); typedef atp_pageopt_t (*atp_keyhandler_t)( INPUT(atp_callerdata_t) some_data_provided_by_caller, INPUT(atp_boolean_t) is_x_key_down, INPUT(atp_boolean_t) is_y_key_down, INPUT(atp_boolean_t) is_start_key_down, INPUT(atp_boolean_t) is_select_key_down ); extern atp_error_t atp_show( INPUT(atp_counter_t) line_count_of_this_page, INPUT(atp_lineinfo_t) line_information_provider, INPUT(atp_callerdata_t) some_data_from_caller ); extern atp_itemval_t atp_select( INPUT(atp_text_t) tips_for_this_select_page, INPUT(atp_counter_t) item_count_exclude_title_of_this_select_page, INPUT(atp_lineinfo_t) item_information_provider, INPUT(atp_keyhandler_t) extra_key_handler, INPUT(atp_callerdata_t) some_data_from_caller ); extern atp_error_t atp_tips( INPUT(atp_text_t) text_at_left_bottom, INPUT(atp_text_t) text_at_right_bottom ); #undef INPUT #undef OUTPUT #endif//_ANOD_TEXT_PAGE_