Code

screen: removed screen_functions.get_lw()
authorMax Kellermann <max@duempel.org>
Wed, 17 Sep 2008 10:06:04 +0000 (12:06 +0200)
committerMax Kellermann <max@duempel.org>
Wed, 17 Sep 2008 10:06:04 +0000 (12:06 +0200)
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.

src/screen.c
src/screen.h
src/screen_file.c
src/screen_help.c
src/screen_keydef.c
src/screen_lyrics.c
src/screen_play.c
src/screen_search.c

index ea21a1af8fae1a5679b9815126df2b60cad72e1c..c8e151fa1edb2d0ec54c533af6a9cbb42d19a6b7 100644 (file)
@@ -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 */
index 7aa72d7d296188e39f73a15f0b26460c1cc6ce34..3f335bf219893c6c021afc2d0dc6d3a03eeac9be 100644 (file)
@@ -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
index e996aba0903d3ebbc211348cd3afc6881ddde93b..264045739bad23890b10be28a90beaf8ec77c970 100644 (file)
@@ -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,
 };
 
index bfefc1e7abb3040fb06c106519f87e59ea215203..7c5134fc6040986d3ccf1b1850841572f9346a60 100644 (file)
@@ -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,
 };
index 1fde75d4540eba24d7b3071ca9507ee8e432e455..397933a14578367e58159f02c765898d8d98ce96 100644 (file)
@@ -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,
 };
 
index 885a35a766c843eac8aa3878e19f41b5b2288b49..e6e2cf0dff9598285e5887fea091407e77b9a020 100644 (file)
@@ -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,
 };
 
index 22d7198aa7e685f9e7831f3f9fbd3a92f8a3d91e..6b4de78932a2990ef78ebfa5df1e1a7243453e76 100644 (file)
@@ -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,
 };
index 659070804a44cdb57f6e346588a84324693feab2..e199bfb2b476ecd1f647f2256bf44ade991f88c3 100644 (file)
@@ -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,
 };