ncmpc-debian.git
2 years agoscreen_artist: split into three Page implementations
Max Kellermann [Mon, 26 Feb 2018 22:02:25 +0000 (23:02 +0100)]
screen_artist: split into three Page implementations

2 years agoProxyPage: new Page implementation
Max Kellermann [Sun, 25 Feb 2018 18:39:39 +0000 (19:39 +0100)]
ProxyPage: new Page implementation

2 years agoscreen_file: remove redundant code from OnOpen()
Max Kellermann [Wed, 14 Mar 2018 19:40:21 +0000 (20:40 +0100)]
screen_file: remove redundant code from OnOpen()

2 years agoscreen_chat: remove redundant code from OnOpen()
Max Kellermann [Wed, 14 Mar 2018 19:39:09 +0000 (20:39 +0100)]
screen_chat: remove redundant code from OnOpen()

2 years agoscreen_search: remove search_check_mode()
Max Kellermann [Wed, 14 Mar 2018 19:21:27 +0000 (20:21 +0100)]
screen_search: remove search_check_mode()

It is not necessary to fix up the values from get_search_mode().

2 years agoconf: use strcasecmp() in get_search_mode()
Max Kellermann [Wed, 14 Mar 2018 19:20:50 +0000 (20:20 +0100)]
conf: use strcasecmp() in get_search_mode()

2 years agoscreen_queue: use mpdclient::playing
Max Kellermann [Wed, 14 Mar 2018 19:13:00 +0000 (20:13 +0100)]
screen_queue: use mpdclient::playing

2 years agoscreen_outputs: remove redundant code from OnOpen(), OnClose()
Max Kellermann [Wed, 14 Mar 2018 19:10:05 +0000 (20:10 +0100)]
screen_outputs: remove redundant code from OnOpen(), OnClose()

2 years agoPage: add attribute "pending_events"
Max Kellermann [Wed, 14 Mar 2018 18:50:05 +0000 (19:50 +0100)]
Page: add attribute "pending_events"

Remember all events which were missed while the page was not visible,
and deliver them as soon as the user switches to that page.

2 years agoMain: move "events" setter to mpdclient_connected()
Max Kellermann [Wed, 14 Mar 2018 19:07:45 +0000 (20:07 +0100)]
Main: move "events" setter to mpdclient_connected()

2 years agoscreen: add local "events" variable
Max Kellermann [Wed, 14 Mar 2018 18:57:44 +0000 (19:57 +0100)]
screen: add local "events" variable

2 years agoPage: pass idle event mask to Update()
Max Kellermann [Wed, 14 Mar 2018 15:52:02 +0000 (16:52 +0100)]
Page: pass idle event mask to Update()

Prepare for per-page event masks.

2 years agoutil/NulledString: add NullableToC()
Max Kellermann [Sun, 11 Mar 2018 19:17:17 +0000 (20:17 +0100)]
util/NulledString: add NullableToC()

2 years agoscreen_init: lazy Page::OnResize() calls
Max Kellermann [Wed, 14 Mar 2018 15:29:44 +0000 (16:29 +0100)]
screen_init: lazy Page::OnResize() calls

Call OnResize() only on the current page, and catch up on inactive
page as soon as the user switches to them.

2 years agoPage: keep track of the last-known size
Max Kellermann [Wed, 14 Mar 2018 15:26:18 +0000 (16:26 +0100)]
Page: keep track of the last-known size

2 years agoSize: add operator==()
Max Kellermann [Wed, 14 Mar 2018 15:27:31 +0000 (16:27 +0100)]
Size: add operator==()

2 years agoScreenManager: convert pointers to references
Max Kellermann [Sun, 11 Mar 2018 19:20:12 +0000 (20:20 +0100)]
ScreenManager: convert pointers to references

2 years agoutil/NulledString: add "inline"
Max Kellermann [Sun, 11 Mar 2018 17:06:05 +0000 (18:06 +0100)]
util/NulledString: add "inline"

2 years agoscreen_artist: eliminate method FreeState()
Max Kellermann [Sun, 11 Mar 2018 16:56:15 +0000 (17:56 +0100)]
screen_artist: eliminate method FreeState()

Thanks to C++, we have automatic memory management, and we don't need
this method anymore.

2 years agoscreen_artist: move functions to util/NulledString.hxx
Max Kellermann [Sun, 11 Mar 2018 16:49:16 +0000 (17:49 +0100)]
screen_artist: move functions to util/NulledString.hxx

2 years agoscreen_artist: use std::string for the album filter
Max Kellermann [Sun, 11 Mar 2018 08:38:17 +0000 (09:38 +0100)]
screen_artist: use std::string for the album filter

2 years agoscreen_artist: use std::string for the artist filter
Max Kellermann [Sun, 11 Mar 2018 08:25:46 +0000 (09:25 +0100)]
screen_artist: use std::string for the artist filter

2 years agoscreen_artist: move redundant code to OpenArtistList() overload
Max Kellermann [Sun, 11 Mar 2018 08:07:59 +0000 (09:07 +0100)]
screen_artist: move redundant code to OpenArtistList() overload

2 years agoscreen_artist: move redundant code to OpenAlbumList() overload
Max Kellermann [Sun, 11 Mar 2018 07:59:46 +0000 (08:59 +0100)]
screen_artist: move redundant code to OpenAlbumList() overload

2 years agoscreen_artist: make nullptr the special value for "All tracks"
Max Kellermann [Sun, 11 Mar 2018 07:43:25 +0000 (08:43 +0100)]
screen_artist: make nullptr the special value for "All tracks"

Eliminate the global variable ALL_TRACKS, which served as a magic
pointer.

2 years agoCompiler.h: add macro for attribute "returns_nonnull"
Max Kellermann [Sat, 10 Mar 2018 14:15:54 +0000 (15:15 +0100)]
Compiler.h: add macro for attribute "returns_nonnull"

2 years agoi18n: rename macros YES/NO to YES_TRANSLATION/NO_TRANSLATION
Max Kellermann [Thu, 1 Mar 2018 20:40:32 +0000 (21:40 +0100)]
i18n: rename macros YES/NO to YES_TRANSLATION/NO_TRANSLATION

Avoid namespace collision.

2 years agoscreen: make various attributes private
Max Kellermann [Wed, 28 Feb 2018 21:58:15 +0000 (22:58 +0100)]
screen: make various attributes private

2 years agoscreen_text: rename source to TextPage.cxx
Max Kellermann [Mon, 26 Feb 2018 21:34:55 +0000 (22:34 +0100)]
screen_text: rename source to TextPage.cxx

2 years agoscreen: move mode_fn_prev into class ScreenManager
Max Kellermann [Mon, 26 Feb 2018 21:29:33 +0000 (22:29 +0100)]
screen: move mode_fn_prev into class ScreenManager

2 years agoscreen: eliminate two redundant Paint() calls
Max Kellermann [Mon, 26 Feb 2018 21:24:44 +0000 (22:24 +0100)]
screen: eliminate two redundant Paint() calls

2 years agoscreen_init: fix swapped width/height in OnResize()
Max Kellermann [Mon, 26 Feb 2018 21:26:07 +0000 (22:26 +0100)]
screen_init: fix swapped width/height in OnResize()

2 years agoProgressBar: use '>' instead of 'O'
Max Kellermann [Sun, 25 Feb 2018 20:31:43 +0000 (21:31 +0100)]
ProgressBar: use '>' instead of 'O'

2 years agoProgressBar: dark gray background line
Max Kellermann [Sun, 25 Feb 2018 21:18:37 +0000 (22:18 +0100)]
ProgressBar: dark gray background line

2 years agoProgressBar: optimize drawing the horizontal line
Max Kellermann [Sun, 25 Feb 2018 21:40:40 +0000 (22:40 +0100)]
ProgressBar: optimize drawing the horizontal line

2 years agocolors: disable NamedColor::color if compiled without color support
Max Kellermann [Sun, 25 Feb 2018 21:30:22 +0000 (22:30 +0100)]
colors: disable NamedColor::color if compiled without color support

2 years agodoc/ncmpc.1: migrate to Sphinx
Max Kellermann [Sun, 25 Feb 2018 20:34:51 +0000 (21:34 +0100)]
doc/ncmpc.1: migrate to Sphinx

2 years agodoc/meson.build: rename API documentation directory to "api"
Max Kellermann [Sun, 25 Feb 2018 20:40:37 +0000 (21:40 +0100)]
doc/meson.build: rename API documentation directory to "api"

2 years agomeson.build: move doxygen check to doc/meson.build
Max Kellermann [Sun, 25 Feb 2018 20:33:09 +0000 (21:33 +0100)]
meson.build: move doxygen check to doc/meson.build

2 years agoStatusBar: use Window::Resize()
Max Kellermann [Sun, 25 Feb 2018 20:27:31 +0000 (21:27 +0100)]
StatusBar: use Window::Resize()

2 years agoSize: new struct
Max Kellermann [Sun, 25 Feb 2018 19:54:43 +0000 (20:54 +0100)]
Size: new struct

2 years agoTitleBar: make GetHeight() constexpr
Max Kellermann [Sun, 25 Feb 2018 20:01:29 +0000 (21:01 +0100)]
TitleBar: make GetHeight() constexpr

2 years agoPoint: new struct
Max Kellermann [Sun, 25 Feb 2018 19:21:28 +0000 (20:21 +0100)]
Point: new struct

2 years agoListWindow: add ListWindowRange::empty()
Max Kellermann [Fri, 23 Feb 2018 20:57:50 +0000 (21:57 +0100)]
ListWindow: add ListWindowRange::empty()

2 years agoListWindow: add ListWindowRange::const_iterator
Max Kellermann [Fri, 23 Feb 2018 20:25:41 +0000 (21:25 +0100)]
ListWindow: add ListWindowRange::const_iterator

2 years agoListWindow: rename range attributes
Max Kellermann [Fri, 23 Feb 2018 20:33:01 +0000 (21:33 +0100)]
ListWindow: rename range attributes

2 years agoListWindow: add method ListWindowRange::Contains()
Max Kellermann [Fri, 23 Feb 2018 20:34:08 +0000 (21:34 +0100)]
ListWindow: add method ListWindowRange::Contains()

2 years agoListWindow: fix HandleMouse() parameter type
Max Kellermann [Fri, 23 Feb 2018 20:35:40 +0000 (21:35 +0100)]
ListWindow: fix HandleMouse() parameter type

2 years ago*: fix -Wmismatched-tags for class hscroll
Max Kellermann [Fri, 23 Feb 2018 20:25:46 +0000 (21:25 +0100)]
*: fix -Wmismatched-tags for class hscroll

2 years agoListWindow: move functions into the struct
Max Kellermann [Fri, 23 Feb 2018 08:59:49 +0000 (09:59 +0100)]
ListWindow: move functions into the struct

2 years agoListWindow: add missing include
Max Kellermann [Fri, 23 Feb 2018 09:00:33 +0000 (10:00 +0100)]
ListWindow: add missing include

2 years agoListWindow: rename the source files
Max Kellermann [Fri, 23 Feb 2018 08:57:26 +0000 (09:57 +0100)]
ListWindow: rename the source files

2 years agoBasicMarquee: add constructor
Max Kellermann [Fri, 23 Feb 2018 08:55:14 +0000 (09:55 +0100)]
BasicMarquee: add constructor

2 years agohscroll: add constructor
Max Kellermann [Mon, 19 Feb 2018 18:22:55 +0000 (19:22 +0100)]
hscroll: add constructor

2 years agoMain: create mpdclient on the main() stack
Max Kellermann [Thu, 22 Feb 2018 21:52:32 +0000 (22:52 +0100)]
Main: create mpdclient on the main() stack

2 years agompdclient: move code to constructor
Max Kellermann [Thu, 22 Feb 2018 21:48:01 +0000 (22:48 +0100)]
mpdclient: move code to constructor

2 years agompdclient: remove mpdclient_free()
Max Kellermann [Thu, 22 Feb 2018 21:48:06 +0000 (22:48 +0100)]
mpdclient: remove mpdclient_free()

2 years agoscreen: remove obsolete commented line
Max Kellermann [Thu, 22 Feb 2018 21:42:35 +0000 (22:42 +0100)]
screen: remove obsolete commented line

2 years agowindow: add constructor and destructor
Max Kellermann [Thu, 22 Feb 2018 21:37:22 +0000 (22:37 +0100)]
window: add constructor and destructor

2 years agoStatusBar: move code to constructor and destructor
Max Kellermann [Thu, 22 Feb 2018 21:09:21 +0000 (22:09 +0100)]
StatusBar: move code to constructor and destructor

2 years agoProgressBar: move code to constructor and destructor
Max Kellermann [Thu, 22 Feb 2018 21:07:52 +0000 (22:07 +0100)]
ProgressBar: move code to constructor and destructor

2 years agoTitleBar: move code to constructor and destructor
Max Kellermann [Thu, 22 Feb 2018 20:48:06 +0000 (21:48 +0100)]
TitleBar: move code to constructor and destructor

2 years agoscreen: add struct Layout
Max Kellermann [Thu, 22 Feb 2018 20:58:01 +0000 (21:58 +0100)]
screen: add struct Layout

2 years agoscreen: move code from Init() to constructor
Max Kellermann [Thu, 22 Feb 2018 20:43:39 +0000 (21:43 +0100)]
screen: move code from Init() to constructor

2 years agoscreen: move code from Exit() to destructor
Max Kellermann [Thu, 22 Feb 2018 20:34:26 +0000 (21:34 +0100)]
screen: move code from Exit() to destructor

2 years agoMain: convert "screen" to pointer, move to main() stack
Max Kellermann [Thu, 22 Feb 2018 20:25:05 +0000 (21:25 +0100)]
Main: convert "screen" to pointer, move to main() stack

2 years agoncu: add class ScopeCursesInit
Max Kellermann [Thu, 22 Feb 2018 20:42:18 +0000 (21:42 +0100)]
ncu: add class ScopeCursesInit

2 years agoscreen: initialize find_history
Max Kellermann [Thu, 22 Feb 2018 20:33:07 +0000 (21:33 +0100)]
screen: initialize find_history

2 years agoStatusBar: check right_width instead of right_text[0]
Max Kellermann [Thu, 22 Feb 2018 20:31:51 +0000 (21:31 +0100)]
StatusBar: check right_width instead of right_text[0]

The "right_text" buffer may not be initialized.

2 years agoMain: call ScreenManager::Update() during initialization
Max Kellermann [Thu, 22 Feb 2018 20:29:45 +0000 (21:29 +0100)]
Main: call ScreenManager::Update() during initialization

Ensure that all variables are initialized properly.

2 years agoscreen_find: pass ScreenManager&
Max Kellermann [Thu, 22 Feb 2018 20:13:42 +0000 (21:13 +0100)]
screen_find: pass ScreenManager&

2 years agokeyboard: pass WINDOW* to event callback
Max Kellermann [Thu, 22 Feb 2018 19:58:20 +0000 (20:58 +0100)]
keyboard: pass WINDOW* to event callback

Avoid using the global variable "screen".

2 years agosignals: pass ScreenManager to signal callback
Max Kellermann [Thu, 22 Feb 2018 19:54:58 +0000 (20:54 +0100)]
signals: pass ScreenManager to signal callback

Eliminate use of global variable.

2 years agoscreen_paint: move ProgressBar::Set() call to ScreenManager::Update()
Max Kellermann [Thu, 22 Feb 2018 19:48:21 +0000 (20:48 +0100)]
screen_paint: move ProgressBar::Set() call to ScreenManager::Update()

Allows removing lots of "struct mpdclient *" parameters.

2 years agoscreen: pass struct mpdclient as reference, not pointer
Max Kellermann [Thu, 22 Feb 2018 19:48:38 +0000 (20:48 +0100)]
screen: pass struct mpdclient as reference, not pointer

2 years agoProgressBar: convert to class
Max Kellermann [Thu, 22 Feb 2018 19:46:13 +0000 (20:46 +0100)]
ProgressBar: convert to class

2 years agoscreen_init: move a wbkgd() call to ProgressBar::Init()
Max Kellermann [Thu, 22 Feb 2018 19:44:40 +0000 (20:44 +0100)]
screen_init: move a wbkgd() call to ProgressBar::Init()

2 years agoProgressBar: convert functions to methods
Max Kellermann [Thu, 22 Feb 2018 19:39:07 +0000 (20:39 +0100)]
ProgressBar: convert functions to methods

2 years agoprogress_bar: use CamelCase
Max Kellermann [Thu, 22 Feb 2018 19:36:59 +0000 (20:36 +0100)]
progress_bar: use CamelCase

2 years agoStatusBar: add method Update(), cache formatted strings
Max Kellermann [Wed, 21 Feb 2018 16:03:56 +0000 (17:03 +0100)]
StatusBar: add method Update(), cache formatted strings

Allows Paint() to be const.

2 years agoaconnect: use delete instead of g_free()
Max Kellermann [Thu, 22 Feb 2018 19:35:37 +0000 (20:35 +0100)]
aconnect: use delete instead of g_free()

2 years agoBasicMarquee: move wraparound check from ScrollString() to Step()
Max Kellermann [Wed, 21 Feb 2018 20:35:01 +0000 (21:35 +0100)]
BasicMarquee: move wraparound check from ScrollString() to Step()

Allows making Paint() const.

2 years agoBasicMarquee: add attributes "text_utf8" and "text_utf8_length"
Max Kellermann [Wed, 21 Feb 2018 20:27:42 +0000 (21:27 +0100)]
BasicMarquee: add attributes "text_utf8" and "text_utf8_length"

2 years agohscroll: add method IsDefined()
Max Kellermann [Wed, 21 Feb 2018 19:16:35 +0000 (20:16 +0100)]
hscroll: add method IsDefined()

2 years agohscroll: move code to class BasicMarquee
Max Kellermann [Wed, 21 Feb 2018 20:00:34 +0000 (21:00 +0100)]
hscroll: move code to class BasicMarquee

2 years agohscroll: remove redundant parameters from ScrollString()
Max Kellermann [Wed, 21 Feb 2018 20:14:12 +0000 (21:14 +0100)]
hscroll: remove redundant parameters from ScrollString()

2 years agotest/run_hscroll: properly initialize the struct hscroll
Max Kellermann [Wed, 21 Feb 2018 19:41:35 +0000 (20:41 +0100)]
test/run_hscroll: properly initialize the struct hscroll

2 years agohscroll: convert to class
Max Kellermann [Wed, 21 Feb 2018 19:56:28 +0000 (20:56 +0100)]
hscroll: convert to class

2 years agohscroll: convert functions to methods
Max Kellermann [Wed, 21 Feb 2018 19:40:14 +0000 (20:40 +0100)]
hscroll: convert functions to methods

2 years agoStatusBar: convert to class
Max Kellermann [Wed, 21 Feb 2018 16:05:06 +0000 (17:05 +0100)]
StatusBar: convert to class

2 years agoscreen_init: move a wbkgd() call to StatusBar::Init()
Max Kellermann [Wed, 21 Feb 2018 16:19:15 +0000 (17:19 +0100)]
screen_init: move a wbkgd() call to StatusBar::Init()

2 years agoStatusBar: convert functions to methods
Max Kellermann [Wed, 21 Feb 2018 14:34:31 +0000 (15:34 +0100)]
StatusBar: convert functions to methods

2 years agoStatusBar: remove unused attributes
Max Kellermann [Wed, 21 Feb 2018 14:39:21 +0000 (15:39 +0100)]
StatusBar: remove unused attributes

2 years agostatus_bar: use CamelCase
Max Kellermann [Wed, 21 Feb 2018 14:32:52 +0000 (15:32 +0100)]
status_bar: use CamelCase

2 years agoscreen: move global variable to Main.cxx
Max Kellermann [Tue, 20 Feb 2018 21:30:06 +0000 (22:30 +0100)]
screen: move global variable to Main.cxx

2 years agoscreen_{file,song,lyrics}: pass ScreenManager reference to switch functions
Max Kellermann [Wed, 21 Feb 2018 12:09:01 +0000 (13:09 +0100)]
screen_{file,song,lyrics}: pass ScreenManager reference to switch functions

2 years agoscreen_interface: pass ScreenManager& to init()
Max Kellermann [Wed, 21 Feb 2018 11:04:11 +0000 (12:04 +0100)]
screen_interface: pass ScreenManager& to init()

Don't use the global variable "screen".

2 years agoscreen_paint: convert update_progress_window() to ScreenManager method
Max Kellermann [Wed, 21 Feb 2018 12:03:22 +0000 (13:03 +0100)]
screen_paint: convert update_progress_window() to ScreenManager method

2 years agoscreen_init: pass ScreenManager pointer to welcome_timer_callback()
Max Kellermann [Wed, 21 Feb 2018 12:02:05 +0000 (13:02 +0100)]
screen_init: pass ScreenManager pointer to welcome_timer_callback()

2 years agoTitleBar: add method Update(), cache mpd_status details
Max Kellermann [Wed, 21 Feb 2018 11:46:55 +0000 (12:46 +0100)]
TitleBar: add method Update(), cache mpd_status details

Now we don't need access to the MPD client to paint the title bar.