aboutsummaryrefslogtreecommitdiffstats
path: root/src/screen.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2008-10-06wreadln: convert public globals to local constantsMax Kellermann1-4/+0
Convert wrln_max_line_size and wrln_max_history_length to local constants. They have no real use outside of wreadln.c.
2008-10-06removed my_wgetch(), switch to wgetch()Max Kellermann1-2/+0
There are no special cases left for my_wgetch() to handle. We can remove it and use the original wgetch() instead.
2008-10-04screen: declare time constants as GTimeMax Kellermann1-2/+2
Variables which store integer seconds should be declared as GTime. This fixes a gcc warning.
2008-10-03screen: export the global variable "screen"Max Kellermann1-4/+4
screen_t is a singleton. We do not have to pass it around everywhere. Export the one global variable.
2008-10-03screen: don't pass mpdclient pointer to method paint()Max Kellermann1-1/+1
None of the paint() implementations acutally uses the mpdclient pointer. Remove it from the method signature.
2008-10-03screen: removed "painted" flagMax Kellermann1-9/+5
Repaint immediately instead of setting "painted=0".
2008-10-03colors: make color support optional at compile timeMax Kellermann1-0/+2
Default is colors disabled. Those who love colorful terminals have the option to enable it with --enable-colors.
2008-10-03code style, indent with tabs XIMax Kellermann1-2/+0
Follow the same code style als MPD itself.
2008-10-02charset: renamed my_strlen() to utf8_width()Max Kellermann1-7/+7
my_strlen() is a bad name for the function, since the return value is not a length, but a visible width on the screen. Rename it to utf8_width() and change its return type to "unsigned".
2008-10-02moved code to charset.cMax Kellermann1-0/+1
Move everything which deals with UTF-8 strings and character set conversion to charset.c, header charset.h.
2008-10-02moved macros from ncmpc.h to main.c and screen.cMax Kellermann1-1/+10
Moved constants which are only used in one source file. Remove several unused macros.
2008-10-02removed LIST_FORMAT, STATUS_FORMATMax Kellermann1-1/+2
Use options.list_format and options.status_format directly instead of these two macros.
2008-10-02moved i18n macros to i18n.hMax Kellermann1-0/+1
Don't make everybody include ncmpc.h just to have generic features. Move generic i18n macros to a separate header.
2008-10-02removed the debugging function D()Max Kellermann1-4/+0
gdb is for debugging. We don't need D() calls littered all over.
2008-10-02screen: export function screen_switch()Max Kellermann1-10/+10
Provide an API for switching the currently displayed screen. Rename switch_screen_mode() to screen_switch().
2008-09-25fix miscellaneous sparse warningsMax Kellermann1-1/+1
Static variables, pointers vs integers, void function returning, ...
2008-09-25screen: removed screen.modeMax Kellermann1-9/+6
Everything is now managed with a pointer to the screen_functions struct.
2008-09-25screen: pass screen_functions pointer to switch_screen_mode()Max Kellermann1-12/+20
Trying to get rid of the screen ids. A pointer to screen_functions is better for identifying a screen.
2008-09-25screen: replaced get_cur_mode_id() with screen_is_visible()Max Kellermann1-2/+3
Screen code shouldn't know anything about the screen ids (which will be eliminated completely later). Instead of comparing ids, compare the screen_functions pointer.
2008-09-25screen: moved code to screen_list.cMax Kellermann1-110/+10
Move the hard-coded screen list and everything which works with this array to screen_list.c.
2008-09-25screen: don't compile disabled sourcesMax Kellermann1-0/+2
Instead of evaluating macros from config.h in the disabled source, don't start the compiler on it at all.
2008-09-25screen: don't pass screen pointer to method update()Max Kellermann1-1/+1
play_update() is the only update() implementation left, and it does not use the screen pointer. Remove it from the method signature.
2008-09-25screen: don't pass screen pointer to method paint()Max Kellermann1-1/+1
None of the paint() implementations actually use the screen pointer - remove it from the method signature.
2008-09-22screen: moved input_timestamp to screen_play.cMax Kellermann1-2/+0
Since the input_timestamp is only used by screen_play, move it there.
2008-09-22screen: moved list_window mouse code to list_window.cMax Kellermann1-21/+1
Move the portion of screen_get_mouse_event() which handles list_window clicks to list_window.c. The code contained a NULL pointer dereference, which is now fixed.
2008-09-22screen: moved code to ncu.cMax Kellermann1-31/+2
Moved basic libncurses initialization to ncu.c and ncu.h. Keep generic code out of screen.c.
2008-09-22added option "welcome-screen-list"David Shakaryan1-1/+2
"welcome-screen-list" shows the screen list in the top row shortly after startup, and is enabled by default.
2008-09-21added optional bitrate display to status barJ. Alexander Treuman1-4/+14
If visible-bitrate is enabled, then the current bitrate will be drawn next to the song time in the status bar. By default it will not be displayed.
2008-09-21Adding crop feature in ncmpcYannick LM1-0/+3
The "crop" command deletes all songs from the playlist, except the one currently being played.
2008-09-18removed the clock screenMax Kellermann1-10/+0
Why should an audio player display a large clock?
2008-09-18screen: don't handle CMD_PLAYMax Kellermann1-0/+2
CMD_PLAY is mapped to the Enter key by default. Some screens (mis-)use it for navigation, for entering a directory. The playlist screen actually plays the file under the cursor. On all other screens, pressing Enter may be confusing, since it is more of a "confirmation" key instead of "play". We should probaby add CMD_CONFIRM later, but for now, disable the general CMD_PLAY handler in screen.c. This fixes bug 240.
2008-09-18quit with g_main_loop_quit()Max Kellermann1-2/+0
Call g_main_loop_quit() on CMD_QUIT, instead of exit() with an atexit() handler.
2008-09-18use the glib main event loopMax Kellermann1-2/+0
This big patch replaces our custom main loop with the event based glib main loop. This has several advantages: we can make all the tiny code bits in the main loop independent from each others, we can add additional file descriptors for polling (e.g. the mpdclient socket). We don't need the ncurses timeout() anymore, because glib will poll stdin for us.
2008-09-18screen: check MPD status only if connectedMax Kellermann1-38/+51
Fix several segmentation faults: when the connection to the MPD server is lost, there were NULL pointer dereferences because client->status==NULL. Check before accessing it.
2008-09-18screen: moved code to screen_client_cmd()Max Kellermann1-9/+24
Move all command handlers which need a connection to the MPD server to screen_client_cmd(). This will allow us to unify error handling later.
2008-09-17code style, indent with tabs IVMax Kellermann1-16/+15
Follow the same code style als MPD itself.
2008-09-17make several functions return voidMax Kellermann1-6/+2
2008-09-17screen: return early in switch_screen_mode() on errorMax Kellermann1-7/+7
When the selected screen does not exist, return before calling close().
2008-09-17screen: added macro NUM_SCREENSMax Kellermann1-25/+16
Since the number of screens is known at compile time, define a macro which calculates this, instead of having a sentinel element.
2008-09-17screen: close only current screen in screen_exit()Max Kellermann1-2/+3
Screens which are not active have already been closed, or have never been opened. Don't call close again on them.
2008-09-17screen: don't store "screen" as a pointerMax Kellermann1-140/+135
There can only be onle screen struct instance at a time. Declare it as a static struct, instead of a pointer to the struct. This simplifies all accesses, and avoids the dynamic allocation.
2008-09-17screen: moved code to find_configured_screen()Max Kellermann1-10/+13
2008-09-17screen: mode_fn cannot be NULL, removed checksMax Kellermann1-17/+9
At startup, mode_fn is initialized with &screen_playlist, and it will never be reset to NULL. Remove all checks.
2008-09-17screen: before calling update(), check if it is definedMax Kellermann1-1/+1
That seems to be a fn->paint was checked, then the code called fn->update(). Fix this.
2008-09-17screen: removed screen_functions.get_lw()Max Kellermann1-9/+2
If it is really important to set the curser, we should think of a better way, instead of exporting one non-generic method. For now, just set the cursor to the origin.
2008-09-17replaced get_screen_X() with static screen_functions variableMax Kellermann1-32/+40
Compile time initialization saves resources, compared to run-time initialization. Declare all screen_function structs as global variables, and remove all get functions.
2008-09-17code style, indent with tabs IIIMax Kellermann1-9/+8
Follow the same code style als MPD itself.
2008-09-16initial draw without delayMax Kellermann1-0/+2
Due to a missing refresh() call, ncmpc painted the screen after one second. Add refresh(), make ncmpc display immediately.
2008-09-16screen: added struct namesMax Kellermann1-20/+17
Let us declare struct names in addition to typedef names, so we can forward-declare them.
2008-09-16code style, indent with tabs IIMax Kellermann1-5/+3
Follow the same code style als MPD itself.