From: Max Kellermann Date: Wed, 17 Sep 2008 10:06:04 +0000 (+0200) Subject: screen: removed screen_functions.get_lw() X-Git-Tag: v0.12_alpha1~281 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=571cadb2662199084c6d317a34680f68314589bf;p=ncmpc.git screen: removed screen_functions.get_lw() 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. --- diff --git a/src/screen.c b/src/screen.c index ea21a1a..c8e151f 100644 --- a/src/screen.c +++ b/src/screen.c @@ -700,7 +700,6 @@ screen_update(mpdclient_t *c) static int random_enabled = -1; static int crossfade = -1; static int dbupdate = -1; - list_window_t *lw = NULL; if( !screen->painted ) return screen_paint(c); @@ -750,20 +749,14 @@ screen_update(mpdclient_t *c) if (mode_fn && mode_fn->paint) mode_fn->update(screen, c); - if (mode_fn && mode_fn->get_lw) - lw = mode_fn->get_lw(); - /* update progress window */ paint_progress_window(c); /* update status window */ paint_status_window(c); - /* move the cursor to the selected row in the main window */ - if (lw) - wmove(screen->main_window.w, LW_ROW(lw), 0); - else - wmove(screen->main_window.w, 0, 0); + /* move the cursor to the origin */ + wmove(screen->main_window.w, 0, 0); wnoutrefresh(screen->main_window.w); /* tell curses to update */ diff --git a/src/screen.h b/src/screen.h index 7aa72d7..3f335bf 100644 --- a/src/screen.h +++ b/src/screen.h @@ -56,7 +56,6 @@ typedef void (*screen_paint_fn_t)(struct screen *screen, mpdclient_t *c); typedef void (*screen_update_fn_t)(struct screen *screen, mpdclient_t *c); typedef int (*screen_cmd_fn_t)(struct screen *scr, mpdclient_t *c, command_t cmd); typedef const char *(*screen_title_fn_t)(char *s, size_t size); -typedef struct list_window *(*screen_get_lw_fn_t) (void); typedef struct screen_functions { screen_init_fn_t init; @@ -68,7 +67,6 @@ typedef struct screen_functions { screen_update_fn_t update; screen_cmd_fn_t cmd; screen_title_fn_t get_title; - screen_get_lw_fn_t get_lw; } screen_functions_t; void diff --git a/src/screen_file.c b/src/screen_file.c index e996aba..2640457 100644 --- a/src/screen_file.c +++ b/src/screen_file.c @@ -745,12 +745,6 @@ browse_cmd(screen_t *screen, mpdclient_t *c, command_t cmd) return list_window_cmd(lw, filelist->length, cmd); } -static list_window_t * -get_filelist_window(void) -{ - return lw; -} - const struct screen_functions screen_browse = { .init = browse_init, .exit = browse_exit, @@ -760,7 +754,6 @@ const struct screen_functions screen_browse = { .paint = browse_paint, .update = browse_update, .cmd = browse_cmd, - .get_lw = get_filelist_window, .get_title = browse_title, }; diff --git a/src/screen_help.c b/src/screen_help.c index bfefc1e..7c5134f 100644 --- a/src/screen_help.c +++ b/src/screen_help.c @@ -300,12 +300,6 @@ help_cmd(screen_t *screen, mpd_unused mpdclient_t *c, command_t cmd) return 0; } -static list_window_t * -help_lw(void) -{ - return lw; -} - const struct screen_functions screen_help = { .init = help_init, .exit = help_exit, @@ -313,6 +307,5 @@ const struct screen_functions screen_help = { .paint = help_paint, .update = help_update, .cmd = help_cmd, - .get_lw = help_lw, .get_title = help_title, }; diff --git a/src/screen_keydef.c b/src/screen_keydef.c index 1fde75d..397933a 100644 --- a/src/screen_keydef.c +++ b/src/screen_keydef.c @@ -362,12 +362,6 @@ keydef_cmd(screen_t *screen, mpd_unused mpdclient_t *c, command_t cmd) return list_window_cmd(lw, length, cmd); } -static list_window_t * -keydef_lw(void) -{ - return lw; -} - const struct screen_functions screen_keydef = { .init = keydef_init, .exit = keydef_exit, @@ -377,7 +371,6 @@ const struct screen_functions screen_keydef = { .paint = keydef_paint, .update = keydef_update, .cmd = keydef_cmd, - .get_lw = keydef_lw, .get_title = keydef_title, }; diff --git a/src/screen_lyrics.c b/src/screen_lyrics.c index 885a35a..e6e2cf0 100644 --- a/src/screen_lyrics.c +++ b/src/screen_lyrics.c @@ -370,12 +370,6 @@ lyrics_cmd(screen_t *screen, mpdclient_t *c, command_t cmd) return 0; } -static list_window_t * -lyrics_lw(void) -{ - return lw; -} - const struct screen_functions screen_lyrics = { .init = lyrics_screen_init, .exit = lyrics_exit, @@ -385,7 +379,6 @@ const struct screen_functions screen_lyrics = { .paint = lyrics_paint, .update = lyrics_update, .cmd = lyrics_cmd, - .get_lw = lyrics_lw, .get_title = lyrics_title, }; diff --git a/src/screen_play.c b/src/screen_play.c index 22d7198..6b4de78 100644 --- a/src/screen_play.c +++ b/src/screen_play.c @@ -497,12 +497,6 @@ play_cmd(screen_t *screen, mpdclient_t *c, command_t cmd) return list_window_cmd(lw, c->playlist.list->len, cmd); } -static list_window_t * -play_lw(void) -{ - return lw; -} - const struct screen_functions screen_playlist = { .init = play_init, .exit = play_exit, @@ -512,6 +506,5 @@ const struct screen_functions screen_playlist = { .paint = play_paint, .update = play_update, .cmd = play_cmd, - .get_lw = play_lw, .get_title = play_title, }; diff --git a/src/screen_search.c b/src/screen_search.c index 6590708..e199bfb 100644 --- a/src/screen_search.c +++ b/src/screen_search.c @@ -458,12 +458,6 @@ get_title(char *str, size_t size) return str; } -static list_window_t * -get_filelist_window(void) -{ - return lw; -} - static int search_cmd(screen_t *screen, mpdclient_t *c, command_t cmd) { @@ -546,7 +540,6 @@ const struct screen_functions screen_search = { .paint = paint, .update = update, .cmd = search_cmd, - .get_lw = get_filelist_window, .get_title = get_title, };