Logo Search packages:      
Sourcecode: herrie version File versions  Download package

gui_input.c File Reference

Detailed Description

Keyboard and signal input for user interface.

Definition in file gui_input.c.

#include "stdinc.h"
#include "audio_output.h"
#include "config.h"
#include "gui.h"
#include "gui_internal.h"
#include "playq.h"
#include "scrobbler.h"
#include "vfs.h"

Go to the source code of this file.


struct  gui_binding
 A simple binding from a keyboard character input to a function. More...


#define CTRL(x)   (((x) - 'A' + 1) & 0x7f)
 Add the Ctrl modifier to a character.
 The focus is on the browser.
#define GUI_FOCUS_COUNT   2
 The number of focusable windows.
#define GUI_FOCUS_PLAYQ   1
 The focus is on the playlist.
#define NUM_BINDINGS   (sizeof kbdbindings / sizeof(struct gui_binding))
 Amount of keybindings.


static void gui_input_askquit (void)
 Prompt the user with a message to confirm termination of the application.
static int gui_input_asksearch (void)
 Ask the user to enter a new search string.
char * gui_input_askstring (const char *question, const char *defstr, const char *allowed)
 Display a string input question at the bottom of the screen and return the user response.
int gui_input_askyesno (const char *question)
 Display a standard Yes/No question at the bottom of the screen and return the user response.
static void gui_input_cursong_seek_backward (void)
 Instruct the playlist to seek the current song 5 seconds backward.
static void gui_input_cursong_seek_forward (void)
 Instruct the playlist to seek the current song 5 seconds forward.
static void gui_input_cursong_seek_jump (void)
 Ask the user to specify a position to seek the current song to.
static int gui_input_getch (void)
 Fetch a character from the keyboard, already processing terminal resizes and awkward bugs.
static void gui_input_locate (void)
 Ask for a search string and filter matching files in the file browser.
void gui_input_loop (void)
 Read commands from the keyboard. Function terminates when user quits the application.
static void gui_input_quit (void)
 Properly shutdown the application by stopping playback and destroying the GUI.
static void gui_input_search (void)
 Ask the user to enter a new search string and perform the first search.
static void gui_input_searchnext (void)
 Ask the user to enter a search string when none was given and search for the next item matching the search string.
void gui_input_sigmask (void)
 Mask certain signals that are only need by the GUI. Call this function right after starting a new thread.
static void gui_input_switchfocus (void)
 Switch the focus to the next window.
static int gui_input_trimword (GString *gs)
 Find the offset to where a string should be trimmed to remove one word or special character sequence, including trailing whitespace.


static struct vfsmatchcursearch = NULL
 Indicator of the current search string.
static char * curseek = NULL
 The last seek string that has been entered.
static int gui_input_curfocus = GUI_FOCUS_BROWSER
 Window that is currently focused.
static struct gui_binding kbdbindings []
 List of keybindings available in the GUI.
static int shutting_down = 0
 Determine if we're already trying to shut down, to prevent multiple signals being handled while quitting.

Generated by  Doxygen 1.6.0   Back to index