Skip to content

Commit 8ec98cb

Browse files
committed
Merge branch 'dev' into release
2 parents 551969d + 6602be6 commit 8ec98cb

File tree

9 files changed

+115
-26
lines changed

9 files changed

+115
-26
lines changed

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
cmake_minimum_required (VERSION 3.9)
1919

2020
project (Lagrange
21-
VERSION 1.18.0
21+
VERSION 1.18.1
2222
DESCRIPTION "A Beautiful Gemini Client"
2323
LANGUAGES C
2424
)
@@ -74,10 +74,10 @@ option (ENABLE_FRIBIDI_BUILD "Build the GNU FriBidi library (if OFF, try pkg-
7474
option (ENABLE_HARFBUZZ "Use the HarfBuzz library to shape text" ON)
7575
option (ENABLE_HARFBUZZ_MINIMAL "Build the HarfBuzz library with minimal dependencies (if OFF, try pkg-config)" OFF)
7676
option (ENABLE_MPG123 "Use mpg123 for decoding MPEG audio" ON)
77+
option (ENABLE_OPUS "Use llibopusfile for decoding Opus audio (via pkg-config)" ON)
7778
option (ENABLE_SPARKLE "Use Sparkle for automatic updates (macOS)" OFF)
7879
option (ENABLE_WEBP "Use libwebp to decode .webp images (via pkg-config)" ON)
7980
option (ENABLE_WINSPARKLE "Use WinSparkle for automatic updates (Windows)" OFF)
80-
option (ENABLE_OPUS "Use llibopusfile for decoding Opus audio (via pkg-config)" ON)
8181

8282
include (BuildType)
8383
include (Resources)

README.md

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Like Gemini, Lagrange has been designed with minimalism in mind. It depends on a
1515
* Multiple tabs
1616
* Identity management — create and use TLS client certificates
1717
* Audio playback: MP3, Ogg Vorbis, WAV
18+
* Curses-based TUI as an alternative to the graphical interface
1819
* And much more! Open `about:help` in the app, or see [help.gmi](https://git.skyjake.fi/gemini/lagrange/raw/branch/release/res/about/help.gmi)
1920

2021
## Downloads
@@ -46,7 +47,7 @@ You need a POSIX-compatible environment to compile Lagrange.
4647
The required tools are a C11 compiler (e.g., Clang or GCC), CMake, `pkg-config`, and `zip`. Additional tools are required if HarfBuzz and GNU FriBidi are also compiled as part of the build (see next section for details).
4748

4849
1. Download and extract a source tarball from [Releases][rel]. Please note that the GitHub/Gitea-generated tarballs do not contain HarfBuzz, GNU FriBidi, or [the_Foundation](https://git.skyjake.fi/skyjake/the_Foundation) submodules; check which tarball you are downloading. Alternatively, you may also clone the repository and its submodules: `git clone --recursive --branch release https://git.skyjake.fi/gemini/lagrange`
49-
2. Check that you have the recommended build tools and dependencies installed: SDL 2, OpenSSL 1.1.1, libpcre, libunistring, GNU FriBidi, and zlib. For example,
50+
2. Check that you have the recommended build tools and dependencies installed: SDL 2, OpenSSL, libpcre, libunistring, GNU FriBidi, and zlib. For example,
5051
* on macOS using Homebrew: `brew install cmake automake sdl2 [email protected] pcre libunistring fribidi`
5152
* on Ubuntu: `sudo apt install cmake zip libsdl2-dev libssl-dev libpcre3-dev zlib1g-dev libunistring-dev libfribidi-dev`
5253
* on Fedora: `sudo dnf install cmake zip SDL2-devel openssl-devel pcre-devel zlib-devel libunistring-devel fribidi-devel`
@@ -86,31 +87,35 @@ Note that the `install` target also deploys an XDG .desktop file for launching t
8687
| ------------ | ----------- |
8788
| `ENABLE_CUSTOM_FRAME` | Draw a custom window frame. (Only on Microsoft Windows.) The custom frame is more in line with the visual style of the rest of the UI, but does not implement all of the native window behaviors (e.g., snapping, system menu). |
8889
| `ENABLE_DOWNLOAD_EDIT` | Allow changing the Downloads directory via the Preferences dialog. This should be set to **OFF** in sandboxed environments where downloaded files must be saved into a specific place. |
90+
| `ENABLE_GUI` | Build the GUI application (the default). |
8991
| `ENABLE_IDLE_SLEEP` | Sleep in the main thread instead of waiting for events. On some platforms, when using SDL 2.0.16 or earlier, `SDL_WaitEvent()` may have a relatively high CPU usage. Setting this to **ON** polls for events periodically but otherwise keeps the main thread sleeping, reducing CPU usage. The drawback is that there is a slightly increased latency reacting to new events after idle mode ends. |
9092
| `ENABLE_FRIBIDI` | Use the GNU FriBidi library for processing bidirectional text. FriBidi implements the Unicode Bidirectional Algorithm to determine text directions. |
9193
| `ENABLE_FRIBIDI_BUILD` | Compile the GNU FriBidi library as part of the build. If set to **OFF**, `pkg-config` is used instead to locate the library. |
9294
| `ENABLE_HARFBUZZ` | Use the HarfBuzz library for shaping Unicode text. This is required for correctly rendering complex scripts and combining glyphs. If disabled, a simplified text shaping algorithm is used that only works for non-complex languages like English. |
9395
| `ENABLE_HARFBUZZ_MINIMAL` | Build the HarfBuzz library with all dependencies disabled. Useful when building the app for distribution so that the number of deployed dependencies will be minimized. A system-provided version of HarfBuzz is likely built with dependencies on FreeType and ICU at least. If set to **OFF**, `pkg-config` will be used to find HarfBuzz. |
9496
| `ENABLE_IPC` | Instances of the Lagrange executable communicate via signals or (on Windows) a system-provided IPC mechanism. This is used for controlling an existing Lagrange window via the CLI. If set to **OFF**, each instance of the app runs without knowledge of other instances. This may cause them to overwrite each other's runtime files. |
9597
| `ENABLE_KERNING` | Use kerning information in the fonts to adjust glyph placement. Setting this **ON** improves text appearance in subtle ways but slows down text rendering. It may be a good idea to set this to **OFF** when running on a slow CPU. This option only affects the simple built-in text renderer, and has no effect on HarfBuzz. |
98+
| `ENABLE_MOBILE_PHONE` | Use the mobile phone UI variant. This replaces the sidebars with a sliding sheet and has other touch-friendly features. Settings and dialogs are presented as form-based sheets. |
99+
| `ENABLE_MOBILE_TABLET` | Use the tablet UI variant. Sidebars are available as on the desktop, but Settings and dialogs are presented as form-based sheets. |
96100
| `ENABLE_MPG123` | Use the mpg123 library for decoding MPEG audio files. |
101+
| `ENABLE_OPUS` | Use the opusfile library for decoding Opus audio files. |
97102
| `ENABLE_RELATIVE_EMBED` | Locate resources only in relation to the executable. Useful when any system/predefined directories are not supposed to be accessed, e.g., in the Windows portable build. |
98-
| `ENABLE_TUI` | Build the TUI version (`clagrange`). The SEALCurses library is required: it is used instead of SDL. |
103+
| `ENABLE_STATIC` | Link dependencies statically. |
104+
| `ENABLE_TUI` | Build the TUI application (`clagrange`). The SEALCurses library is required (it replaces SDL); check that the `lib/sealcurses` submodule is checked out. |
99105
| `ENABLE_WEBP` | Use libwebp to decode .webp images, if `pkg-config` can find the library. |
100106
| `ENABLE_WINDOWPOS_FIX` | Set correct window position after the window has already been shown. This may be necessary on some platforms to prevent the window from being restored to the wrong position. |
101107
| `ENABLE_X11_SWRENDER` | Default to software rendering when running under X11. By default Lagrange attempts to use the GPU for rendering the user interface. You can also use the `--sw` option at launch to force software rendering. |
108+
| `ENABLE_X11_XLIB` | Use the Xlib API directly under X11. This is used for window decoration color theming, for example. |
102109

103110
### Compiling the TUI version
104111

105-
Lagrange has an optional text-mode interface that enables running the app in the terminal. This is disabled by the default build settings. Setting the `ENABLE_TUI` option to `YES` will replace the SDL dependency with a library called [SEALCurses](https://git.skyjake.fi/skyjake/sealcurses.git) that implements the required parts of the SDL API on top of Curses. The resulting executable is called `clagrange`.
112+
Lagrange has a text-mode interface that enables running the app in a terminal. However, it is mutually exclusive with the graphical interface, which means that the GUI and TUI are built as separate executables. By default, the TUI is disabled in the build settings. Set the `ENABLE_TUI` option to `YES` to build the TUI executable. If the GUI is not needed, you can also set `ENABLE_GUI` to `NO`. The TUI executable is called `clagrange`.
106113

107-
The requirements for building the TUI version are the same as with the GUI, except [ncurses](https://invisible-island.net/ncurses/) is required instead of SDL. HarfBuzz and all the image and audio dependencies are excluded from the TUI build.
108-
109-
The `build-tui.sh` helper script is provided for building the TUI version. All command line arguments given to the script are passed to CMake for further configuring the build. Note that the CMake install prefix variable (`CMAKE_INSTALL_PREFIX`) should not be set via an argument. Instead, the script will prompt for the install directory when run.
114+
In the TUI build, SDL is replaced with a library called [SEALCurses](https://git.skyjake.fi/skyjake/sealcurses.git) that implements a subset of the SDL API on top of [Curses](https://invisible-island.net/ncurses/). The requirements for building the TUI are otherwise the same as with the GUI, except HarfBuzz, FriBidi, and all the image and audio dependencies will not be used.
110115

111116
### Compiling on macOS
112117

113-
When using OpenSSL 1.1.1 from Homebrew, you must add its pkgconfig path to your `PKG_CONFIG_PATH` environment variable, for example:
118+
When using OpenSSL from Homebrew, you must add its pkgconfig path to your `PKG_CONFIG_PATH` environment variable, for example:
114119

115120
export PKG_CONFIG_PATH=/opt/homebrew/Cellar/[email protected]/1.1.1i/lib/pkgconfig
116121

cmake/Depends.cmake

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ else ()
3636
endif ()
3737
endif ()
3838
set (INSTALL_THE_FOUNDATION OFF)
39-
set (TFDN_STATIC_LIBRARY ON CACHE BOOL "")
40-
set (TFDN_ENABLE_INSTALL OFF CACHE BOOL "")
41-
set (TFDN_ENABLE_TESTS OFF CACHE BOOL "")
42-
set (TFDN_ENABLE_WEBREQUEST OFF CACHE BOOL "")
39+
set (TFDN_STATIC_LIBRARY ON CACHE BOOL "" FORCE)
40+
set (TFDN_ENABLE_INSTALL OFF CACHE BOOL "" FORCE)
41+
set (TFDN_ENABLE_TESTS OFF CACHE BOOL "" FORCE)
42+
set (TFDN_ENABLE_WEBREQUEST OFF CACHE BOOL "" FORCE)
4343
set (TFDN_ENABLE_STATIC_LINK ${ENABLE_STATIC} CACHE BOOL "" FORCE)
4444
add_subdirectory (lib/the_Foundation)
4545
add_library (the_Foundation::the_Foundation ALIAS the_Foundation)
@@ -207,10 +207,11 @@ endif ()
207207
if (ENABLE_TUI)
208208
if (EXISTS ${CMAKE_SOURCE_DIR}/lib/sealcurses/CMakeLists.txt)
209209
# Build a static version of SEALCurses.
210-
set (SEALCURSES_SUBDIR YES CACHE BOOL "")
211-
set (SEALCURSES_ENABLE_STATIC YES CACHE BOOL "")
212-
set (SEALCURSES_ENABLE_SHARED NO CACHE BOOL "")
213-
set (SEALCURSES_ENABLE_INSTALL NO CACHE BOOL "")
210+
set (SEALCURSES_SUBDIR YES CACHE BOOL "" FORCE)
211+
set (SEALCURSES_STATIC_NCURSES ${ENABLE_STATIC} CACHE BOOL "" FORCE)
212+
set (SEALCURSES_ENABLE_STATIC YES CACHE BOOL "" FORCE)
213+
set (SEALCURSES_ENABLE_SHARED NO CACHE BOOL "" FORCE)
214+
set (SEALCURSES_ENABLE_INSTALL NO CACHE BOOL "" FORCE)
214215
add_subdirectory (${CMAKE_SOURCE_DIR}/lib/sealcurses)
215216
else ()
216217
pkg_check_modules (SEALCURSES REQUIRED sealcurses)

lib/sealcurses

Submodule sealcurses updated from 7751a9a to fa54118

po/it.po

Lines changed: 72 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ msgstr ""
33
"Project-Id-Version: PACKAGE VERSION\n"
44
"Report-Msgid-Bugs-To: [email protected]\n"
55
"POT-Creation-Date: 2023-01-29 07:54+0000\n"
6-
"PO-Revision-Date: 2023-11-13 20:14+0000\n"
6+
"PO-Revision-Date: 2024-09-21 22:35+0000\n"
77
"Last-Translator: Omar Polo <[email protected]>\n"
88
"Language-Team: Italian <http://weblate.skyjake.fi/projects/lagrange/ui/it/>\n"
99
"Language: it\n"
@@ -370,7 +370,7 @@ msgid "dlg.cert.trust"
370370
msgstr "Fidati"
371371

372372
msgid "dlg.cert.fingerprint"
373-
msgstr "Copia Fingerprint"
373+
msgstr "Fingerprint"
374374

375375
#, c-format
376376
msgid "dlg.input.prompt"
@@ -1096,7 +1096,7 @@ msgid "menu.edit.notes"
10961096
msgstr "Modifica Note…"
10971097

10981098
msgid "ident.fingerprint"
1099-
msgstr "Copia Firma"
1099+
msgstr "Copia Fingerprint SHA-256"
11001100

11011101
msgid "ident.delete"
11021102
msgstr "Elimina Identità…"
@@ -2749,3 +2749,72 @@ msgid "error.showutf8.msg"
27492749
msgstr ""
27502750
"Il formato della pagina non è stato riconosciuto ma è testo correttamente "
27512751
"codificato in UTF-8."
2752+
2753+
msgid "heading.upload.edit"
2754+
msgstr "Modifica con Titan"
2755+
2756+
msgid "dlg.upload.edit.incompatible"
2757+
msgstr "Questo tipo di risorsa non può essere modificata nell'applicazione."
2758+
2759+
msgid "heading.upload.edit.error"
2760+
msgstr "Modifica Fallita"
2761+
2762+
msgid "dlg.upload.edit.error"
2763+
msgstr "Fallito lo scaricamento del contenuto della risorsa editabile."
2764+
2765+
msgid "ident.sendmsg"
2766+
msgstr "Manda messaggio come…"
2767+
2768+
msgid "heading.upload.misfin"
2769+
msgstr "Invia Messaggio Misfin"
2770+
2771+
msgid "heading.upload.error.file"
2772+
msgstr "File non valido"
2773+
2774+
msgid "heading.upload.misfin.noident"
2775+
msgstr "Nessuna Identità Misfin"
2776+
2777+
msgid "dlg.upload.misfin.noident"
2778+
msgstr ""
2779+
"È necessario importare un certificato Misfin per poter inviare messaggi."
2780+
2781+
msgid "heading.misfin.ok"
2782+
msgstr "Messaggio Inviato"
2783+
2784+
msgid "misfin.success"
2785+
msgstr "Il tuo messaggio è stato inviato con successo."
2786+
2787+
msgid "misfin.unauth"
2788+
msgstr "Non sei autorizzato per inviare messaggi a questo destinatario."
2789+
2790+
msgid "hint.upload.misfin"
2791+
msgstr "scrivi un messaggio"
2792+
2793+
# Only shown in a message box when CCing self fails.
2794+
msgid "misfin.cc"
2795+
msgstr "Mandando una Copia a Me Stesso"
2796+
2797+
# Only shown in a message box when verifying the recipient fails.
2798+
msgid "misfin.verify"
2799+
msgstr "Verificando il Destinatario"
2800+
2801+
msgid "misfin.unknown"
2802+
msgstr "Fallita la comunicazione con il server."
2803+
2804+
msgid "upload.from"
2805+
msgstr "Da:"
2806+
2807+
msgid "upload.to"
2808+
msgstr "A:"
2809+
2810+
msgid "misfin.self.copy"
2811+
msgstr "Mandami una copia"
2812+
2813+
msgid "upload.file.path"
2814+
msgstr "Percorso al file:"
2815+
2816+
msgid "dlg.cert.fingerprint.pubkey"
2817+
msgstr "Copia Chiave Pubblica SHA-256"
2818+
2819+
msgid "dlg.cert.fingerprint.full"
2820+
msgstr "Copia lo SHA-256 del Certificato"

res/about/version.gmi

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@
66
```
77
# Release notes
88

9+
## 1.18.1
10+
* macOS: Fixed opening Misfin URIs externally via system handlers.
11+
* Windows: Register Lagrange as a "misfin://" URL handler.
12+
* TUI: Fixed potentially garbled output.
13+
* TUI: Only link Curses statically when using CMake option `ENABLE_STATIC`.
14+
* Updated UI translations.
15+
916
## 1.18
1017

1118
New features:

res/lang/it.bin

122 Bytes
Binary file not shown.

src/app.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
8888
#if defined (iPlatformMsys)
8989
# include "win32.h"
9090
#endif
91+
#if defined (iPlatformTerminal)
92+
# undef LAGRANGE_ENABLE_IDLE_SLEEP
93+
#endif
9194
#if defined (LAGRANGE_ENABLE_X11_XLIB)
9295
# include "x11.h"
9396
#endif
@@ -1100,9 +1103,8 @@ static void communicateWithRunningInstance_App_(iApp *d, iProcessId instance,
11001103
#endif /* defined (LAGRANGE_ENABLE_IPC) */
11011104

11021105
static iBool hasCommandLineOpenableScheme_(const iRangecc uri) {
1103-
static const char *schemes[] = {
1104-
"gemini:", "gopher:", "finger:", "spartan:", "nex:", "guppy:", "file:", "data:", "about:"
1105-
};
1106+
static const char *schemes[] = { "gemini:", "gopher:", "finger:", "spartan:", "nex:",
1107+
"misfin:", "guppy:", "file:", "data:", "about:" };
11061108
iForIndices(i, schemes) {
11071109
if (startsWithCase_Rangecc(uri, schemes[i])) {
11081110
return iTrue;
@@ -2017,6 +2019,7 @@ void processEvents_App(enum iAppEventMode eventMode) {
20172019
startsWithCase_CStr(ev.drop.file, "gopher:") ||
20182020
startsWithCase_CStr(ev.drop.file, "spartan:") ||
20192021
startsWithCase_CStr(ev.drop.file, "nex:") ||
2022+
startsWithCase_CStr(ev.drop.file, "misfin:") ||
20202023
startsWithCase_CStr(ev.drop.file, "file:")) {
20212024
postCommandf_Root(NULL, "~open newtab:1 url:%s", ev.drop.file);
20222025
}

src/x11.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ iBool isXSession_X11(void) {
3535
if (driver && !iCmpStr(driver, "wayland")) {
3636
return iFalse;
3737
}
38+
const char *dpy = getenv("DISPLAY");
39+
if (!dpy || strlen(dpy) == 0) {
40+
return iFalse;
41+
}
3842
return iTrue; /* assume yes if this source file is being used */
3943
}
4044

@@ -51,15 +55,15 @@ void setDarkWindowTheme_SDLWindow(SDL_Window *d, iBool setDark) {
5155
Atom u8 = XInternAtom(dpy, "UTF8_STRING", False);
5256
const char *value = setDark ? "dark" : "light";
5357
XChangeProperty(dpy, wnd, prop, u8, 8, PropModeReplace,
54-
(unsigned char *) value, strlen(value));
58+
(unsigned char *) value, strlen(value));
5559
}
5660
}
5761

5862
void handleCommand_X11(const char *cmd) {
5963
if (!isXSession_X11()) {
6064
return;
6165
}
62-
if (equal_Command(cmd, "theme.changed")) {
66+
if (equal_Command(cmd, "theme.changed")) {
6367
iConstForEach(PtrArray, iter, mainWindows_App()) {
6468
iMainWindow *mw = iter.ptr;
6569
setDarkWindowTheme_SDLWindow(

0 commit comments

Comments
 (0)