Show what is happening during build etc, the way most other make-based
projects do.
There is thus no need for the options target. Additionally, this target
caused unnecessary rebuilds of ./dunst each and every time, even on
`make install`.
'True' and 'False' are defined in Xlib.h
Since we use stdbool boolean 'true' and 'false' definitions in several
places, it's best not to mix boolean macros. So in the sake of
consistency switch to using the stdbool macros project-wide.
To load each line of the configuration file we were previously using a
simple buffer of length BUFSIZ. BUFSIZ is a macro provided by glibc as
the 'recommended length for a buffer'. But since one of our users
encountered a situation where really long config lines were necessary
it's time to change that behaviour.
This commit changes the line reading from using fgets with a character
limit of BUFSIZ to simply using getline.
We initialize the buffer pointer to NULL since getline will
automatically allocate a big enough buffer for us if it's passed a NULL
pointer. After that we pass the same buffer pointer again since,
according to the getline manpage, getline will also call realloc on the
buffer if necessary. Which means the only thing we have to do is call
free() at the end of the parsing process.
Fixes#294
string_to_argv parsing was very simplistic and didn't properly handle
quotations. Since we are already using glib, g_shell_parse_argv serves
the same purpose with much better parsing and error handling.
Setting markup_mode to -1 might not work since in some implementations
enum might not be signed. For convenience, add a new enum value
`MARKUP_NULL` to serve the same purpose.
Merge the allow_markup and plain_text settings into a single setting.
These 2 settings had a similar function, allow_markup controlled whether
markup was parsed or stripped and plain_text whether the notification
was escaped and displayed as is.
To cover all the possible combinations of the settings mentioned above
`markup` can take the following values:
full: The equivalent of allow_markup yes, plain_text no.
Passes the text straight to pango with minimal parsing. All valid
pango tags will be parsed.
strip: The equivalent of allow_markup no, plain_text no.
Strips the markup using string_strip_delimited. The parsing is
simplistic and if there are any unescaped '<' and/or '>'
characters it might get tripped and strip out actual text.
According to the GNOME notification specification, if a server
doesn't support markup(and we don't advertise that we do if it is
turned off) it should be stripped clientside, so this setting
should rarely be used. It is mainly left in for compatibility
with broken clients that don't follow the specification.
no: The equivalent of allow_markup [yes/no](any value), plain_text
yes.
Makes the notification content be rendered as plain text
regardless if it contains markup. Any Markup will be shown as
regular text.
Markup inside 'format' will still be parsed regardless of what markup is
set to.
Closes#279
* Don't mix pragma guards and include guards, prefer classic include
guards since apparently pragma guards are not a standard yet.
* Use the DUNST_FILE_H naming convention for all include guards.
If a notification has a raw icon, icon is set to NULL which was passed
without checking to strcmp. We don't (yet) support comparing raw icons so
if a raw icon is set, we can safely assume the notification is not a
duplicate.