Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 92 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# Builds and tests the three apps and the library they share
name: Build

on:
push:
branches: [main]
pull_request:
workflow_dispatch:

permissions:
contents: read

jobs:
linux:
name: Linux (GTK 4)
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Packages
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
cmake ninja-build pkg-config libgtk-4-dev libadwaita-1-dev \
libvte-2.91-gtk4-dev
- name: Build
run: |
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo
cmake --build build
- name: Test
run: ctest --test-dir build --output-on-failure
- name: Test with the sanitizers
run: |
cmake -S . -B build-asan -G Ninja -DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_C_FLAGS="-fsanitize=address,undefined -fno-sanitize-recover=all"
cmake --build build-asan --target dmodemctl_test
ctest --test-dir build-asan --output-on-failure

windows-9x:
name: Windows 95 and later (Open Watcom)
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: open-watcom/setup-watcom@v0
with:
version: "2.0"
- name: Build
run: sh windows/build-watcom.sh build/watcom
- uses: actions/upload-artifact@v4
with:
name: dmodem-windows-9x
path: build/watcom/dmodem.exe

windows:
name: Windows (MSVC)
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Build
run: |
cmake -S . -B build -A Win32
cmake --build build --config Release
- name: Test
run: ctest --test-dir build -C Release --output-on-failure
- uses: actions/upload-artifact@v4
with:
name: dmodem-windows
path: build/windows/Release/dmodem.exe

macos:
name: macOS (SwiftUI)
runs-on: macos-15
steps:
- uses: actions/checkout@v4
- name: Library tests
run: |
cmake -S . -B build -DCMAKE_BUILD_TYPE=RelWithDebInfo
cmake --build build
ctest --test-dir build --output-on-failure
- name: Project
run: |
brew install xcodegen
cd macos && xcodegen
- name: Build
run: |
cd macos
xcodebuild -project DModem.xcodeproj -scheme DModem \
-configuration Release -derivedDataPath ../build/xcode \
CODE_SIGN_IDENTITY=- build
- uses: actions/upload-artifact@v4
with:
name: dmodem-macos
path: build/xcode/Build/Products/Release/D-Modem.app
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
build/
build-*/
.vs/
bin/
obj/
*.user
.build/
.swiftpm/
*.xcodeproj/xcuserdata/
DerivedData/
.flatpak-builder/
32 changes: 32 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# D-Modem's desktop apps: the shared C core (libdmodemctl), and the
# Linux app (GTK 4 and libadwaita) when its libraries are there, or the
# Windows app with MinGW or MSVC. The Windows 95 build of the Windows
# app (windows/build-watcom.sh) and the macOS app (macos/) build with
# their own tools and take the core from here.
cmake_minimum_required(VERSION 3.16)
project(dmodem-gui VERSION 1.0.0 LANGUAGES C)

set(CMAKE_C_STANDARD 11)
set(CMAKE_C_STANDARD_REQUIRED ON)

option(DMODEM_GUI_LINUX "Build the GTK 4 app (linux/)" ON)

add_subdirectory(core)
enable_testing()
add_subdirectory(core/test)

if(WIN32)
add_subdirectory(windows)
endif()

if(DMODEM_GUI_LINUX AND UNIX AND NOT APPLE)
find_package(PkgConfig)
if(PkgConfig_FOUND)
pkg_check_modules(GTK IMPORTED_TARGET gtk4>=4.10 libadwaita-1>=1.5 vte-2.91-gtk4)
endif()
if(GTK_FOUND)
add_subdirectory(linux)
else()
message(STATUS "gtk4, libadwaita-1 or vte-2.91-gtk4 not found: the Linux app is not built")
endif()
endif()
61 changes: 60 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,62 @@
<img src=".github/banner.png" alt="D-Modem/gui: D-Modem on the desktop" width="100%">

# gui
# D-Modem desktop apps

Native apps for D-Modem on Windows, macOS and Linux.

Each app starts dmodemd (or reaches one that already runs), and shows the
modem as a desktop program should: dial and answer from a window, change
its settings without AT commands, and see how the last call went. All three
are thin native shells over one small C library, libdmodemctl, so they
behave the same.

- **Modem**: the call's state, dial, answer and hang up, and the line it uses
- **Terminal**: the AT console, and the modem's own setup screens (AT!CF, AT!CT)
- **Settings**: every modem setting as a native control, from AT!M
- **Call Stats**: the last call's rate, modulation, error control and line figures (AT#UD, ATI11)
- **Line settings**: a SIP account, a USB modem, or a modem that already runs
- **Windows 95 and later**: plain Win32, built with Open Watcom; on Windows 9x it reaches a modem over TCP or a COM port

| | Windows | macOS | Linux |
| --- | --- | --- | --- |
| Toolkit | Win32, C++ | SwiftUI | GTK 4, libadwaita, VTE |
| Runs on | Windows 95 and later | macOS 13 and later | GTK 4.10, libadwaita 1.5 and VTE 0.76 or later (Ubuntu 24.04, Fedora 40) |

<img src="docs/images/linux-settings.png" width="49%" alt="The Linux app's Settings page"> <img src="docs/images/windows-setup-screen.png" width="49%" alt="The Windows app's Terminal with the modem's setup screen">

## Quick start

Linux:

sudo apt install cmake libgtk-4-dev libadwaita-1-dev libvte-2.91-gtk4-dev
cmake -S . -B build && cmake --build build && ./build/linux/dmodem-gui

Windows: `cmake -S . -B build -A Win32 && cmake --build build --config Release`,
or for Windows 95 and later, `windows/build-watcom.sh` with Open Watcom 2.0.

macOS: `brew install xcodegen && cd macos && xcodegen && open DModem.xcodeproj`.

The Settings page needs a dmodemd with AT!M (D-Modem's main branch since
D-Modem/D-Modem#103); the other pages work with any D-Modem 1.0.

## Documentation

- [Design](docs/design.md): how the apps are built, what they share, and the Windows 9x notes
- [libdmodemctl](core/include/dmodemctl.h): the library's API

## The D-Modem suite

| Repository | What it is |
| --- | --- |
| [D-Modem](https://github.com/D-Modem/D-Modem) | The open V.92 softmodem: dmodemd, libdmodem and the Asterisk, FreeSWITCH and ARI modules |
| [app](https://github.com/D-Modem/app) | The D-Modem app for Android and iOS: a dial-up modem on a SIP call |
| [gui](https://github.com/D-Modem/gui) | D-Modem on the desktop: native apps for Windows, macOS and Linux |
| [hardware](https://github.com/D-Modem/hardware) | pico-serial: RP2040 serial adapters and phone-line USB sticks |
| [menu](https://github.com/D-Modem/menu) | modemmenu: the login and menu dial-up callers reach |
| [bbs](https://github.com/D-Modem/bbs) | A bulletin board for telnet, SSH, TN3270 and modem callers |
| [go3270](https://github.com/D-Modem/go3270) | A Go library for 3270 terminal servers, used by bbs |
| [brand](https://github.com/D-Modem/brand) | Logos, colours, type and the naming guide |

## Licence

BSD 3-Clause ([LICENSE](LICENSE)).
5 changes: 5 additions & 0 deletions assets/dmodem.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 26 additions & 0 deletions core/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# libdmodemctl: what the desktop apps share, in plain C with no
# dependencies. Static for the Linux app; a DLL for the Windows app's
# P/Invoke (-DDMODEMCTL_SHARED=ON).
option(DMODEMCTL_SHARED "Build libdmodemctl as a shared library" OFF)

set(DMODEMCTL_SOURCES
src/session.c
src/model.c
src/diag.c
src/vt.c
src/daemon.c
src/util.c)

if(DMODEMCTL_SHARED)
add_library(dmodemctl SHARED ${DMODEMCTL_SOURCES})
target_compile_definitions(dmodemctl PRIVATE DMC_BUILD_DLL)
set_target_properties(dmodemctl PROPERTIES C_VISIBILITY_PRESET hidden)
else()
add_library(dmodemctl STATIC ${DMODEMCTL_SOURCES})
endif()
target_include_directories(dmodemctl PUBLIC include)
if(MSVC)
target_compile_options(dmodemctl PRIVATE /W4 /wd4996)
else()
target_compile_options(dmodemctl PRIVATE -Wall -Wextra -Wshadow)
endif()
Loading
Loading