summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3b61108)
raw | patch | inline | side by side (parent: 3b61108)
author | Max Kellermann <max@duempel.org> | |
Thu, 2 Oct 2008 13:20:18 +0000 (15:20 +0200) | ||
committer | Max Kellermann <max@duempel.org> | |
Thu, 2 Oct 2008 13:20:18 +0000 (15:20 +0200) |
Provide an API for switching the currently displayed screen. Rename
switch_screen_mode() to screen_switch().
switch_screen_mode() to screen_switch().
src/screen.c | patch | blob | history | |
src/screen.h | patch | blob | history |
diff --git a/src/screen.c b/src/screen.c
index 526f091dd09df03aa0fa7bb42af3c35256b218da..3cfc813d9ce298061cb9f5eec3eac67fa7b07804 100644 (file)
--- a/src/screen.c
+++ b/src/screen.c
return sf == mode_fn;
}
-static void
-switch_screen_mode(const struct screen_functions *sf, mpdclient_t *c)
+void
+screen_switch(const struct screen_functions *sf, struct mpdclient *c)
{
assert(sf != NULL);
D("current mode: %d:%d next:%d\n", current, max, next);
sf = screen_lookup_name(options.screen_list[next]);
if (sf != NULL)
- switch_screen_mode(sf, c);
+ screen_switch(sf, c);
}
static void
screen_next_mode(c, 1);
break;
case CMD_SCREEN_PLAY:
- switch_screen_mode(&screen_playlist, c);
+ screen_switch(&screen_playlist, c);
break;
case CMD_SCREEN_FILE:
- switch_screen_mode(&screen_browse, c);
+ screen_switch(&screen_browse, c);
break;
case CMD_SCREEN_HELP:
- switch_screen_mode(&screen_help, c);
+ screen_switch(&screen_help, c);
break;
#ifdef ENABLE_SEARCH_SCREEN
case CMD_SCREEN_SEARCH:
- switch_screen_mode(&screen_search, c);
+ screen_switch(&screen_search, c);
break;
#endif
#ifdef ENABLE_ARTIST_SCREEN
case CMD_SCREEN_ARTIST:
- switch_screen_mode(&screen_artist, c);
+ screen_switch(&screen_artist, c);
break;
#endif
#ifdef ENABLE_KEYDEF_SCREEN
case CMD_SCREEN_KEYDEF:
- switch_screen_mode(&screen_keydef, c);
+ screen_switch(&screen_keydef, c);
break;
#endif
#ifdef ENABLE_LYRICS_SCREEN
case CMD_SCREEN_LYRICS:
- switch_screen_mode(&screen_lyrics, c);
+ screen_switch(&screen_lyrics, c);
break;
#endif
default:
diff --git a/src/screen.h b/src/screen.h
index 1aa2ce5ab793b11ad8e126dc1b28ed7246548bfb..e6f0ee7a1f1f2255fe5f75c9ef03537834490c04 100644 (file)
--- a/src/screen.h
+++ b/src/screen.h
void screen_cmd(mpdclient_t *c, command_t cmd);
gint screen_get_id(const char *name);
+void
+screen_switch(const struct screen_functions *sf, struct mpdclient *c);
+
gboolean
screen_is_visible(const struct screen_functions *sf);