00001 /* 00002 * Copyright (c) 2006-2009 Ed Schouten <ed@80386.nl> 00003 * All rights reserved. 00004 * 00005 * Redistribution and use in source and binary forms, with or without 00006 * modification, are permitted provided that the following conditions 00007 * are met: 00008 * 1. Redistributions of source code must retain the above copyright 00009 * notice, this list of conditions and the following disclaimer. 00010 * 2. Redistributions in binary form must reproduce the above copyright 00011 * notice, this list of conditions and the following disclaimer in the 00012 * documentation and/or other materials provided with the distribution. 00013 * 00014 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 00015 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00016 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 00017 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 00018 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 00019 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 00020 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 00021 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 00022 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 00023 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 00024 * SUCH DAMAGE. 00025 */ 00031 #include CURSES_HEADER 00032 00033 struct vfsref; 00034 struct vfsmatch; 00035 00039 extern int gui_draw_colors; 00043 extern int gui_draw_ratio; 00047 void gui_draw_resize(void); 00051 void gui_draw_done(void); 00055 extern GMutex *gui_mtx; 00056 00060 static inline void 00061 gui_lock(void) 00062 { 00063 g_mutex_lock(gui_mtx); 00064 } 00065 00069 static inline void 00070 gui_unlock(void) 00071 { 00072 g_mutex_unlock(gui_mtx); 00073 } 00074 00075 /* Display size ratios */ 00079 #define GUI_SIZE_PLAYQ_HEIGHT (((LINES * gui_draw_ratio) / 100) - 1) 00080 00084 #define GUI_SIZE_BROWSER_DIRNAME_TOP (GUI_SIZE_PLAYQ_HEIGHT + 1) 00085 00088 #define GUI_SIZE_BROWSER_TOP (GUI_SIZE_BROWSER_DIRNAME_TOP + 1) 00089 00092 #define GUI_SIZE_BROWSER_HEIGHT (LINES - GUI_SIZE_BROWSER_TOP - 1) 00093 00096 #define GUI_SIZE_MSGBAR_TOP (LINES - 1) 00097 00101 #define GUI_COLOR_BAR 2 00102 00105 #define GUI_COLOR_BLOCK 3 00106 00109 #define GUI_COLOR_SELECT 4 00110 00113 #define GUI_COLOR_DESELECT 5 00114 00118 #define GUI_COLOR_MARKED 6 00119 00124 int gui_input_askyesno(const char *question); 00129 char *gui_input_askstring(const char *question, const char *defstr, 00130 int (*validator)(const char *str, char c)); 00131 00132 /* 00133 * gui_msgbar 00134 */ 00139 void gui_msgbar_init(void); 00143 void gui_msgbar_destroy(void); 00148 void gui_msgbar_resize(void); 00152 void gui_msgbar_refresh(void); 00156 void gui_msgbar_flush(void); 00163 void gui_msgbar_ask(const char *msg); 00164 00165 /* 00166 * gui_playq 00167 */ 00171 void gui_playq_init(void); 00175 void gui_playq_destroy(void); 00179 void gui_playq_resize(void); 00180 00184 void gui_playq_cursor_up(void); 00188 void gui_playq_cursor_down(void); 00192 void gui_playq_cursor_pageup(void); 00196 void gui_playq_cursor_pagedown(void); 00201 void gui_playq_cursor_head(void); 00206 void gui_playq_cursor_tail(void); 00210 void gui_playq_song_remove(void); 00215 void gui_playq_song_remove_all(void); 00220 void gui_playq_song_randomize(void); 00221 00225 void gui_playq_song_add_before(struct vfsref *ve); 00229 void gui_playq_song_add_after(struct vfsref *ve); 00233 void gui_playq_song_move_up(void); 00237 void gui_playq_song_move_down(void); 00241 void gui_playq_song_move_head(void); 00246 void gui_playq_song_move_tail(void); 00250 void gui_playq_song_select(void); 00255 int gui_playq_searchnext(const struct vfsmatch *vm); 00259 void gui_playq_setfocus(int focus); 00264 void gui_playq_fullpath(void); 00265 #ifdef BUILD_VOLUME 00266 00269 void gui_playq_volume_up(void); 00273 void gui_playq_volume_down(void); 00274 #endif /* BUILD_VOLUME */ 00275 00278 void gui_playq_gotofolder(void); 00282 void gui_browser_gotohome(void); 00287 void gui_browser_gotofile(struct vfsref *vr); 00288 00289 /* 00290 * gui_browser 00291 */ 00295 void gui_browser_init(void); 00299 void gui_browser_destroy(void); 00303 void gui_browser_resize(void); 00304 00308 void gui_browser_cursor_up(void); 00312 void gui_browser_cursor_down(void); 00317 void gui_browser_cursor_pageup(void); 00322 void gui_browser_cursor_pagedown(void); 00327 void gui_browser_cursor_head(void); 00332 void gui_browser_cursor_tail(void); 00337 void gui_browser_dir_parent(void); 00342 void gui_browser_dir_enter(void); 00346 void gui_browser_playq_add_tail(void); 00350 void gui_browser_playq_add_head(void); 00355 void gui_browser_playq_add_after(void); 00360 void gui_browser_playq_add_before(void); 00365 int gui_browser_searchnext(const struct vfsmatch *vm); 00369 void gui_browser_chdir(void); 00373 void gui_browser_setfocus(int focus); 00377 void gui_browser_write_playlist(void); 00382 void gui_browser_fullpath(void); 00386 int gui_browser_locate(const struct vfsmatch *vm); 00390 void gui_browser_gotofolder(void);
1.6.3