Commit Graph

126 Commits

Author SHA1 Message Date
Dietrich Epp
cb701d0796 Update README to reflect new licensing 2023-05-07 22:11:06 -04:00
Dietrich Epp
59e3376f8c Handle open document Apple Event
Double-clicking on a project in the Finder will now open that project.
2023-05-07 21:46:55 -04:00
Dietrich Epp
1396fb1cbf Handle Apple events
Currently, only the 'open application' event is actually handled, but
handlers for the required core events are installed. The open
application event causes the program to create a new document when
opened.
2023-05-07 03:30:51 -04:00
Dietrich Epp
1f1407bb0e Add project menu with upload/download items 2023-05-07 01:51:00 -04:00
Dietrich Epp
37929beede Fix beep when selecting no menu item 2023-05-07 01:43:19 -04:00
Dietrich Epp
c1862532b8 Implement opening projects 2023-05-06 22:55:06 -04:00
Dietrich Epp
4a99288be2 Parse project chunks
This still doesn't show the project on-screen when opening, but it does
parse the chunks inside the project file.
2023-05-06 22:24:50 -04:00
Dietrich Epp
4cf55bffbc Fix button text for alerts
It turns out that ParamText does not substitute text in buttons. To make
alerts with different button text, there are now multiple alert
resources.
2023-05-06 21:56:00 -04:00
Dietrich Epp
08e5f10ce4 Parse project file header
On opening a project, SyncFiles will now parse the project header and
present an error message if there are any problems with the header.
2023-05-06 21:36:33 -04:00
Dietrich Epp
f8c84387ca Refactor project new/delete functions
These are separated so we can create project objects by creating a new
project or opening an existing one.
2023-05-06 20:37:45 -04:00
Dietrich Epp
8514bbfff6 Remove unused code
The strutil code has mostly been replaced by the new `PStrBuilder` type,
and the remaining function from strutil was really just a checked memcpy
in one place which is now moved inline.

The `EXIT_ASSERT` macro is obsolete and has been removed.
2023-05-06 20:25:00 -04:00
Dietrich Epp
b1bcae531b Rework error handling
Previously, various error handling functions were defined, but not all
of them were even used. The new error handling functions handle the most
common cases:

- Assertions. These can be handled with `ASSERT()`, which gives the
  error location for debugging.

- Errors we don't know how to handle, like GetNewWindow returning NULL.
  These can be handled with `EXIT_INTERNAL()`, which gives the error
  location for debugging.

- Out of memory conditions. These can be handled with `ShowMemError()`.

- System errors in response to user operations. These can be handled
  with `ShowError()`.
2023-05-06 19:41:40 -04:00
Dietrich Epp
56a3983129 Make copy script less noisy 2023-05-06 14:41:42 -04:00
Dietrich Epp
3398ed425c Use paths for volumes without file ID support
This fixes an issue where remote folders on the Basilisk II "Unix"
volume would not resolve correctly after a system restart.
2023-05-06 14:03:13 -04:00
Dietrich Epp
5f1b8e872b Add fallback program for copying files
This program is written in Python, and does the conversions to and from
a local directory containing the Macintosh version of the files.
2023-05-06 14:00:32 -04:00
Dietrich Epp
9224a9b789 Remove old MPW tool version 2023-05-06 13:59:50 -04:00
Dietrich Epp
873192318f Show open dialog for open menu item 2023-04-20 21:41:31 -04:00
Dietrich Epp
2be29e4b87 Add clarifying comments 2023-04-20 02:07:14 -04:00
Dietrich Epp
6bdaaee963 Ignore ccls cache files 2023-04-19 23:09:46 -04:00
Dietrich Epp
def1c2c253 Add Pascal string builder module
This will be used for formatting messages for the user. The idea is to
have something more usable than the Mac OS toolbox ParamText function.
2023-04-19 22:14:34 -04:00
Dietrich Epp
a4ce2924db Add and clarify documentation comments 2022-11-17 20:38:03 -05:00
Dietrich Epp
4d4f986e38 Add CodeWarrior 4 project 2022-11-16 18:48:27 -05:00
Dietrich Epp
76362fb2c1 Save aliases for local and remote directories
Previously, the local and remote directories would not get saved with a
project. This makes it so that alias data is populated for the local and
remote directories.
2022-11-16 18:32:52 -05:00
Dietrich Epp
01a3863697 Fix incorrect alignment macro 2022-11-16 18:30:59 -05:00
Dietrich Epp
d5bfaa510a Clean up Mac OS GUI code
Include paths are updated to include the directory. It seems that
CodeWarrior will search for include files recursively, which means that
"error.h" may resolve to the wrong file (there are two). I am unsure of
the rules CodeWarrior uses to find header files.

Support for older versions of Universal Interfaces has been added.

The project code has been reworked after thoroughly reviewing Inside
Macintosh: Files. It is not complete, but it compiles, and the behavior
of the Save / Save As commands have been thought out more carefully.
2022-11-16 18:19:05 -05:00
Dietrich Epp
8e04863cda Fix data paths in generated convert/convert.r
Previously, the Rez file would have entries like this:

    read 'cmap' (128, "Roman") "roman";

That has been fixed to show this:

    read 'cmap' (128, "Roman") "charmap_roman.dat";
2022-11-13 16:19:41 -05:00
Dietrich Epp
0ba00114d6 Add simple string buffer library 2022-07-16 17:04:27 -04:00
Dietrich Epp
ec3c80360f Use more modern C 2022-07-16 16:58:50 -04:00
Dietrich Epp
61e4168fbc Move error codes to separate header file 2022-07-16 16:58:50 -04:00
Dietrich Epp
3f6acc9f42 Use more modern C
While C99 is not supported by old Mac OS compilers, line comments are
supported. Keeping strictly to old C90 style code is annoying without
benefit.
2022-04-21 13:57:17 -04:00
Dietrich Epp
054a4134e6 Fix compiler warnings on Xcode 11 2022-04-14 13:39:42 -04:00
Dietrich Epp
6844e5a271 Update to Xcode 11.3.1 2022-04-14 13:39:42 -04:00
Dietrich Epp
337fd52125 Ignore Xcode user files 2022-04-14 13:39:42 -04:00
Dietrich Epp
2b5f5a2425 Docs: Document archive formats 2022-04-14 12:50:13 -04:00
Dietrich Epp
d81cce155d Expand technical documentation
Adds section on safe saving.
2022-04-11 17:16:48 -04:00
Dietrich Epp
3bf095fb49 Make source file headers consistent
- Standardize copyright and license notice
- Standardize header guards
2022-04-10 04:22:58 -04:00
Dietrich Epp
ad220442d7 Use -std=c11 when compiling with Bazel
The -std=c89 option is too pedantic, and the old CodeWarrior compiler
accepts various extensions (like line comments) anyway. Rather than
using -std=c89 to ensure the code is compatible with old compilers, we
will actually test on the old compilers.
2022-04-10 04:14:14 -04:00
Dietrich Epp
4d4ee214b3 Create classic Mac OS GUI program
The GUI program's project is not checked in. It was compiled and tested
with CodeWarrior Pro 4.

The GUI program allows users to create new synchronization projects,
select folders to synchronize, and save and open projects. The code is
probably broken and buggy, and probably dereferences NULL pointers here
and there, but the basic shell is there.
2022-04-10 04:09:17 -04:00
Dietrich Epp
dd96385d7c Style: Use trailing commas for enums
The trailing comma is supported in MPW and GCC. It fixes the formatting
issue with clang-format and makes cleaner diffs, so trailing commas have
been added to enums and clang-format has been run over the sources.
2022-04-10 03:51:59 -04:00
Dietrich Epp
75f1908690 Add CRC-32 function 2022-04-10 03:37:14 -04:00
Dietrich Epp
2f644a8674 Fix broken Markdown link 2022-04-07 23:45:11 -04:00
Dietrich Epp
0ca2cd7e6a Fix Jekyll baseurl and url 2022-04-07 23:33:24 -04:00
Dietrich Epp
45b93f5300 Update Jekyll config for GitHub Pages 2022-04-07 23:26:37 -04:00
Dietrich Epp
c7147b2737 Add script for building GitHub pages to branch 2022-04-07 23:24:34 -04:00
Dietrich Epp
e5e7749d2e Collect notes into technical documentation
Creates a Jekyll site containing both personal notes about how
filesystems work on Mac OS, as well as some more general explanations.
2022-04-07 19:40:21 -04:00
Dietrich Epp
3d7537f7f6 Use Mozilla Public License, version 2.0 2022-04-04 13:59:26 -04:00
Dietrich Epp
68665d1fff Update documentation comments in extract.py 2022-04-04 13:54:37 -04:00
Dietrich Epp
36ab91617c VS Code: Use spaces for indenting Python 2022-04-04 13:53:01 -04:00
Dietrich Epp
39ebe32975 Extract hexadecimal constants from enums 2022-04-01 12:17:43 -04:00
Dietrich Epp
4b20b30330 Take Mac OS text encoding constants from headers
Among other uses, these constants are used on HFS+ volumes to choose
which encoding to use when converting Unicode filenames back to an 8-bit
string for old Mac OS APIs.

This is documented in TN 1150 under "Text Encodings".

https://developer.apple.com/library/archive/technotes/tn/tn1150.html
2022-04-01 12:05:15 -04:00