aboutsummaryrefslogtreecommitdiffstats
path: root/src/Document.m
AgeCommit message (Collapse)Author
2023-09-30Switch to the 0BSD licenseTeddy Wing
Since this is intended to be template code upon which to build a full application, I didn't like that the prior license required the full license text to be reproduced in distributions. I want the code to be a base for developers to use when starting a Cocoa application, like the template code that's generated in a new Xcode project. As such, I want people to be allowed to remove my license when distributing the code.
2023-09-30Add license (primarily BSD-3-Clause)Teddy Wing
Set a BSD-3-Clause license on all the application code so that it can be freely used as a base template for an application. Use the GNU GPLv3+ for the log script as it's a helper utility that isn't compiled into the application.
2023-09-29Document: Remove up old setup codeTeddy Wing
2023-09-29Document: Clean up cascade_offset codeTeddy Wing
Remove the old test code now that this is working.
2023-09-29Document: Fix window cascadeTeddy Wing
Removing the pointer fixed the cascade, and now new document windows open shifted by a full titlebar height. Did a bit of searching on GitHub for `-cascadeTopLeftFromPoint:` and found this code that does what I was trying to do: https://github.com/dsa28s/android-studio-apple-m1/blob/c555e84728bfd82a0f9e705af012da37fb52291f/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTWindow.m#L1399 The above code taught me about the `NSEqualPoints` function, which is basically what I wanted to initialise the variable. But now I suppose I don't actually need to do an initialisation of the variable.
2023-09-29Document: Trying to debug `cascade_offset`Teddy Wing
Add some debug logs to see why the window cascade isn't shifting by the height of a titlebar. `cascade_offset` appears to be changing values in an inconsistent way and I haven't yet figured out what I'm doing wrong.
2023-09-26Document: Initial attempt to cascade new document windowsTeddy Wing
When creating a new document with Apple-N, try to cascade the new window so that it opens a bit below and to the right of the previous window. Store the previous window origin in a static variable for a relative reference point. Currently this seems to cascade, but not by a full titlebar height and corresponding horizontal position. Needs some adjustment.
2023-09-25Document: Add placeholder labelTeddy Wing
Add a "Your document contents here" label to the center of the NSDocument window similar to the one that Xcode's document-based app template. Took inspiration from this Stack Overflow answer to get the center point of the window's content view: https://stackoverflow.com/questions/6560842/getting-the-center-point-of-an-nsview/14811056#14811056
2023-09-16Make a document-based applicationTeddy Wing
Add the basic necessities for a document-based application. This is what I came up with on 2023-09-10. The `DocumentWindowController` was just an initial idea and doesn't do anything: we create the required window controller in `Document`. The `CFBundleDocumentTypes` entry enables us to interact with text files. This confirms that the "Open Recent" menu does get added automatically below the "Open" menu.