0001
0002 #ifndef _PERF_UI_BROWSER_H_
0003 #define _PERF_UI_BROWSER_H_ 1
0004
0005 #include <linux/types.h>
0006 #include <stdarg.h>
0007 #include <sys/types.h>
0008
0009 #define HE_COLORSET_TOP 50
0010 #define HE_COLORSET_MEDIUM 51
0011 #define HE_COLORSET_NORMAL 52
0012 #define HE_COLORSET_SELECTED 53
0013 #define HE_COLORSET_JUMP_ARROWS 54
0014 #define HE_COLORSET_ADDR 55
0015 #define HE_COLORSET_ROOT 56
0016
0017 struct ui_browser {
0018 u64 index, top_idx;
0019 void *top, *entries;
0020 u16 y, x, width, height, rows, columns, horiz_scroll;
0021 u8 extra_title_lines;
0022 int current_color;
0023 void *priv;
0024 const char *title;
0025 char *helpline;
0026 const char *no_samples_msg;
0027 void (*refresh_dimensions)(struct ui_browser *browser);
0028 unsigned int (*refresh)(struct ui_browser *browser);
0029 void (*write)(struct ui_browser *browser, void *entry, int row);
0030 void (*seek)(struct ui_browser *browser, off_t offset, int whence);
0031 bool (*filter)(struct ui_browser *browser, void *entry);
0032 u32 nr_entries;
0033 bool navkeypressed;
0034 bool use_navkeypressed;
0035 };
0036
0037 int ui_browser__set_color(struct ui_browser *browser, int color);
0038 void ui_browser__set_percent_color(struct ui_browser *browser,
0039 double percent, bool current);
0040 bool ui_browser__is_current_entry(struct ui_browser *browser, unsigned row);
0041 void ui_browser__refresh_dimensions(struct ui_browser *browser);
0042 void ui_browser__reset_index(struct ui_browser *browser);
0043
0044 void ui_browser__gotorc_title(struct ui_browser *browser, int y, int x);
0045 void ui_browser__gotorc(struct ui_browser *browser, int y, int x);
0046 void ui_browser__write_nstring(struct ui_browser *browser, const char *msg,
0047 unsigned int width);
0048 void ui_browser__vprintf(struct ui_browser *browser, const char *fmt, va_list args);
0049 void ui_browser__printf(struct ui_browser *browser, const char *fmt, ...);
0050 void ui_browser__write_graph(struct ui_browser *browser, int graph);
0051 void __ui_browser__line_arrow(struct ui_browser *browser, unsigned int column,
0052 u64 start, u64 end);
0053 void ui_browser__mark_fused(struct ui_browser *browser, unsigned int column,
0054 unsigned int row, int diff, bool arrow_down);
0055 void __ui_browser__show_title(struct ui_browser *browser, const char *title);
0056 void ui_browser__show_title(struct ui_browser *browser, const char *title);
0057 int ui_browser__show(struct ui_browser *browser, const char *title,
0058 const char *helpline, ...);
0059 void ui_browser__hide(struct ui_browser *browser);
0060 int ui_browser__refresh(struct ui_browser *browser);
0061 int ui_browser__run(struct ui_browser *browser, int delay_secs);
0062 void ui_browser__update_nr_entries(struct ui_browser *browser, u32 nr_entries);
0063 void ui_browser__handle_resize(struct ui_browser *browser);
0064 void __ui_browser__vline(struct ui_browser *browser, unsigned int column,
0065 u16 start, u16 end);
0066
0067 int ui_browser__warning(struct ui_browser *browser, int timeout,
0068 const char *format, ...);
0069 int ui_browser__help_window(struct ui_browser *browser, const char *text);
0070 bool ui_browser__dialog_yesno(struct ui_browser *browser, const char *text);
0071 int ui_browser__input_window(const char *title, const char *text, char *input,
0072 const char *exit_msg, int delay_sec);
0073 struct perf_env;
0074 int tui__header_window(struct perf_env *env);
0075
0076 void ui_browser__argv_seek(struct ui_browser *browser, off_t offset, int whence);
0077 unsigned int ui_browser__argv_refresh(struct ui_browser *browser);
0078
0079 void ui_browser__rb_tree_seek(struct ui_browser *browser, off_t offset, int whence);
0080 unsigned int ui_browser__rb_tree_refresh(struct ui_browser *browser);
0081
0082 void ui_browser__list_head_seek(struct ui_browser *browser, off_t offset, int whence);
0083 unsigned int ui_browser__list_head_refresh(struct ui_browser *browser);
0084
0085 void ui_browser__init(void);
0086 #endif