ncmpc-debian.git
2 years agoListWindow: convert list_window_callback_fn_t to an abstract class
Max Kellermann [Sat, 17 Mar 2018 09:30:06 +0000 (10:30 +0100)]
ListWindow: convert list_window_callback_fn_t to an abstract class

2 years agoListWindow: refactor the second Paint() overload to a ListRenderer
Max Kellermann [Sat, 17 Mar 2018 07:50:21 +0000 (08:50 +0100)]
ListWindow: refactor the second Paint() overload to a ListRenderer

2 years agoListWindow: call row_color_end() in both Paint() overloads
Max Kellermann [Sat, 17 Mar 2018 09:21:35 +0000 (10:21 +0100)]
ListWindow: call row_color_end() in both Paint() overloads

2 years agoscreen_find: make the ListRenderer mandatory
Max Kellermann [Sat, 17 Mar 2018 07:47:14 +0000 (08:47 +0100)]
screen_find: make the ListRenderer mandatory

2 years agoListWindow: replace callback function with abstract class
Max Kellermann [Sun, 25 Feb 2018 08:57:44 +0000 (09:57 +0100)]
ListWindow: replace callback function with abstract class

2 years agostrfsong: use plain C types instead of GLib
Max Kellermann [Sat, 17 Mar 2018 07:34:00 +0000 (08:34 +0100)]
strfsong: use plain C types instead of GLib

2 years agoutils: remove unused library
Max Kellermann [Sat, 17 Mar 2018 07:31:22 +0000 (08:31 +0100)]
utils: remove unused library

2 years agoscreen_queue: remove obsolete attribute
Max Kellermann [Sat, 17 Mar 2018 07:31:11 +0000 (08:31 +0100)]
screen_queue: remove obsolete attribute

2 years agoCompletion: use std::set<std::string> instead of GCompletion
Max Kellermann [Fri, 16 Mar 2018 19:27:18 +0000 (20:27 +0100)]
Completion: use std::set<std::string> instead of GCompletion

GCompletion is deprecated.

2 years agodb_completion: use GLib forward declarations
Max Kellermann [Sat, 17 Mar 2018 07:21:41 +0000 (08:21 +0100)]
db_completion: use GLib forward declarations

2 years agowreadln: return std::string
Max Kellermann [Fri, 16 Mar 2018 20:18:53 +0000 (21:18 +0100)]
wreadln: return std::string

2 years agoscreen_find: local buffer, don't (ab)use ScreenManager::findbuf
Max Kellermann [Fri, 16 Mar 2018 20:34:35 +0000 (21:34 +0100)]
screen_find: local buffer, don't (ab)use ScreenManager::findbuf

2 years agoscreen_find: WRLN_MAX_LINE_SIZE constexpr
Max Kellermann [Fri, 16 Mar 2018 20:35:15 +0000 (21:35 +0100)]
screen_find: WRLN_MAX_LINE_SIZE constexpr

2 years agocallbacks: use unsigned instead of gint
Max Kellermann [Fri, 16 Mar 2018 20:18:09 +0000 (21:18 +0100)]
callbacks: use unsigned instead of gint

2 years agowreadln: include cleanup
Max Kellermann [Fri, 16 Mar 2018 19:22:36 +0000 (20:22 +0100)]
wreadln: include cleanup

2 years agowreadln: include cleanup
Max Kellermann [Fri, 16 Mar 2018 19:20:39 +0000 (20:20 +0100)]
wreadln: include cleanup

2 years agowreadln: add class Completion
Max Kellermann [Fri, 16 Mar 2018 18:01:22 +0000 (19:01 +0100)]
wreadln: add class Completion

2 years agowreadln: remove history and completion support from _masked()
Max Kellermann [Fri, 16 Mar 2018 19:07:13 +0000 (20:07 +0100)]
wreadln: remove history and completion support from _masked()

2 years agoscreen_queue: use std::set<std::string> for dir_list
Max Kellermann [Fri, 16 Mar 2018 17:41:38 +0000 (18:41 +0100)]
screen_queue: use std::set<std::string> for dir_list

2 years agoscreen_utils: iterate the list without g_list_nth()
Max Kellermann [Fri, 16 Mar 2018 17:53:13 +0000 (18:53 +0100)]
screen_utils: iterate the list without g_list_nth()

2 years agoscreen_utils: break from the loop at end of list
Max Kellermann [Fri, 16 Mar 2018 17:53:37 +0000 (18:53 +0100)]
screen_utils: break from the loop at end of list

2 years agoscreen_utils: call wclrtoeol() after drawing the value
Max Kellermann [Fri, 16 Mar 2018 17:52:18 +0000 (18:52 +0100)]
screen_utils: call wclrtoeol() after drawing the value

Don't draw cells twice.

2 years agoscreen_utils: fix completion list rendering, no g_basename()
Max Kellermann [Fri, 16 Mar 2018 17:49:15 +0000 (18:49 +0100)]
screen_utils: fix completion list rendering, no g_basename()

g_basename() returns an empty string if the string ends with a slash.
This breaks the list of directories, because they all end with a
slash.

2 years agoscreen_utils: move code to CompletionDisplayString()
Max Kellermann [Fri, 16 Mar 2018 17:47:15 +0000 (18:47 +0100)]
screen_utils: move code to CompletionDisplayString()

2 years agoscreen_utils: remove unnecessary memory allocation
Max Kellermann [Fri, 16 Mar 2018 17:45:14 +0000 (18:45 +0100)]
screen_utils: remove unnecessary memory allocation

2 years agowreadln: use std::string as internal buffer
Max Kellermann [Fri, 16 Mar 2018 17:10:59 +0000 (18:10 +0100)]
wreadln: use std::string as internal buffer

2 years agowreadln: pass const string to completion callbacks
Max Kellermann [Fri, 16 Mar 2018 17:25:11 +0000 (18:25 +0100)]
wreadln: pass const string to completion callbacks

2 years agowreadln: use std::list<std::string> for the history
Max Kellermann [Fri, 16 Mar 2018 16:50:53 +0000 (17:50 +0100)]
wreadln: use std::list<std::string> for the history

2 years agowreadln: remove useless g_strlcpy() call
Max Kellermann [Fri, 16 Mar 2018 17:01:55 +0000 (18:01 +0100)]
wreadln: remove useless g_strlcpy() call

At this point, wr.line is always an empty string.

2 years agoscreen_find: use true/false instead of 1/0
Max Kellermann [Fri, 16 Mar 2018 16:47:32 +0000 (17:47 +0100)]
screen_find: use true/false instead of 1/0

2 years agocharset: add class LocaleToUtf8
Max Kellermann [Fri, 16 Mar 2018 16:23:48 +0000 (17:23 +0100)]
charset: add class LocaleToUtf8

2 years agoscreen_file: use std::string
Max Kellermann [Fri, 16 Mar 2018 16:16:33 +0000 (17:16 +0100)]
screen_file: use std::string

2 years agocharset: add class Utf8ToLocale
Max Kellermann [Fri, 16 Mar 2018 15:50:55 +0000 (16:50 +0100)]
charset: add class Utf8ToLocale

2 years agowreadln: use struct Point
Max Kellermann [Fri, 16 Mar 2018 16:12:09 +0000 (17:12 +0100)]
wreadln: use struct Point

2 years agoscreen_keydef: use std::copy() instead of memcpy()
Max Kellermann [Fri, 16 Mar 2018 11:17:53 +0000 (12:17 +0100)]
screen_keydef: use std::copy() instead of memcpy()

2 years agoscreen_keydef: use new[]/delete[]
Max Kellermann [Fri, 16 Mar 2018 11:16:52 +0000 (12:16 +0100)]
screen_keydef: use new[]/delete[]

2 years agoscreen_keydef: split into two Page implementations
Max Kellermann [Fri, 16 Mar 2018 09:37:30 +0000 (10:37 +0100)]
screen_keydef: split into two Page implementations

2 years agoscreen_artist: remove unused attribute "mode"
Max Kellermann [Fri, 16 Mar 2018 09:26:12 +0000 (10:26 +0100)]
screen_artist: remove unused attribute "mode"

2 years agompdclient: add attribute playing_or_paused
Max Kellermann [Fri, 16 Mar 2018 08:39:19 +0000 (09:39 +0100)]
mpdclient: add attribute playing_or_paused

2 years agompdclient: remove mpdclient_filelist_add_all()
Max Kellermann [Fri, 16 Mar 2018 08:35:54 +0000 (09:35 +0100)]
mpdclient: remove mpdclient_filelist_add_all()

2 years agompdclient: cache the enum mpd_state
Max Kellermann [Fri, 16 Mar 2018 08:32:17 +0000 (09:32 +0100)]
mpdclient: cache the enum mpd_state

2 years agoscreen_artist: remove unused macro
Max Kellermann [Wed, 14 Mar 2018 20:38:45 +0000 (21:38 +0100)]
screen_artist: remove unused macro

2 years agoscreen_artist: remove prototypes which restore the selection
Max Kellermann [Wed, 14 Mar 2018 20:36:40 +0000 (21:36 +0100)]
screen_artist: remove prototypes which restore the selection

We don't need to restore the cursor anymore, because each Page
remembers the cursor position.

2 years ago{Artist,Album}ListPage: use "findadd" instead of "find"+"add"
Max Kellermann [Wed, 14 Mar 2018 20:28:28 +0000 (21:28 +0100)]
{Artist,Album}ListPage: use "findadd" instead of "find"+"add"

2 years agoArtistListPage: remove unused parameter from add_query()
Max Kellermann [Wed, 14 Mar 2018 20:24:23 +0000 (21:24 +0100)]
ArtistListPage: remove unused parameter from add_query()

2 years ago{Artist,Album}ListPage: simplify status message
Max Kellermann [Wed, 14 Mar 2018 20:24:41 +0000 (21:24 +0100)]
{Artist,Album}ListPage: simplify status message

Reuse another translatable string and drop two unnecessary ones.

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