aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2021-03-07README: Fix Accessibility Controls steps to invert coloursHEADmasterTeddy Wing
2021-03-07README: Add instructions for starting the Launchd serviceTeddy Wing
2021-03-07Update TODOTeddy Wing
2021-03-07Makefile: Add rules to build a distribution tarballv0.0.1Teddy Wing
2021-03-07Add launchd plistTeddy Wing
Run the program on login.
2021-03-07main: Add a version string and command line argument to get the versionTeddy Wing
2021-03-07Make `E_REGISTER_HOTKEY` a static constantTeddy Wing
Probably better type checking with this than the `#define`.
2021-03-07Add READMETeddy Wing
2021-03-07Add license (GNU GPLv3+)Teddy Wing
2021-03-07Makefile: Add a `clean` targetTeddy Wing
Give us a way to remove all build files.
2021-03-07Makefile: Annotate `all` target as phonyTeddy Wing
2021-03-07Makefile: Finalise the executable nameTeddy Wing
2021-03-07Makefile: Create build directoriesTeddy Wing
Ensure the build directories are available when building. Read up on techniques for creating directories in prerequisites here: https://www.cmcrossroads.com/article/making-directories-gnu-make
2021-03-07Switch 'DDHotKey' to 'teddywing/DDHotKey' forkTeddy Wing
Use my public fork that fixes errors and warnings found on Mac OS X 10.15 Catalina.
2021-03-07Makefile: Fix link error for `UCKeyTranslate`Teddy Wing
The linker complained about `_UCKeyTranslate` being undefined. It's used by DDHotKey, and is defined in `CoreServices.framework`, so we need to link CoreServices. Here's the error I was getting: clang -x objective-c \ -mmacosx-version-min=10.7 \ -framework Carbon \ -framework Cocoa \ -framework CoreGraphics \ -framework Foundation \ -fno-objc-arc \ -I./build/include \ -L./build \ -lddhotkey \ -o invert-catalina-invert \ Invert.h Invert.m main.m Undefined symbols for architecture x86_64: "_UCKeyTranslate", referenced from: _DDStringFromKeyCode in libddhotkey.a(DDHotKeyUtilities.o) ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)
2021-03-07Makefile: Set minimum Mac OS X version to 10.7Teddy Wing
Build for as early a Mac OS X version as we can. Can't build for 10.5 because only 10.6+ supports ARC. Can't build for 10.6 because DDHotKey requires weak references, and these are only supported starting in 10.7: https://en.wikipedia.org/w/index.php?title=Weak_reference&oldid=1000364515#Objective-C_2.0
2021-03-07Makefile: Don't copy DDHotKey headers multiple timesTeddy Wing
Previously, the rule was copying all header files for every header file: cp lib/DDHotKey/Compatibility.h lib/DDHotKey/DDHotKeyAppDelegate.h lib/DDHotKey/DDHotKeyCenter.h lib/DDHotKey/DDHotKeyTextField.h lib/DDHotKey/DDHotKeyUtilities.h build/include/ cp lib/DDHotKey/Compatibility.h lib/DDHotKey/DDHotKeyAppDelegate.h lib/DDHotKey/DDHotKeyCenter.h lib/DDHotKey/DDHotKeyTextField.h lib/DDHotKey/DDHotKeyUtilities.h build/include/ cp lib/DDHotKey/Compatibility.h lib/DDHotKey/DDHotKeyAppDelegate.h lib/DDHotKey/DDHotKeyCenter.h lib/DDHotKey/DDHotKeyTextField.h lib/DDHotKey/DDHotKeyUtilities.h build/include/ cp lib/DDHotKey/Compatibility.h lib/DDHotKey/DDHotKeyAppDelegate.h lib/DDHotKey/DDHotKeyCenter.h lib/DDHotKey/DDHotKeyTextField.h lib/DDHotKey/DDHotKeyUtilities.h build/include/ cp lib/DDHotKey/Compatibility.h lib/DDHotKey/DDHotKeyAppDelegate.h lib/DDHotKey/DDHotKeyCenter.h lib/DDHotKey/DDHotKeyTextField.h lib/DDHotKey/DDHotKeyUtilities.h build/include/ Change it to only copy once per header: cp lib/DDHotKey/Compatibility.h build/include/ cp lib/DDHotKey/DDHotKeyAppDelegate.h build/include/ cp lib/DDHotKey/DDHotKeyCenter.h build/include/ cp lib/DDHotKey/DDHotKeyTextField.h build/include/ cp lib/DDHotKey/DDHotKeyUtilities.h build/include/
2021-03-07Makefile: Stop suppressing warnings when compiling `DDHotKey`Teddy Wing
Fixed the warnings in a fork.
2021-03-07Makefile: Remove `-framework` arguments when building DDHotKey obj filesTeddy Wing
I was getting warnings that these arguments are unused because we're not linking anything in this command: $ clang -x objective-c \ -framework Carbon \ -framework Cocoa \ -framework Foundation \ -fobjc-arc \ -c \ lib/DDHotKey/DDHotKeyCenter.m clang: warning: -framework Carbon: 'linker' input unused [-Wunused-command-line-argument] clang: warning: -framework Cocoa: 'linker' input unused [-Wunused-command-line-argument] clang: warning: -framework Foundation: 'linker' input unused [-Wunused-command-line-argument]
2021-03-07Makefile: Compile DDHotKey object files individuallyTeddy Wing
Need to input each file individually to get object files for each one.
2021-03-07Makefile: Remove unused codeTeddy Wing
These lines are old and unused.
2021-03-07invertColors: Log errorsTeddy Wing
2021-03-07toggleInvertColors:: Remove debug `NSLog` messageTeddy Wing
Added this for testing, but it no longer makes sense.
2021-03-07register_hotkeys: Add error handlingTeddy Wing
Fail to start if we can't register hotkeys.
2021-03-07Add TODOTeddy Wing
2021-03-07Invert: Move `inverted_gamma` to static constTeddy Wing
Since this is a literal, it can be declared statically.
2021-03-07main: Move hotkey registration to a new functionTeddy Wing
Split this into a more descriptive function. Still need to set up proper error handling.
2021-03-07main: Register F8 hotkey to toggle colour inversionTeddy Wing
Allow toggling with both <C-M-D-8> and <F8>.
2021-03-07main: Autorelease `Invert` instanceTeddy Wing
Ensure the object is released.
2021-03-07main: Remove infinite loop and sleep codeTeddy Wing
Replaced by `[NSApp run]`.
2021-03-07Toggle colour inversion on global hotkeyTeddy Wing
When the registered global hotkey is pressed, toggle screen colour inversion. Move the colour inversion code to the `Invert` class.
2021-03-07Register a global hotkeyTeddy Wing
Build DDHotKey as a static library so we can compile it with ARC turned on and our project with ARC turned off. Since DDHotKey is written with ARC, if I include its headers directly, I'd need to enable ARC on my project in order to compile it. Initialise an `NSApplication` to give us an environment in which to register the global hotkey. A new class `Invert` will respond to the hotkey and respond accordingly.
2021-03-05Makefile: Fix `CoreGraphics` framework capitalisationTeddy Wing
2021-03-05Add 'DDHotKey' libraryTeddy Wing
Trying this out for registering a global hotkey.
2021-03-04Reset colours to their original stateTeddy Wing
Found an easy function to remove the colour inversion. Now I need to enable toggling between the two with a keyboard shortcut.
2021-03-04Invert all displaysTeddy Wing
Previously, I was only inverting the main display. Get a list of active displays and invert all of them. Decided to set the maximum display count to eight because that seemed like a sufficiently high number for most people.
2021-03-04Rename `gamma` table to `inverted_gamma`Teddy Wing
More descriptive this way.
2021-03-04Skeleton for error handlingTeddy Wing
2021-03-04Remove unused `CGGammaValue` tablesTeddy Wing
2021-03-04Run foreverTeddy Wing
Rather than sleeping, keep the program active until it's exited manually.
2021-03-03Try inverting display coloursTeddy Wing
Invert the screen colours for as long as the program is active. Only works on the main display currently. Inspired by Nikolai Ruhe's (https://stackoverflow.com/users/104790/nikolai-ruhe) answer on Stack Overflow about screen colour inversion: https://stackoverflow.com/questions/14163788/how-does-on-screen-color-inversion-work-in-os-x/14165523#14165523 and this question: https://stackoverflow.com/questions/32823023/permanently-modifying-rgb-gamma-table