summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 51cb286)
raw | patch | inline | side by side (parent: 51cb286)
author | Max Kellermann <max@duempel.org> | |
Wed, 17 Sep 2008 10:06:04 +0000 (12:06 +0200) | ||
committer | Max 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.
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 ea21a1af8fae1a5679b9815126df2b60cad72e1c..c8e151fa1edb2d0ec54c533af6a9cbb42d19a6b7 100644 (file)
--- a/src/screen.c
+++ b/src/screen.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);
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 7aa72d7d296188e39f73a15f0b26460c1cc6ce34..3f335bf219893c6c021afc2d0dc6d3a03eeac9be 100644 (file)
--- a/src/screen.h
+++ b/src/screen.h
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;
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 e996aba0903d3ebbc211348cd3afc6881ddde93b..264045739bad23890b10be28a90beaf8ec77c970 100644 (file)
--- a/src/screen_file.c
+++ b/src/screen_file.c
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,
.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 bfefc1e7abb3040fb06c106519f87e59ea215203..7c5134fc6040986d3ccf1b1850841572f9346a60 100644 (file)
--- a/src/screen_help.c
+++ b/src/screen_help.c
return 0;
}
-static list_window_t *
-help_lw(void)
-{
- return lw;
-}
-
const struct screen_functions screen_help = {
.init = help_init,
.exit = help_exit,
.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 1fde75d4540eba24d7b3071ca9507ee8e432e455..397933a14578367e58159f02c765898d8d98ce96 100644 (file)
--- a/src/screen_keydef.c
+++ b/src/screen_keydef.c
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,
.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 885a35a766c843eac8aa3878e19f41b5b2288b49..e6e2cf0dff9598285e5887fea091407e77b9a020 100644 (file)
--- a/src/screen_lyrics.c
+++ b/src/screen_lyrics.c
return 0;
}
-static list_window_t *
-lyrics_lw(void)
-{
- return lw;
-}
-
const struct screen_functions screen_lyrics = {
.init = lyrics_screen_init,
.exit = lyrics_exit,
.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 22d7198aa7e685f9e7831f3f9fbd3a92f8a3d91e..6b4de78932a2990ef78ebfa5df1e1a7243453e76 100644 (file)
--- a/src/screen_play.c
+++ b/src/screen_play.c
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,
.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 659070804a44cdb57f6e346588a84324693feab2..e199bfb2b476ecd1f647f2256bf44ade991f88c3 100644 (file)
--- a/src/screen_search.c
+++ b/src/screen_search.c
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)
{
.paint = paint,
.update = update,
.cmd = search_cmd,
- .get_lw = get_filelist_window,
.get_title = get_title,
};