Add changelog, uniform naming, prepare v0.2.0 tagging #18
14
.gitignore
vendored
14
.gitignore
vendored
@@ -1,6 +1,5 @@
|
|||||||
# Folder
|
# Folder
|
||||||
builddir/
|
builddir/
|
||||||
ptouch-print/
|
|
||||||
subprojects/*
|
subprojects/*
|
||||||
.cache/
|
.cache/
|
||||||
coverageReport/
|
coverageReport/
|
||||||
@@ -12,3 +11,16 @@ ptprnt.log
|
|||||||
!.vscode/c_cpp_properties.json
|
!.vscode/c_cpp_properties.json
|
||||||
!.vscode/settings.json
|
!.vscode/settings.json
|
||||||
!.vscode/launch.json
|
!.vscode/launch.json
|
||||||
|
|
||||||
|
# ignore generated testlabels
|
||||||
|
fakelabel_*.png
|
||||||
|
|
||||||
|
# ignore package capture files
|
||||||
|
*.pcapng
|
||||||
|
*.pcapng.gz
|
||||||
|
*.pcap
|
||||||
|
*.pcap.gz
|
||||||
|
|
||||||
|
# ignore coverage temporaries
|
||||||
|
*.gcov.json
|
||||||
|
*.gcov.json.gz
|
||||||
70
CHANGELOG.md
Normal file
70
CHANGELOG.md
Normal file
@@ -0,0 +1,70 @@
|
|||||||
|
# Changelog
|
||||||
|
|
||||||
|
All notable changes to ptprnt will be documented in this file.
|
||||||
|
|
||||||
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||||
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
|
## [0.2.0] - v0.2.0
|
||||||
|
|
||||||
|
### Added
|
||||||
|
- Multi-label support - print multiple labels in sequence
|
||||||
|
- LabelBuilder API with fluent interface for constructing labels
|
||||||
|
- FakePrinter driver for testing without hardware (outputs PNG files)
|
||||||
|
- PrinterService core service for printer operations
|
||||||
|
- CliParser component with ICliParser interface
|
||||||
|
- ICairoWrapper interface for testable graphics rendering
|
||||||
|
- MockCairoWrapper for unit testing
|
||||||
|
- Pre-commit hook for automatic copyright updates
|
||||||
|
- USB trace mode for debugging (`-Dusb_trace_only=true`)
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- **Major refactoring**: Reorganized codebase into layered architecture
|
||||||
|
- Application layer: PtouchPrint, CliParser, PrinterService
|
||||||
|
- Printer drivers: Moved to `src/printers/` with factory pattern
|
||||||
|
- Graphics system: Added builder pattern and Cairo abstraction
|
||||||
|
- Core services: Separated into `src/core/` directory
|
||||||
|
- Label class now uses dependency injection for Cairo/Pango
|
||||||
|
- CLI parsing separated from main application logic
|
||||||
|
- Updated dependencies to latest versions
|
||||||
|
- Improved project documentation (README.md, CLAUDE.md)
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Label corruption issues resolved
|
||||||
|
- Printer info retrieval bugs
|
||||||
|
- USB attachment logic
|
||||||
|
- Multiple lines handling in labels
|
||||||
|
- Printer selection logic
|
||||||
|
|
||||||
|
## [0.1.0] - 2024
|
||||||
|
|
||||||
|
### Added
|
||||||
|
- Initial release of ptprnt
|
||||||
|
- Basic label printing functionality for Brother P-touch P700 series
|
||||||
|
- Pango/Cairo-based text rendering
|
||||||
|
- USB device communication via libusb-1.0
|
||||||
|
- Template-based Bitmap class supporting multiple pixel formats (ALPHA8, RGBX8, RGBA8, ARGB8)
|
||||||
|
- Monochrome bitmap conversion for printer output
|
||||||
|
- PrinterDriverFactory for creating printer instances
|
||||||
|
- USB device abstraction layer (IUsbDevice, UsbDevice, UsbDeviceFactory)
|
||||||
|
- Command-line interface using CLI11
|
||||||
|
- Logging with spdlog and file output
|
||||||
|
- Unit tests using GoogleTest
|
||||||
|
- Code coverage reporting with gcovr
|
||||||
|
- Meson build system with C++20 support
|
||||||
|
- CI/CD pipeline with automated testing
|
||||||
|
|
||||||
|
### Core Components (v0.1.0)
|
||||||
|
- PtouchPrint: Main application orchestrator
|
||||||
|
- P700Printer: Brother P-touch P700 driver implementation
|
||||||
|
- Bitmap: Template-based image storage
|
||||||
|
- Label: Text rendering with Pango/Cairo
|
||||||
|
- Monochrome: Bitmap to monochrome conversion
|
||||||
|
- UsbDevice: libusb wrapper for device communication
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Project Origins
|
||||||
|
|
||||||
|
ptprnt is a modern C++20 rewrite of [ptouch-print](https://git.familie-radermacher.ch/linux/ptouch-print.git).
|
||||||
|
All credits for reverse engineering the Brother P-touch USB protocol go to Dominic Rademacher.
|
||||||
69
README.md
69
README.md
@@ -1,57 +1,50 @@
|
|||||||
# ptprnt
|
# ptprnt
|
||||||
|
|
||||||
This is a rewrite of [ptouch-print](https://git.familie-radermacher.ch/linux/ptouch-print.git) as a toy project for my personal amusement. The currently available solutions are good enough for generating labels, but i wanted to explore libusb and maybe improve the functionality of my label printer. All credits for reverse engineering the USB commands to Dominic Rademacher.
|
A command-line label printer driver for Brother P-touch printers on Linux. Prints text labels directly from your terminal.
|
||||||
|
|
||||||
## Dependencies
|
## Quick Start
|
||||||
This project requires:
|
|
||||||
- spdlog
|
|
||||||
- libusb
|
|
||||||
- pango
|
|
||||||
- cairo
|
|
||||||
- meson
|
|
||||||
- gtest (optional, for testing, will be installed by meson)
|
|
||||||
- gcov (optional, for coverage reports)
|
|
||||||
|
|
||||||
Install dependencies on Arch Linux
|
**Install dependencies:**
|
||||||
``` bash
|
|
||||||
pacman -S libusb spdlog pango cairo meson gcovr
|
|
||||||
```
|
|
||||||
|
|
||||||
Install dependencies on Debian/Ubuntu
|
|
||||||
``` bash
|
|
||||||
apt-get install libusb-1.0-0-dev libspdlog-dev libfmt-dev libpango1.0-dev libcairo2-dev meson gcovr
|
|
||||||
```
|
|
||||||
|
|
||||||
## Build
|
|
||||||
|
|
||||||
Clone the repository and simply let meson do the heavy lifting.
|
|
||||||
|
|
||||||
|
Arch Linux:
|
||||||
```bash
|
```bash
|
||||||
meson setup builddir
|
pacman -S libusb spdlog pango cairo meson
|
||||||
```
|
|
||||||
If you want to generate coverage reports, enable them via the command line switch
|
|
||||||
```bash
|
|
||||||
meson setup builddir -Db_coverage=true
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Rebuild by simply invoking ninja
|
Debian/Ubuntu:
|
||||||
```bash
|
```bash
|
||||||
|
apt-get install libusb-1.0-0-dev libspdlog-dev libfmt-dev libpango1.0-dev libcairo2-dev meson
|
||||||
|
```
|
||||||
|
|
||||||
|
**Build and run:**
|
||||||
|
Clone this repository first and enter the directory. Then build:
|
||||||
|
```bash
|
||||||
|
meson setup builddir
|
||||||
ninja -C builddir
|
ninja -C builddir
|
||||||
|
builddir/ptprnt --help
|
||||||
```
|
```
|
||||||
|
|
||||||
## Run
|
## Supported Printers
|
||||||
Run the binary from your builddir
|
(I need more printers for verification 😉)
|
||||||
```bash
|
|
||||||
builddir/ptprnt
|
|
||||||
```
|
|
||||||
|
|
||||||
## Test
|
- Brother P-touch P700 series
|
||||||
Testing is done via gtest. To run your test simply invoke ninja with the "test" target.
|
|
||||||
|
## Developer info
|
||||||
|
|
||||||
|
This is a modern C++20 rewrite of [ptouch-print](https://git.familie-radermacher.ch/linux/ptouch-print.git). Credits to Dominic Rademacher for reverse engineering the USB protocol.
|
||||||
|
|
||||||
|
**Running tests:**
|
||||||
```bash
|
```bash
|
||||||
ninja -C builddir test
|
ninja -C builddir test
|
||||||
```
|
```
|
||||||
|
|
||||||
Coverage reports can be generated via gcov if you enabled them (see Build section) by building the `coverage-text` target.
|
**Coverage reports:**
|
||||||
|
```bash
|
||||||
|
meson setup builddir -Db_coverage=true
|
||||||
|
ninja -C builddir
|
||||||
|
ninja -C builddir test
|
||||||
|
ninja -C builddir coverage-text
|
||||||
|
```
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ HTML_COV_PATH="coverageReport/html"
|
|||||||
XML_COV_PATH="coverageReport/xml"
|
XML_COV_PATH="coverageReport/xml"
|
||||||
HTML_START_FILE="index.html"
|
HTML_START_FILE="index.html"
|
||||||
|
|
||||||
echo "Generating Coverage report for ptouch-prnt"
|
echo "Generating Coverage report for ptprnt"
|
||||||
|
|
||||||
ninja -C builddir
|
ninja -C builddir
|
||||||
ninja -C builddir test
|
ninja -C builddir test
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# Git Hooks
|
# Git Hooks
|
||||||
|
|
||||||
This directory contains git hooks for the ptouch-prnt repository.
|
This directory contains git hooks for the ptprnt repository.
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# Install git hooks for ptouch-prnt repository
|
# Install git hooks for ptprnt repository
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
# Test file
|
|
||||||
Reference in New Issue
Block a user