| !Boot for !Viewer - run by the Filer when it first sees this
| application directory, and by the boot sequence if the app is in a
| scanned Apps directory.  Loading the module here (rather than in
| !Run) is what makes double-clicking a document work without having
| started the viewer first.
|
| The application is !Viewer because it opens far more than PDFs; the
| module inside it is still called PDFRenderV, and so are its system
| variables and *Commands.
|
| Copyright (c) Martin Hiher and RISC OS Developments Ltd 2026.
| SPDX-License-Identifier: CDDL-1.0
| Licensed under the Common Development and Distribution License 1.0; see LICENSE.

Set PDFRenderV$Dir <Obey$Dir>
IconSprites <Obey$Dir>.!Sprites

| The module claims Alias$@RunType_ADF at initialisation, but only if
| it knows where the viewer lives - so set that first.
Set PDFRenderV$Viewer <PDFRenderV$Dir>.Viewer
RMEnsure PDFRenderV 1.06 RMLoad <PDFRenderV$Dir>.PDFRenderV
RMEnsure PDFRenderV 1.06 Error PDFRenderV 1.06 or later is required

| Give our filetypes names in the Filer (only ADF is ours to name;
| the others already have names from the ROM).
Set File$Type_ADF PDF

| PDFRenderV$Claim lists the filetypes the module takes over when it
| initialises.  Sprite (FF9) is left for Paint; add it here to take
| it back.  Types: ADF PDF, C85 JPEG, B60 PNG, AFF Draw, 69C BMP,
| 695 GIF, FF0 TIFF, 1B0 PSD, D94 ArtWorks, BC5 Impression,
| B27 Ovation Pro, CDD Ovation, D93 DDF, B25 DDL.
If "<PDFRenderV$Claim>" = "" Then Set PDFRenderV$Claim ADF,C85,B60,AFF,69C,695,FF0,1B0,D94,BC5,B27,CDD,D93,B25

| Re-assert the filetype claims.  Another application booted after us
| can take one back (ChangeFSI claims JPEG, for instance); running
| *PDFClaim at any time puts them back, and the module does the same
| when the desktop starts.
PDFClaim
