~exec64/imv

console: update libgrapheme API to version 2.0.0

libgrapheme recently saw its second major version which was "refactored
for correctness and conformance"[1].

[1]: http://lists.suckless.org/news/2210/0036.html
Correct spelling mistakes
Replace old GitHub links for sourcehut ones
Remove trailing whitespace from wordexp-ed strings

Previous implementation was always leaving a trailing whitespace at the
end of the expanded string (used in window title, description text,
etc.). Now it doesn't happen.
Make sure imv and imv-dir have different names in .desktop

It might be different in other file managers, but in Thunar both imv and
imv-dir are currently displayed as "imv" in the "open with" menu. This
makes them indisutinguishable and impossible to choose the one user
wants. This commit ensures that they have different names in the desktop
files.
Pause slideshow when view->playing is false

Signed-off-by: Robert Günzler <r@gnzler.io>
Make imv-dir act like imv when called with multiple arguments

This commit allows user to select a few files and open only them using
imv-dir. When user opens just one file (typically by double-clicking on
it in a file manager), imv-dir will behave like it used to and open
open the whole directory.

I think this behavior is more reasonable doesn't add much complexity to
imv-dir. Now imv-dir conveniently accomodates the three use-cases which
I think must be quite common:

1. If user wants to cycle through all files in current directory, they
   can just double click on one of them.

2. If the user wants to cycle through just a few specific files (say,
   if they have many files in this directory and don't want to see them
   all), they select them and hit Enter.

3. If the user wants to see just one file and doesn't care about cycling
   through them, they just click on one file. The cycling is available,
   but they don't have to use it.

For me, 1 and 2 were the main use-cases and to accomodate them I had to
switch between imv and imv-dir as default image viewers, which is rather
suboptimal. Now both are cheaply accomodated by imv-dir.
wl_window: fix buffer size not divisible by scale

Do not commit the surface with the new scale and the old buffer.
Leave it to the next rendering pass to commit the surface.

Fixes the following protocol error:

    wl_surface@10: error 2: Buffer size (717x795) is not divisible by scale (2)

Closes: https://todo.sr.ht/~exec64/imv/20
console: update libgrapheme API to version 1
wl_window: Fix segfault with latest wlroots

imv is currently binding to the latest version of all the interfaces,
but should instead bind the latest version that it supports. imv is not
compatible with wl_output v4 and so was crashing when the latest wlroots
offered it.

This patch pins a maximum version for each wayland interface that is
bound.

https://todo.sr.ht/~exec64/imv/1
rsvg: Suppress deprecation warnings

Newer APIs will be used when necessary, to maintain compatibility with
older versions of rsvg. In the mean time, disable the noisy warnings.
x11_window: Fix typo in if statement
Add support for libgrapheme as an icu replacement
Add '-w' option to specify window title at startup
Update contributing guidelines
Draw background rectangle behind the (possibly multiline) overlay text

Before this commit, the background rectangle was drawn to cover only one line
of text (which was ok since multiline overlay text was not supported). Now
the code correctly calculates the dimensions on the rendered text and put the
rectangle of the right size under it.
Move Cairo layout creation and display code to two separate functions

This effectively splits the imv_canvas_printf function into two separate
functions, one to create a layout containing given text and the other one
to show it on the canvas. These functions can be useful for the future code
I will add to display text with a background rectangle behind it. Existing
imv_canvas_printf function does not allow this
Set IFS env variable to "" for overlay_text shell expansion

This prevents wordexp function from splitting the output of shell expansion
into “words” and, as a consequence, removing the newlines from it. With this
commit applied, setting

  overlay_text = $(echo -e 'hello\nworld!')

displays

  hello
  world!

in Imv window. Without this commit, the same overlay_text setting would display

  hello world!

since wordexp splits the string "hello\nworld!" into two words and connects
them with a space.

This should not break any of the commands executed in $(), because the IFS
variable is *not* inherited by their shell. The commands don't see this change
and run with the default IFS value.
9ae3ee1d — Tuomas Siipola 2 years ago
Show chequered pattern on image instead of viewport

OpenGL is used for rendering because `cairo_rectangle` and
`cairo_pattern_t` had performance problems on zoomed and rotated images.

The size and contrast of the chequered pattern is also reduces to match
other image viewers and editors.

Closes #253
Next