From: Max Kellermann Date: Thu, 2 Oct 2008 13:20:18 +0000 (+0200) Subject: screen: export function screen_switch() X-Git-Tag: v0.12_alpha1~117 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=a220d744b2c2ba89c9037caae055247953b72ac9;p=ncmpc.git screen: export function screen_switch() Provide an API for switching the currently displayed screen. Rename switch_screen_mode() to screen_switch(). --- diff --git a/src/screen.c b/src/screen.c index 526f091..3cfc813 100644 --- a/src/screen.c +++ b/src/screen.c @@ -53,8 +53,8 @@ screen_is_visible(const struct screen_functions *sf) 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); @@ -104,7 +104,7 @@ screen_next_mode(mpdclient_t *c, int offset) 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 @@ -789,32 +789,32 @@ screen_cmd(mpdclient_t *c, command_t cmd) 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 1aa2ce5..e6f0ee7 100644 --- a/src/screen.h +++ b/src/screen.h @@ -82,6 +82,9 @@ void screen_idle(mpdclient_t *c); 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);