Maintained by Elefunc, Inc. · https://elefunc.com
trim/trim.c: Primary Win32 entry point, message loop, trimming logic, and icon loading. Keep platform-specific code here and prefer static helpers over new translation units until complexity demands otherwise.trim.rc: Resource script linkingtrim/trim.icoas the main application icon; update IDs here when adding resources.trim.h: Shared resource identifiers consumed by both the resource script and the C runtime.trim.ico: Multi-resolution icon generated fromtrim/trim.png; update viaconvert trim/trim.png -define icon:auto-resize=256,128,64,48,32,16 trim/trim.ico.trim.png: Source artwork for the Trim application icon—regenerate.icovariants from this PNG.Makefile: Cross-build orchestration. Targetstrim32.exeandtrim64.exewith shared warning flags and resource compilation. Add new source files via theSRCvariable before introducing subdirectories.
paste/paste.c: Win32 console utility that emits clipboard text (UTF-8) or images (PNG) to stdout. Keep clipboard-specific helpers local until the feature set justifies additional files.paste.rc: Version resource metadata compiled into both paste binaries. Update here when bumping versions or changing company/product strings.Makefile: Dedicated build script forpaste32.exeandpaste64.exe, sharing warning flags and link settings with the top-level build.
cd trim && make: Builds both Trim executables using mingw-w64 cross-compilers. Outputs land inside thetrimdirectory.cd trim && make clean: Removes generated Trim artifacts. Run before committing to keep the repo binary-free.cd paste && make: Buildspaste64.exeandpaste32.exewith the same toolchain defaults. Pair withcd paste && make cleanwhen tidying the workspace.- Both builds emit intermediate
.resfiles (e.g.,trim/trim64.res,paste/paste64.res) generated bywindres; they are safe to delete via each directory'smake clean. wine trim/trim64.exe(optional): Quick smoke test on Linux hosts with Wine; confirm console logs appear and clipboard updates succeed../paste/paste64.exe --text(optional): Validate text clipboard capture on Windows or WSL->Windows clipboard; append--imageand redirect stdout to verify PNG output.
- Target C11 (
-std=c11) with UTF-16 Windows APIs. Maintain 2-space indentation and brace-on-same-line style already present intrim.c. - Prefer descriptive static helpers (e.g.,
handle_clipboard_update) and snake_case identifiers. - Log messages should remain concise, capitalized, and timestamp-friendly to preserve console readability.
- Run
clang-format -i trim/trim.cbefore committing; configuration lives in.clang-format.
- No automated tests yet. After building, validate manually on Windows by running
trim/trim64.exe, then issuingecho " sample text " | clipto confirm whitespace trimming and log output. - Check both CRLF and LF-only sources (e.g., paste from Notepad and from WSL) to ensure line break preservation.
- Document new edge cases in pull requests so future automation can capture them.
- Follow the existing concise, imperative commit style (e.g., "Add clipboard trimmer source and build"). Keep scope narrow and explain user-facing behavior changes in the body when needed.
- Pull requests should link relevant issues, summarize behavior changes, list manual tests (commands run, environments), and include screenshots of console logs when they help reviewers.
- Update version references
- Edit
trim/trim.rcand bumpFILEVERSION,PRODUCTVERSION, and theStringFileInfoFileVersion/ProductVersionstrings to the new semantic version (e.g.,0.5.2). - Regenerate the build after editing to refresh
trim/trim32.res/trim/trim64.res. - Commit the change with a message like
Bump version to 0.x.yand push it upstream.
- Edit
- Make a clean build
- Run
cd trim && make cleanto remove prior artifacts. - Run
cd trim && maketo rebuildtrim32.exeandtrim64.exe; confirm both executables are produced without warnings.
- Run
- Make a GitHub release
- Tag the release (
git tag -a v0.x.y -m "Cliptrim 0.x.y"andgit push origin v0.x.y). - Publish it with the CLI:
gh release create v0.x.y trim/trim64.exe trim/trim32.exe paste/paste64.exe paste/paste32.exe --title "Cliptrim 0.x.y" --notes "<bullet summary + checks>". - Double-check the release page to ensure all four executables and notes rendered correctly.
- Tag the release (
- Cross-compilers (
x86_64-w64-mingw32-gcc,i686-w64-mingw32-gcc) are expected locally; verify versions before onboarding. - On Ubuntu 24.04, install the toolchain via
sudo apt install mingw-w64before runningmake. - Avoid adding compiled binaries to version control. Update
.gitignoreif new build artifacts emerge. - When editing, prefer
apply_patchor targeted diffs to keep reviews small and traceable.
Cliptrim is an Elefunc, Inc. project — reach us at https://elefunc.com for support.
