1 /* 2 * Copyright 2008-2013 Various Authors 3 * Copyright 2004-2006 Timo Hirvonen 4 * 5 * This program is free software; you can redistribute it and/or 6 * modify it under the terms of the GNU General Public License as 7 * published by the Free Software Foundation; either version 2 of the 8 * License, or (at your option) any later version. 9 * 10 * This program is distributed in the hope that it will be useful, but 11 * WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 * General Public License for more details. 14 * 15 * You should have received a copy of the GNU General Public License 16 * along with this program; if not, see <http://www.gnu.org/licenses/>. 17 */ 18 19 #ifndef CMUS_UI_CURSES_H 20 #define CMUS_UI_CURSES_H 21 22 #include "search.h" 23 #include "compiler.h" 24 #include "format_print.h" 25 26 enum ui_input_mode { 27 NORMAL_MODE, 28 COMMAND_MODE, 29 SEARCH_MODE 30 }; 31 32 enum ui_query_answer { 33 UI_QUERY_ANSWER_ERROR = -1, 34 UI_QUERY_ANSWER_NO = 0, 35 UI_QUERY_ANSWER_YES = 1 36 }; 37 38 #include <signal.h> 39 40 extern volatile sig_atomic_t cmus_running; 41 extern int ui_initialized; 42 extern enum ui_input_mode input_mode; 43 extern int cur_view; 44 extern int prev_view; 45 extern struct searchable *searchable; 46 47 extern char *lib_filename; 48 extern char *lib_ext_filename; 49 extern char *pl_filename; 50 extern char *play_queue_filename; 51 extern char *play_queue_ext_filename; 52 53 extern char *charset; 54 extern int using_utf8; 55 56 void update_titleline(void); 57 void update_statusline(void); 58 void update_filterline(void); 59 void update_colors(void); 60 void update_full(void); 61 void update_size(void); 62 void info_msg(const char *format, ...) CMUS_FORMAT(1, 2); 63 void error_msg(const char *format, ...) CMUS_FORMAT(1, 2); 64 enum ui_query_answer yes_no_query(const char *format, ...) CMUS_FORMAT(1, 2); 65 void search_not_found(void); 66 void set_view(int view); 67 void set_client_fd(int fd); 68 int get_client_fd(void); 69 void enter_command_mode(void); 70 void enter_search_mode(void); 71 void enter_search_backward_mode(void); 72 73 int track_format_valid(const char *format); 74 75 /* lock player_info ! */ 76 const char *get_stream_title(void); 77 const struct format_option *get_global_fopts(void); 78 79 int get_track_win_x(void); 80 81 #endif 82