5 /* this code actually _does_ something; this way, at least all the IO routines are in one place, so
6 * I know what to replace with something sensible later :)
7 * ... ahh, to have time to make this in C++ as an actual abstract interface...
10 /* staticly cached stuff, for UI
14 IMG_BACKGROUND_800480 = 0,
15 IMG_BACKGROUND_TABMASK,
18 IMG_SELECTED_ALPHAMASK,
37 IMG_MAX, // before this point is loaded; after is generated
44 void /*SDL_Surface*/ *i;
63 unsigned char ui_setup ( void );
64 unsigned char ui_imagecache ( char *basepath );
65 unsigned char ui_pick_skin ( void ); // return >0 if skin has changed
67 void ui_render ( void );
69 void ui_loadscreen ( void ); // show screen while loading the menu
70 void ui_discoverscreen ( unsigned char clearscreen ); // screen to show while scanning for apps
71 void ui_cachescreen ( unsigned char clearscreen, char *filename ); // while caching icons, categories and preview-pics-Now-mode
72 void ui_show_hourglass ( unsigned char updaterect );
73 void ui_post_scan ( void );
74 unsigned char ui_show_info ( char *pndrun, pnd_disco_t *p );
75 void ui_aboutscreen ( char *textpath );
76 void ui_revealscreen ( void );
77 void ui_manage_categories ( void );
78 char *ui_pick_custom_category ( unsigned char include_fd );
80 /* internal functions follow
83 // show a menu, return when selection made; -1 means no selection. Enter is pick.
84 int ui_modal_single_menu ( char *argv[], unsigned int argc, char *title, char *footer );
86 // run a forked app (ie: not wait for it to return)
87 unsigned char ui_forkexec ( char *argv[] ); // argv[0] is proggy to exec; argv last entry must be NULLptr
89 // create a thread of this guy, and it'll try to load the preview pic in background and then signal the app
90 unsigned char ui_threaded_defered_preview ( pnd_disco_t *p ); // callback
91 unsigned char ui_threaded_defered_icon ( void * ); // callback
92 unsigned char ui_threaded_timer_create ( void );
93 int ui_threaded_timer ( pnd_disco_t *p ); // callback
96 void ui_process_input ( pnd_dbusnotify_handle dbh, pnd_notify_handle nh );
97 void ui_push_left ( unsigned char forcecoil );
98 void ui_push_right ( unsigned char forcecoil );
99 void ui_push_up ( void );
100 void ui_push_down ( void );
101 void ui_push_exec ( void );
102 void ui_push_backup ( void );
103 void ui_push_ltrigger ( void );
104 void ui_push_rtrigger ( void );
105 unsigned char ui_determine_row ( mm_appref_t *a );
106 unsigned char ui_determine_screen_row ( mm_appref_t *a );
107 unsigned char ui_determine_screen_col ( mm_appref_t *a );
109 // detail panel hide/show
110 unsigned char ui_is_detail_hideable ( void ); // returns true if detail pane may be hidden with current skin
111 void ui_toggle_detail_pane ( void ); // toggle it on/off
113 // ui_render() can register tappable-areas which touchscreen code can then figure out if we made a hit
114 void ui_register_reset ( void );
115 void ui_register_tab ( unsigned char catnum, unsigned int x, unsigned int y, unsigned int w, unsigned int h );
116 void ui_register_app ( mm_appref_t *app, unsigned int x, unsigned int y, unsigned int w, unsigned int h );
117 void ui_touch_act ( unsigned int x, unsigned int y );
119 // deferred preview timer
120 void ui_set_selected ( mm_appref_t *r );
121 unsigned int ui_callback_f ( unsigned int t );
123 // 'popup' 'context' menu
124 void ui_menu_context ( mm_appref_t *a );
125 unsigned char ui_menu_oneby ( char *title, char *footer, char *one ); // return 0 (nada) or 1 (one) for they actually picked it
126 unsigned char ui_menu_twoby ( char *title, char *footer, char *one, char *two ); // return 0 (nada), 1 (one), 2 (two)
127 unsigned char ui_menu_get_text_line ( char *title, char *footer, char *initialvalue,
128 char *r_buffer, unsigned char maxlen, unsigned char numbersonlyp ); // populates r_buffer
131 unsigned char ovr_replace_or_add ( mm_appref_t *a, char *keybase, char *newvalue ); // keybase does not include app#