Commit 39657f2a authored by Neil Turton's avatar Neil Turton
Browse files

Import from cleaned 360 CD

parents
c/** gitlab-language=c linguist-language=c linguist-detectable=true
h/** gitlab-language=c linguist-language=c linguist-detectable=true
cmhg/** gitlab-language=cmhg linguist-language=cmhg linguist-detectable=true
*,fe1 gitlab-language=make linguist-language=make linguist-detectable=true
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
# Makefile for SaveAs
#
# ***********************************
# *** C h a n g e L i s t ***
# ***********************************
# Date Name Description
# ---- ---- -----------
# 06-Jan-94 AMcC Created
#
#
# Component specific options:
#
COMPONENT = SaveAs
ROM_MODULE = aof.${COMPONENT}
#
# Export Paths for Messages module
#
RESDIR = <resource$dir>.Resources2.${COMPONENT}
#
# Generic options:
#
MKDIR = cdir
CC = cc
CMHG = cmhg
CP = copy
LD = link
RM = remove
WIPE = -wipe
CPFLAGS = ~cfr~v
WFLAGS = ~c~v
CFLAGS = -c -depend !Depend ${INCLUDES} -zM -ffah -zps1 ${DFLAGS}
DFLAGS = -DROM
INCLUDES = -Itbox:,C:
#
# Libraries
#
ANSILIB = CLib:o.ansilib
CLIB = CLIB:o.stubs
RLIB = RISCOSLIB:o.risc_oslib
ROMCSTUBS = RISCOSLIB:o.romcstubs
ABSSYM = RISC_OSLib:o.abssym
TBOXLIB = tbox:tboxlib
OBJS =\
o.Modhdr_NoD\
o.auxiliary\
o.copy\
o.create\
o.delete\
o.events\
o.getstate\
o.hide\
o.main\
o.miscop\
o.show\
o.task
#
# Rule patterns
#
.c.o:; ${CC} ${CFLAGS} -o $@ $<
.cmhg.o:; ${CMHG} -O $@ $<
#
# Main rules:
#
#
rom: ${ROM_MODULE}
@echo ${COMPONENT}: Module built (ROM)
install_rom: ${ROM_MODULE}
${CP} ${ROM_MODULE} ${INSTDIR}.${COMPONENT} ${CPFLAGS}
@echo ${COMPONENT}: Module installed (ROM)
resources: Messages
${MKDIR} ${RESDIR}
${CP} Messages ${RESDIR}.Messages ${CPFLAGS}
${CP} Res ${RESDIR}.Res ${CPFLAGS}
@echo ${COMPONENT}: resource files copied to Messages module
clean:
${WIPE} o.* ${WFLAGS}
${WIPE} aof ${WFLAGS}
${WIPE} linked ${WFLAGS}
${WIPE} map ${WFLAGS}
@echo ${COMPONENT}: cleaned
${ROM_MODULE}: ${OBJS} ${TBOXLIB} ${ROMCSTUBS}
${MKDIR} aof
${LD} -o $@ -aof ${OBJS} ${TBOXLIB} ${ROMCSTUBS}
# final link for ROM Image (using given base address)
rom_link:
${MKDIR} linked
${MKDIR} map
${LD} -o linked.${COMPONENT} -bin -base ${ADDRESS} ${ROM_MODULE} ${ABSSYM} \
-map > map.${COMPONENT}
truncate map.${COMPONENT} linked.${COMPONENT}
${CP} linked.${COMPONENT} ${LINKDIR}.${COMPONENT} ${CPFLAGS}
@echo ${COMPONENT}: rom_link complete
#---------------------------------------------------------------------------
# Dynamic dependencies:
# Project: SaveAs
# Toolflags:
CCflags = -c -depend !Depend -IC: -throwback -zM -ffah -zps1
C++flags = -c -depend !Depend -throwback -IC:
Pascalflags = -c -depend !Depend -throwback -IP:
Linkflags = -m -o $@
ObjAsmflags = -Throwback -Stamp -NoCache -depend !Depend -CloseExec -Quit
CMHGflags =
LibFileflags = -c -o $@
Squeezeflags = -o $@
AAsmflags = -ThrowBack -Stamp -NoCache -depend !Depend -CloseExec -Quit -To $@ -From
# Final targets:
@.SaveAs: C:o.stubs @.o.auxiliary @.o.copy @.o.create @.o.delete @.o.events \
@.o.getstate @.o.hide @.o.main @.o.miscop @.o.show @.o.task @.o.Modhdr_NoD @.o.res \
@.o.messages @.^.common.tboxlib
link $(linkflags) C:o.stubs @.o.auxiliary @.o.copy @.o.create \
@.o.delete @.o.events @.o.getstate @.o.hide @.o.main @.o.miscop @.o.show @.o.task \
@.o.Modhdr_NoD @.o.res @.o.messages @.^.common.tboxlib
# User-editable dependencies:
@.SaveAsM: @.messages
modgen @.SaveAsM SaveAsM "SaveAs Messages" 1.00 @.messages Resources.SaveAs.Messages
@.o.messages: @.Messages
resgen messages_file @.o.messages @.Messages Resources.SaveAs.Messages
@.o.res: @.Res
resgen res_file @.o.res @.Res Resources.SaveAs.Res
# Static dependencies:
@.o.auxiliary: @.c.auxiliary
cc $(ccflags) -o @.o.auxiliary @.c.auxiliary
@.o.create: @.c.create
cc $(ccflags) -o @.o.create @.c.create
@.o.Modhdr_NoD: @.cmhg.Modhdr_NoD
cmhg @.cmhg.Modhdr_NoD -o @.o.Modhdr_NoD
@.o.main: @.c.main
cc $(ccflags) -o @.o.main @.c.main
@.o.copy: @.c.copy
cc $(ccflags) -o @.o.copy @.c.copy
@.o.delete: @.c.delete
cc $(ccflags) -o @.o.delete @.c.delete
@.o.getstate: @.c.getstate
cc $(ccflags) -o @.o.getstate @.c.getstate
@.o.hide: @.c.hide
cc $(ccflags) -o @.o.hide @.c.hide
@.o.show: @.c.show
cc $(ccflags) -o @.o.show @.c.show
@.o.task: @.c.task
cc $(ccflags) -o @.o.task @.c.task
@.o.miscop: @.c.miscop
cc $(ccflags) -o @.o.miscop @.c.miscop
@.o.events: @.c.events
cc $(ccflags) -o @.o.events @.c.events
# Dynamic dependencies:
# Copyright 1996 Acorn Computers Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Makefile for SaveAs
#
# ***********************************
# *** C h a n g e L i s t ***
# ***********************************
# Date Name Description
# ---- ---- -----------
# 06-Jan-94 AMcC Created
#
#
# Component specific options:
#
COMPONENT = SaveAs
ROM_MODULE = aof.${COMPONENT}
#
# Export Paths for Messages module
#
RESDIR = <resource$dir>.Resources2.${COMPONENT}
#
# Generic options:
#
MKDIR = cdir
CC = cc
CMHG = cmhg
CP = copy
LD = link
RM = remove
WIPE = -wipe
CPFLAGS = ~cfr~v
WFLAGS = ~c~v
CFLAGS = -c -depend !Depend ${INCLUDES} -zM -ffah -zps1 ${DFLAGS}
DFLAGS = -DROM
INCLUDES = -Itbox:,C:
#
# Libraries
#
ANSILIB = CLib:o.ansilib
CLIB = CLIB:o.stubs
RLIB = RISCOSLIB:o.risc_oslib
ROMCSTUBS = RISCOSLIB:o.romcstubs
ABSSYM = RISC_OSLib:o.abssym
TBOXLIB = tbox:tboxlib
OBJS =\
o.Modhdr_NoD\
o.auxiliary\
o.copy\
o.create\
o.delete\
o.events\
o.getstate\
o.hide\
o.main\
o.miscop\
o.show\
o.task
#
# Rule patterns
#
.c.o:; ${CC} ${CFLAGS} -o $@ $<
.cmhg.o:; ${CMHG} -O $@ $<
#
# Main rules:
#
#
rom: ${ROM_MODULE}
@echo ${COMPONENT}: Module built (ROM)
install_rom: ${ROM_MODULE}
${CP} ${ROM_MODULE} ${INSTDIR}.${COMPONENT} ${CPFLAGS}
@echo ${COMPONENT}: Module installed (ROM)
resources: Messages
${MKDIR} ${RESDIR}
${CP} Messages ${RESDIR}.Messages ${CPFLAGS}
${CP} Res ${RESDIR}.Res ${CPFLAGS}
@echo ${COMPONENT}: resource files copied to Messages module
clean:
${WIPE} o.* ${WFLAGS}
${WIPE} aof ${WFLAGS}
${WIPE} linked ${WFLAGS}
${WIPE} map ${WFLAGS}
@echo ${COMPONENT}: cleaned
${ROM_MODULE}: ${OBJS} ${TBOXLIB} ${ROMCSTUBS}
${MKDIR} aof
${LD} -o $@ -aof ${OBJS} ${TBOXLIB} ${ROMCSTUBS}
# final link for ROM Image (using given base address)
rom_link:
${MKDIR} linked
${MKDIR} map
${LD} -o linked.${COMPONENT} -bin -base ${ADDRESS} ${ROM_MODULE} ${ABSSYM} \
-map > map.${COMPONENT}
truncate map.${COMPONENT} linked.${COMPONENT}
${CP} linked.${COMPONENT} ${LINKDIR}.${COMPONENT} ${CPFLAGS}
@echo ${COMPONENT}: rom_link complete
#---------------------------------------------------------------------------
# Dynamic dependencies:
E00:SaveAs has active tasks.
E01:Memory allocation failed.
E02:Buffer too short.
E03:Filename too long.
E11:Task, %0, does not exist.
E12:Method, %0, not recognised.
E13:MiscOp Method, %0, not recognised.
E21:Automatic saving not supported for this client application type.
E23:RAMTransmit via buffer not supported for this client application type.
E31:Transfer size exceeds given buffer size.
E32:Base of data to transfer is not set.
E33:To save drag the icon to a directory display.
E34:Attempt to save file has failed.
Sel:Selection
File added
/* Copyright 1996 Acorn Computers Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* Title: auxiliary.c
* Purpose: support functions for the SaveAs object class
* Author: TGR
* History: 15-Feb-94: TGR: created
*
*
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "kernel.h"
#include "swis.h"
#include "const.h"
#include "macros.h"
#include "services.h"
#include "debug.h"
#include "mem.h"
#include "string32.h"
#include "messages.h"
#include "twimp.h"
#include "style.h"
#include "objects.toolbox.h"
#include "objects.window.h"
#include "objects.SaveAs.h"
#include "main.h"
#include "auxiliary.h"
#include "object.h"
#include "task.h"
/*
ObjectID global_menu;
*/
SaveAsInternal *global_next;
int global_window_count = 0;
EventInterest messages_of_interest[] = {
/*
{wimp_MMENUS_DELETED , -1},
*/
{wimp_MDATA_SAVE_ACK , 0},
{wimp_MRAM_FETCH , 0},
{wimp_MDATA_LOAD_ACK , 0},
{-1 , -1}
};
EventInterest events_of_interest[] = {
{wimp_ETOOLBOX_EVENT , 0},
{wimp_ECLOSE , 0},
{-1 , -1}
};
EventInterest toolbox_events_of_interest[] = {
{Window_HasBeenHidden , Window_ObjectClass},
{SaveAs_AboutToBeShown , SaveAs_ObjectClass},
{Draggable_DragEnded , Window_ObjectClass},
{ActionButton_Selected , Window_ObjectClass},
{OptionButton_StateChanged , Window_ObjectClass},
{-1 , -1}
};
/*
extern _kernel_oserror *dialogue_completed (ObjectID object_id) {
_kernel_oserror *e;
_kernel_swi_regs regs;
ToolboxEvent toolbox_event;
regs.r[0] = 0;
regs.r[1] = (int) object_id;
regs.r[2] = -1;
regs.r[3] = (int) &toolbox_event;
toolbox_event.hdr.size = sizeof (SaveAs_DialogueCompleted_Event);
toolbox_event.hdr.event_code = SaveAs_DialogueCompleted;
toolbox_event.hdr.flags = 0;
if ((e = _kernel_swi (Toolbox_RaiseToolboxEvent, &regs, &regs)) != NULL)
return e;
return NULL;
}
*/
extern _kernel_oserror *save_completed (SaveAsInternal *internal, char *filename) {
_kernel_oserror *e;
_kernel_swi_regs regs;
SaveAs_SaveCompleted_Event
*save_complete;
ToolboxEvent toolbox_event;
DEBUG debug_output ("e","SaveAs: save is complete\n");
regs.r[0] = 0;
regs.r[1] = (int) internal->object_id;
regs.r[2] = (int) -1;
regs.r[3] = (int) &toolbox_event;
save_complete = (SaveAs_SaveCompleted_Event *) &toolbox_event;
toolbox_event.hdr.size = sizeof(SaveAs_SaveCompleted_Event);
toolbox_event.hdr.event_code = SaveAs_SaveCompleted;
save_complete->hdr.flags = ((internal->flags & SaveAsInternal_Selection) ? 1 : 0)
| ((internal->flags & SaveAsInternal_Safe) ? 2 : 0);
save_complete->wimp_message_no = internal->my_ref;
strcpy (save_complete->filename, filename);
if ((e = _kernel_swi (Toolbox_RaiseToolboxEvent, &regs, &regs)) != NULL)
return e;
internal->flags &= ~SaveAsInternal_IsShowing;
regs.r[0] = 0;
regs.r[1] = (int) internal->sub_object_id;
return _kernel_swi (Toolbox_HideObject, &regs, &regs);
}
extern SaveAsInternal *find_internal (TaskDescriptor *t, ObjectID sub_object_id) {
SaveAsInternal *i = t->object_list,
*j;
DEBUG debug_output ("e","SaveAs: find internal, searching for sub_object_id = 0x%x\n",sub_object_id);
if (!i) return NULL;
/* Search through the objectect list until we find the one with the required underlying objectect ID */
do {
j = i->forward;
DEBUG debug_output ("e","SaveAs: internal = 0x%x, sub_object_id = 0x%x\n",i,i->sub_object_id);
if (i->sub_object_id == sub_object_id) return i;
} while ((i=j) != t->object_list);
return NULL;
}
SaveAsInternal *find_internal_from_ref (TaskDescriptor *t, int ref) {
SaveAsInternal *i = t->object_list,
*j;
DEBUG debug_output ("e","SaveAs: find internal, searching for ref = 0x%x\n",ref);
if (!i) return NULL;
/* Search through the objectect list until we find the one with the required underlying objectect ID */
do {
j = i->forward;
DEBUG debug_output ("e","SaveAs: internal = 0x%x, my_ref = 0x%x\n",i,i->my_ref);
if (i->my_ref == ref) return i;
} while ((i=j) != t->object_list);
return NULL;
}
_kernel_oserror *show_actual (void) {
_kernel_oserror *e;
_kernel_swi_regs regs;
void *show_info;
int show_type;
DEBUG debug_output ("e","SaveAs: attempting to actually show the dbox\n");
regs.r[0] = 0;
regs.r[1] = global_next->sub_object_id;
if ((e = _kernel_swi (Toolbox_GetParent, &regs, &regs)) != NULL) {
return e;
}
show_info = global_next->show_info;
show_type = (show_info) ? ((global_next->flags & SaveAsInternal_FullInfoShow) ? 1 : 2) : 0;
regs.r[4] = regs.r[0];
regs.r[5] = regs.r[1];
regs.r[0] = (global_next->flags & SaveAsInternal_MenuSemantics) ? 1 :
((global_next->flags & SaveAsInternal_SubMenuSemantics) ? 2 : 0);
regs.r[1] = (int) global_next->sub_object_id;
regs.r[2] = show_type;
regs.r[3] = (int) show_info;
global_next->flags |= SaveAsInternal_IsShowing;
if ((e = _kernel_swi (Toolbox_ShowObject, &regs, &regs)) != NULL)
return e;
if (show_info) {
mem_freek (show_info);
global_next->show_info = NULL;
}
global_next = NULL;
return NULL;
}
_kernel_oserror *transfer_block (TaskDescriptor *t, SaveAsInternal *internal, void *buffer, size_t buffer_size, size_t transfer_size, int destination_task, int your_ref, void *destination_buffer) {
_kernel_oserror *e;
_kernel_swi_regs regs;
wimp_Message *wimp_message = internal->wimp_message;
/* transfer block */
/*
regs.r[0] = 5;
if ((e = _kernel_swi (Wimp_ReadSysInfo, &regs, &regs)) != NULL)
return e;
*/
regs.r[0] = (int) t->task_handle;
/* regs.r[0] is now the current task handle */
DEBUG debug_dump (buffer, transfer_size);
if (transfer_size) {
regs.r[1] = (int) buffer;
regs.r[2] = destination_task;
regs.r[3] = (int) destination_buffer;
regs.r[4] = transfer_size;
if ((e = _kernel_swi (Wimp_TransferBlock, &regs, &regs)) != NULL)
return e;
}
if (transfer_size < buffer_size) {
if ((e = save_completed (internal, wimp_message->data.data_save.filename)) != NULL)
return e;
regs.r[0] = 17;
} else {
regs.r[0] = 18;
}
/* This will be a recorded message unless it is the final one */
wimp_message->hdr.your_ref = your_ref;
wimp_message->hdr.action = wimp_MRAM_TRANSMIT;
wimp_message->data.ram_transmit.no_bytes = transfer_size;
wimp_message->data.ram_transmit.address = destination_buffer;
regs.r[1] = (int) wimp_message;
regs.r[2] = destination_task;
DEBUG debug_dump (wimp_message, 256);
if ((e = _kernel_swi (Wimp_SendMessage, &regs, &regs)) != NULL)
return e;
DEBUG debug_dump (wimp_message, 256);
DEBUG debug_output ("e","SaveAs: sent message, my_ref = 0x%x\n", wimp_message->hdr.my_ref);
internal->my_ref = wimp_message->hdr.my_ref;
return NULL;
}
void find_file_icon (int filetype, char *buffer) {
_kernel_swi_regs regs;
DEBUG debug_output ("f","FileInfo: setting filetype to '%s'\n", buffer);
if (filetype != 0x1000 && filetype != 0x2000) {
sprintf (buffer, "file_%03x", filetype & 0xfff);
} else if (filetype == 0x1000) {
strcpy (buffer, "directory");
} else if (filetype == 0x2000) {
strcpy (buffer, "application");
}
regs.r[0] = os_SpriteOp_SelectSprite;
regs.r[2] = (int) buffer;
if (_kernel_swi (Wimp_SpriteOp, &regs, &regs))
strcpy (buffer, "file_xxx");
DEBUG debug_output ("e","SaveAs: setting sprite to '%s'\n",buffer);
}
/* Copyright 1996 Acorn Computers Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* Title: copy.c
* Purpose: copy a SaveAs Object
* Author: TGR
* History: 17-Feb-94: TGR: created
*
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "kernel.h"
#include "swis.h"
#include "const.h"
#include "macros.h"
#include "services.h"
#include "debug.h"
#include "mem.h"
#include "messages.h"
#include "objects.toolbox.h"
#include "objects.window.h"
#include "objects.saveas.h"
#include "auxiliary.h"
#include "object.h"
#include "task.h"
#include "copy.h"
extern _kernel_oserror *copy_object (_kernel_swi_regs *r, TaskDescriptor *t)
{
/*
* request to copy an object
* R0 = 2
* R1 = Object ID
* R2 = internal handle returned when "src" Object was created
* R3 = wimp task handle of caller (use to identify task descriptor)
* R4 -> user regs R0-R9:
* R0 = flags
* bit 0 set => do not recursively copy the Object
* R1 = source Object ID
*/
/*
* The Toolbox has already checked that this is not just a copy
* call for a shared Object which already exists.
* We create a new Object, and add it to the list of Objects for this
* task.
* We need to remember the ObjectID passed to us by the Toolbox, so
* that we can identify this Object if we are given an ID from the
* client's "id block".
*/
#ifdef COPY_OBJECT
_kernel_oserror *e;
_kernel_swi_regs regs;
SaveAsInternal *internal = (SaveAsInternal *) r->r[2],
*internalx;
if ((internalx = mem_alloc (sizeof (SaveAsInternal))) == NULL)
return make_error (SaveAs_AllocFailed, 0);
memcpy (internalx, internal, sizeof (SaveAsInternal));
regs.r[0] = 0;
regs.r[1] = (int) internal->sub_object_id;
if ((e = _kernel_swi (Toolbox_CopyObject, &regs, &regs)) != NULL)
goto clearup1;
internalx->sub_object_id = (ObjectID) regs.r[0];
internalx->forward = t->object_list;
internalx->backward = t->object_list->backward;
t->object_list->backward->forward = internalx;
t->object_list->backward = internalx;
r->r[0] = (int) internalx;
return NULL;
clearup1:
mem_freek (internalx);
return e;
#else
return NULL;
#endif
}
/* Copyright 1996 Acorn Computers Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* Title: create.c
* Purpose: create a SaveAs Object
* Author: TGR
* History: 17-Feb-94: TGR: created
*
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "kernel.h"
#include "swis.h"
#include "const.h"
#include "macros.h"
#include "services.h"
#include "debug.h"
#include "mem.h"
#include "messages.h"
#include "os.h"
#include "objsupport.h"
#include "objects.toolbox.h"
#include "objects.window.h"
#include "objects.saveas.h"
#include "auxiliary.h"
#include "object.h"
#include "task.h"
#include "create.h"
extern _kernel_oserror *create_object (_kernel_swi_regs *r, TaskDescriptor *t)
{
/*
* request to create an object
* R0 = 0
* R1 = Object ID
* R2 = 0 (will be internal handle for other SWIs
* R3 = wimp task handle of caller (use to identify task descriptor)
* R4 -> user regs R0-R9
* R0 = flags
* bit 0 set => create from memory
* R1 -> description block
*/
/*
* The Toolbox has already checked that this is not just a create
* call for a shared Object which already exists.
* We create a new Object, and add it to the list of Objects for this
* task.
* We need to remember the ObjectID passed to us by the Toolbox, so
* that we can identify this Object if we are given an ID from the
* client's "id block".
* Note that if any template names are held in the Object, then we
* create an Object from that template, and store its ID.
* Note also that the Toolbox has changed the client's R1 to point
* at an in-core template, if it wasn't already!
*/
_kernel_oserror *e;
_kernel_swi_regs regs,
*user_regs = (_kernel_swi_regs *) r->r[4];
ObjectTemplateHeader *obj_temp_hdr = (ObjectTemplateHeader *) user_regs->r[1];
SaveAsTemplate *template = (SaveAsTemplate *) obj_temp_hdr->body;
SaveAsInternal *internal;
char *title,
buffer[12],
*name,
*new_template;
int a,b;
DEBUG debug_output ("f","SaveAs: create entered\n");
if ((internal = mem_alloc (sizeof (SaveAsInternal))) == NULL)
return make_error (SaveAs_AllocFailed, 0);
a = template->flags & SaveAs_AutomaticRAMTransfer;
DEBUG if (a) debug_output ("f","SaveAs: AutoRAMTrans set\n");
b = template->flags & SaveAs_ClientSupportsRAMTransfer;
DEBUG if (b) debug_output ("f","SaveAs: ClientSupportsRAMTrans set\n");
internal->pathname = NULL;
internal->wimp_message = NULL;
internal->approx_size = 0;
internal->flags
= ((template->flags & SaveAs_GenerateShowEvent) ? SaveAsInternal_GenerateShowEvent : 0)
| ((template->flags & SaveAs_GenerateHideEvent) ? SaveAsInternal_GenerateHideEvent : 0)
| ((template->flags & SaveAs_ExcludeSelectionButton) ? 0 : SaveAsInternal_IncludeSelectionButton)
| (SaveAsInternal_ClientType (a?1:(b?3:2)));
DEBUG debug_output ("f","SaveAs: client type is %d(0x%x)\n",(a?1:(b?3:2)),SaveAsInternal_ClientType (a?1:(b?3:2)));
if (a) {
internal->info.type1.data = 0;
internal->info.type1.size = 0;
} else if (b) {
internal->info.type2n3.type3.bytes_copied = 0;
}
if (template->window) {
regs.r[0] = 0;
regs.r[1] = (int) template->window;
if ((e = _kernel_swi (Toolbox_CreateObject, &regs, &regs)) != NULL)
goto clearup1;
internal->sub_object_id = regs.r[0];
} else {
regs.r[0] = 0;
if (template->flags & (SaveAs_ExcludeSelectionButton)) {
name = "_SaveAs2";
} else {
name = "_SaveAs1";
}
DEBUG debug_output ("f","SaveAs: template is '%s'\n", name);
if ((new_template = copy_template(name)) == NULL) {
e = make_error (SaveAs_AllocFailed, 0);
goto clearup1;
}
if (template->title) {
DEBUG debug_output ("f","SaveAs: setting title to '%s'\n",template->title);
zap_window (new_template, window.title.indirect_text.buffer, template->title);
zap_window (new_template, window.title.indirect_text.buff_len, template->max_title);
} else {
title = (char *)*read_window (new_template, window.title.indirect_text.buffer);
zap_window (new_template, window.title.indirect_text.buff_len, MAX(template->max_title,strlen (title)+1));
}
zap_gadget (new_template, WritableField, SaveAs_WritableField_FileName, text, template->filename);
internal->filetype = template->filetype;
find_file_icon (template->filetype, buffer);
zap_gadget (new_template, Draggable, SaveAs_Draggable_FileIcon, sprite, buffer);
/*
if (template->flags & SaveAs_ExcludeSelectionButton) {
if ((e = delete_gadget (new_template, SaveAs_OptionButton_Selection)) != NULL)
goto clearup1;
}
*/
if ((e = create_from_template (new_template, &(internal->sub_object_id))) != NULL) {
return e;
}
if (~template->flags & SaveAs_ExcludeSelectionButton) {
regs.r[0] = 0;
regs.r[1] = (int) internal->sub_object_id;
regs.r[2] = Gadget_GetFlags;
regs.r[3] = SaveAs_OptionButton_Selection;
if ((e = _kernel_swi (Toolbox_ObjectMiscOp, &regs, &regs)) != NULL)
return e;
regs.r[0] = 0;
regs.r[2] = Gadget_SetFlags;
regs.r[4] = (regs.r[0] | 1U<<31);
if ((e = _kernel_swi (Toolbox_ObjectMiscOp, &regs, &regs)) != NULL)
return e;
}
}
internal->object_id = r->r[1];
if (t->object_list) { /* If there are already objects attached to the task ... */
internal->forward = t->object_list;
internal->backward = t->object_list->backward;
t->object_list->backward->forward = internal;
t->object_list->backward = internal;
} else { /* ... if not ... */
DEBUG debug_output ("f","SaveAs: registering filters now\n");
regs.r[0] = 0;
regs.r[1] = SaveAs_PostFilter;
regs.r[2] = (int) t;
regs.r[3] = Toolbox_RegisterPostFilter_WimpEvent;
regs.r[4] = (int) events_of_interest;
if ((e = _kernel_swi (Toolbox_RegisterPostFilter, &regs, &regs)) != NULL)
return e; /* register interest in pre-filter */
regs.r[0] = 0;
regs.r[1] = SaveAs_PostFilter;
regs.r[2] = (int) t;
regs.r[3] = Toolbox_RegisterPostFilter_ToolboxEvent;
regs.r[4] = (int) toolbox_events_of_interest;
if ((e = _kernel_swi (Toolbox_RegisterPostFilter, &regs, &regs)) != NULL)
return e;
regs.r[0] = 0;
regs.r[1] = SaveAs_PreFilter;
regs.r[2] = (int) t;
if ((e = _kernel_swi (Toolbox_RegisterPreFilter, &regs, &regs)) != NULL) {
goto clearup1;
}
DEBUG debug_output ("f","SaveAs: PreFilter should have registered ok\n");
t->object_list = internal;
internal->forward = internal;
internal->backward = internal;
}
r->r[0] = (int) internal;
DEBUG debug_output ("f","SaveAs: create completed successfully\n");
return NULL;
clearup1:
mem_freek(internal);
return e;
}
/* Copyright 1996 Acorn Computers Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* Title: delete.c
* Purpose: delete a SaveAs Object
* Author: TGR
* History: 17-feb-94: TGR: created
*
*/
#include <stdio.h>
#include <stdlib.h>
#include "kernel.h"
#include "swis.h"
#include "const.h"
#include "macros.h"
#include "services.h"
#include "debug.h"
#include "mem.h"
#include "messages.h"
#include "objects.toolbox.h"
#include "objects.window.h"
#include "objects.saveas.h"
#include "auxiliary.h"
#include "object.h"
#include "task.h"
#include "delete.h"
extern _kernel_oserror *delete_object (_kernel_swi_regs *r, TaskDescriptor *t)
{
/*
* request to delete an object
* R0 = 1
* R1 = Object ID
* R2 = internal handle returned when Object was created
* R3 = wimp task handle of caller (use to identify task descriptor)
* R4 -> user regs R0-R9
* R0 = flags
* bit 0 set => do not recursively delete the object
* R1 = Object ID
*/
/*
* The Toolbox has already checked that this is not just a delete
* call for a shared Object.
* We delete Object from the list of Objects for this
* task.
* If recursive delete is requested then we also call Toolbox_Delete
* for any Objects "attached" to this Object.
*/
_kernel_oserror *e;
_kernel_swi_regs regs;
SaveAsInternal *internal = (SaveAsInternal *) r->r[2];
if (internal->flags & SaveAsInternal_IsShowing) {
/*
if (internal->flags & SaveAsInternal_GenerateHideEvent)
if ((e = dialogue_completed (object_id)) != NULL)
return e;
*/
regs.r[0] = 0;
regs.r[1] = (int) internal->sub_object_id;
if ((e = _kernel_swi (Toolbox_HideObject, &regs, &regs)) != NULL)
return e;
}
regs.r[0] = 0;
regs.r[1] = (int) internal->sub_object_id;
e = _kernel_swi (Toolbox_DeleteObject, &regs, &regs);
if (internal->forward == internal) { /* Unlinking from the list is regarded as imperative */
regs.r[0] = 1; /* No longer interested in events */
regs.r[1] = SaveAs_PostFilter;
regs.r[2] = (int) t;
regs.r[3] = Toolbox_RegisterPostFilter_WimpEvent;
regs.r[4] = (int) events_of_interest;
if ((e = _kernel_swi (Toolbox_RegisterPostFilter, &regs, &regs)) != NULL)
return e; /* register interest in pre-filter */
regs.r[0] = 1; /* No longer interested in events */
regs.r[1] = SaveAs_PostFilter;
regs.r[2] = (int) t;
regs.r[3] = Toolbox_RegisterPostFilter_ToolboxEvent;
regs.r[4] = (int) toolbox_events_of_interest;
_kernel_swi (Toolbox_RegisterPostFilter, &regs, &regs);
regs.r[0] = 1;
regs.r[1] = SaveAs_PreFilter;
regs.r[2] = (int) t;
_kernel_swi (Toolbox_RegisterPreFilter, &regs, &regs);
t->object_list = NULL;
} else {
if (t->object_list == internal) {
t->object_list = internal->forward;
}
internal->forward->backward = internal->backward;
internal->backward->forward = internal->forward;
}
if (internal->wimp_message)
mem_freek (internal->wimp_message);
if (internal->pathname != NULL)
mem_freek (internal->pathname);
mem_freek (internal);
return e;
}
This diff is collapsed.
/* Copyright 1996 Acorn Computers Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* Title: getstate.c
* Purpose: return state for a SaveAs Object
* Author: TGR
* History: 27-Apr-94: TGR: created
*
*/
#include <stdio.h>
#include <stdlib.h>
#include "kernel.h"
#include "swis.h"
#include "const.h"
#include "macros.h"
#include "services.h"
#include "debug.h"
#include "mem.h"
#include "messages.h"
#include "objects.toolbox.h"
#include "objects.saveas.h"
#include "object.h"
#include "auxiliary.h"
#include "task.h"
#include "getstate.h"
extern _kernel_oserror *getstate_object (_kernel_swi_regs *r, TaskDescriptor *t)
{
/*
* request for info about an object
* R0 = 5
* R1 = Object ID
* R2 = internal handle returned when Object was created
* R3 = wimp task handle of caller (use to identify task descriptor)
* R4 -> user regs R0-R9
* R0 = flags
* R1 = Object ID
*/
/*
* return state in R0
*
*/
SaveAsInternal *internal = (SaveAsInternal *) r->r[2];
r->r[0] = (internal->flags & SaveAsInternal_IsShowing) ? Toolbox_GetObjectState_Showing : 0;
IGNORE(t);
return NULL;
}
/* Copyright 1996 Acorn Computers Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* Title: hide.c
* Purpose: hide a SaveAs Object
* Author: TGR
* History: 17-Feb-94: TGR: created
*
*/
#include <stdio.h>
#include <stdlib.h>
#include "kernel.h"
#include "swis.h"
#include "const.h"
#include "macros.h"
#include "services.h"
#include "debug.h"
#include "mem.h"
#include "messages.h"
#include "objects.toolbox.h"
#include "objects.window.h"
#include "objects.saveas.h"
#include "auxiliary.h"
#include "object.h"
#include "task.h"
#include "hide.h"
extern _kernel_oserror *hide_object (_kernel_swi_regs *r, TaskDescriptor *t)
{
/*
* request to hide an object
* R0 = 4
* R1 = Object ID
* R2 = internal handle returned when Object was created
* R3 = wimp task handle of caller (use to identify task descriptor)
* R4 -> user regs R0-R9
* R0 = flags
* R1 = Object ID
*
*/
/*
* Remove the object from view. For efficiency, we should stop expressing
* interest in any events which can't happen whilst the Object is
* hidden.
*
*/
_kernel_swi_regs regs;
SaveAsInternal *internal = (SaveAsInternal *) r->r[2];
if (~internal->flags & SaveAsInternal_IsShowing)
return NULL;
internal->flags &= ~SaveAsInternal_IsShowing;
if (internal->wimp_message) {
if (internal->wimp_message) mem_freek (internal->wimp_message);
internal->wimp_message = NULL;
}
regs.r[0] = 0;
regs.r[1] = (int) internal->sub_object_id;
IGNORE(t);
return _kernel_swi (Toolbox_HideObject, &regs, &regs);
/*
global_menu = 0;
*/
/*
return (internal->flags & SaveAsInternal_GenerateHideEvent) ? dialogue_completed (object_id) : NULL;
*/
}
/* Copyright 1996 Acorn Computers Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* Title: main.c
* Purpose: main module of a SaveAs Object module
* Author: TGR
* History: 16-Feb-94: TGR: created from IDJ template
*
*/
#include <stdio.h>
#include <stdlib.h>
#include "kernel.h"
#include "swis.h"
#include "const.h"
#include "macros.h"
#include "services.h"
#include "debug.h"
#include "rmensure.h"
#include "mem.h"
#include "messages.h"
#include "objects.toolbox.h"
#include "objects.saveas.h"
#include "object.h"
#include "create.h"
#include "delete.h"
#include "copy.h"
#include "show.h"
#include "hide.h"
#include "getstate.h"
#include "miscop.h"
#include "events.h"
#include "task.h"
#include "main.h"
#define MAX_CLASS_SWI_METHODS 7
static _kernel_oserror *(*class_swi_methods [MAX_CLASS_SWI_METHODS])(_kernel_swi_regs *r, TaskDescriptor *t) =
{
create_object,
delete_object,
NULL, /*copy_object,*/
show_object,
hide_object,
getstate_object,
miscop_object
};
/* +++++++++++++++++++++++++++++++++ finalisation code +++++++++++++++++++++++++++++++++ */
#ifdef ROM
static _kernel_oserror *__ROM;
#endif
extern _kernel_oserror *SaveAs_finalise (int fatal, int podule, void *pw)
{
_kernel_swi_regs regs;
#ifndef ROM
extern int messages_file(void);
extern int res_file(void);
#endif
/*
* refuse to finalise if tasks active
*/
if (task_any_active())
return make_error (SaveAs_TasksActive, 0);
/*
* close our messages file
*/
messages_file_close();
#ifndef ROM
/*
* ... and deregister from ResourceFS
*/
regs.r[0] = messages_file();
_kernel_swi (ResourceFS_DeregisterFiles, &regs, &regs);
regs.r[0] = res_file();
_kernel_swi (ResourceFS_DeregisterFiles, &regs, &regs);
#endif
/* deregister object module */
regs.r[0] = 0;
regs.r[1] = SaveAs_ObjectClass;
_kernel_swi(Toolbox_DeRegisterObjectModule, &regs, &regs);
/*
* free up memory we may have left allocated
*/
mem_free_all ();
IGNORE (pw);
IGNORE (podule);
IGNORE (fatal);
#ifdef ROM
if(!__ROM) _swix(0xa2c41, 0);
#endif
return NULL;
}
/* ++++++++++++++++++++++++++++++++ initialisation code +++++++++++++++++++++++++++++++ */
extern _kernel_oserror *SaveAs_init(char *cmd_tail, int podule_base, void *pw)
{
char *filename;
_kernel_swi_regs regs;
_kernel_oserror *e;
#ifndef ROM
extern int messages_file(void);
extern int res_file(void);
#endif
#ifdef ROM
__ROM = _swix(0xa2c43, _IN(0), pw);
#endif
DEBUG debug_set_var_name("SaveAs$Debug");
DEBUG debug_output ("M","SaveAs: code initialise\n");
if ((e = rmensure ("Window", "Toolbox.Window", "1.26")) != NULL) return e;
/*
* register our messages file with Resource FS and MessageTrans
*/
#ifndef ROM
regs.r[0] = messages_file();
if ((e = _kernel_swi (ResourceFS_RegisterFiles, &regs, &regs)) != NULL)
return e;
regs.r[0] = res_file();
if ((e = _kernel_swi (ResourceFS_RegisterFiles, &regs, &regs)) != NULL)
return e;
#endif
if (getenv ("SaveAs$Path") == NULL)
filename = "Resources:Resources.SaveAs.Messages";
else
filename = "SaveAs:Messages";
if ((e = messages_file_open (filename)) != NULL)
return e;
/* open the saveas template file */
if (getenv ("SaveAs$Path") == NULL)
filename = "Resources:Resources.SaveAs.Res";
else
filename = "SaveAs:Res";
/* register here with the Toolbox as an Object Module */
regs.r[0] = 0;
regs.r[1] = SaveAs_ObjectClass;
regs.r[2] = SaveAs_ClassSWI;
regs.r[3] = (int) filename;
if ((e = _kernel_swi(Toolbox_RegisterObjectModule, &regs, &regs)) != NULL)
return e;
IGNORE(pw);
IGNORE(podule_base);
IGNORE(cmd_tail);
return NULL;
}
/* +++++++++++++++++++++++++++++++++ service handler code ++++++++++++++++++++++++++++++ */
extern void SaveAs_services(int service_number, _kernel_swi_regs *r, void *pw)
{
_kernel_swi_regs regs;
char *filename;
switch (service_number)
{
case Service_ToolboxTaskDied:
/*
* task dying - r0 holds task handle
*/
task_remove (r->r[0]);
break;
case Service_ToolboxTaskBorn:
/* Toolbox task has just started R0 == wimp task handle */
/*
* create a new "task descriptor"
*/
task_add (r->r[0]);
break;
case Service_ToolboxStarting:
/*
* register with the Toolbox as an Object Module
*/
if (getenv ("SaveAs$Path") == NULL)
filename = "Resources:Resources.SaveAs.Res";
else
filename = "SaveAs:Res";
regs.r[0] = 0;
regs.r[1] = SaveAs_ObjectClass;
regs.r[2] = SaveAs_ClassSWI;
regs.r[3] = (int) filename;
_kernel_swi (Toolbox_RegisterObjectModule, &regs, &regs);
break;
default:
break;
}
IGNORE(pw);
}
/* ++++++++++++++++++++++++++++++++++++++ SWI code +++++++++++++++++++++++++++++++++++++ */
extern _kernel_oserror *SaveAs_SWI_handler(int swi_no, _kernel_swi_regs *r, void *pw)
{
_kernel_oserror *e = NULL;
TaskDescriptor *t;
DEBUG debug_output ("M","SaveAs: SWI 0x%x\n",SaveAs_SWIChunkBase+swi_no);
switch (swi_no + SaveAs_SWIChunkBase)
{
case SaveAs_ClassSWI:
if (r->r[0] < 0 || r->r[0] >= MAX_CLASS_SWI_METHODS)
{
return make_error_hex(SaveAs_NoSuchMethod,1,r->r[0]);
}
else
{
t = task_find (r->r[3]);
if (t == NULL)
{
return make_error_hex(SaveAs_NoSuchTask,1,r->r[3]);
}
DEBUG debug_output ("M","SaveAs: class SWI method %d\n",r->r[0]);
e = (*class_swi_methods[r->r[0]])(r, t);
}
break;
case SaveAs_PostFilter:
e = events_postfilter (r);
break;
case SaveAs_PreFilter:
e = events_prefilter (r);
break;
default:
break;
}
IGNORE(pw);
return e;
}
#if debugging
/* ++++++++++++++++++++++++++++++++++++++ star commands ++++++++++++++++++++++++++++++++++++*/
extern _kernel_oserror *SaveAs_commands (char *arg_string, int argc, int cmd_no, void *pw)
{
switch (cmd_no)
{
case 0:
mem_print_list();
break;
default:
break;
}
IGNORE(pw);
IGNORE(argc);
IGNORE(arg_string);
return NULL;
}
#endif
/* Copyright 1996 Acorn Computers Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* Title: miscop.c
* Purpose: miscellanaous operations on a SaveAs Object
* Author: TGR
* History: 17-Feb-94: TGR: created
*
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "kernel.h"
#include "swis.h"
#include "const.h"
#include "macros.h"
#include "services.h"
#include "debug.h"
#include "mem.h"
#include "messages.h"
#include "os.h"
#include "string32.h"
#include "objects.toolbox.h"
#include "objects.window.h"
#include "objects.saveas.h"
#include "auxiliary.h"
#include "object.h"
#include "task.h"
#include "miscop.h"
_kernel_oserror *saveas_selection_available (_kernel_swi_regs *r);
_kernel_oserror *saveas_buffer_filled (_kernel_swi_regs *r, TaskDescriptor *t);
_kernel_oserror *saveas_file_save_completed (_kernel_swi_regs *r);
#define MAX_MISCOP_METHODS 13
/*
static _kernel_oserror *(*saveas_miscop_methods [MAX_MISCOP_METHODS]) (_kernel_swi_regs *r, TaskDescriptor *t) = {
saveas_get_window_id,
saveas_set_title,
saveas_get_title,
saveas_set_filename,
saveas_get_filename,
saveas_set_filetype,
saveas_get_filetype,
saveas_set_filesize,
saveas_get_filesize,
saveas_selection_available,
saveas_set_data_address,
saveas_buffer_filled,
saveas_file_save_completed
};
*/
extern _kernel_oserror *miscop_object (_kernel_swi_regs *r, TaskDescriptor *t)
{
/*
* do a "miscellaneous (ie object-specific) operation on an object
* R0 = 6
* R1 = Object ID
* R2 = internal handle returned when Object was created
* R3 = wimp task handle of caller (use to identify task descriptor)
* R4 -> user regs R0-R9
* R0 = flags
* R1 = Object ID
* R2 = method code
* R3-R9 method-specific data
*/
/*
* This is the routine which deals with all object-specific operations.
*
*
*/
_kernel_oserror *e;
_kernel_swi_regs regs,
*user_regs = (_kernel_swi_regs *) r->r[4];
int method = user_regs->r[2];
SaveAsInternal *internal = (SaveAsInternal *) r->r[2];
ObjectID sub_object_id = internal->sub_object_id;
DEBUG debug_output ("y","SaveAs: miscop method = 0x%x\n",method);
if (method < 0 || method >= MAX_MISCOP_METHODS) {
return make_error_hex(SaveAs_NoSuchMiscOpMethod,1,method);
}
switch (method) {
case SaveAs_GetWindowID:
user_regs->r[0] = (int) internal->sub_object_id;
return NULL;
case SaveAs_SetTitle:
regs.r[0] = 0;
regs.r[1] = (int) sub_object_id;
regs.r[2] = Window_SetTitle;
regs.r[3] = user_regs->r[3];
return _kernel_swi (Toolbox_ObjectMiscOp, &regs, &regs);
case SaveAs_GetTitle:
regs.r[0] = 0;
regs.r[1] = (int) sub_object_id;
regs.r[2] = Window_GetTitle;
regs.r[3] = user_regs->r[3];
regs.r[4] = user_regs->r[4];
if ((e = _kernel_swi (Toolbox_ObjectMiscOp, &regs, &regs)) != NULL)
return e;
user_regs->r[3] = regs.r[3];
user_regs->r[4] = regs.r[4];
return NULL;
case SaveAs_SetFileName:
regs.r[0] = 0;
regs.r[1] = (int) sub_object_id;
regs.r[2] = WritableField_SetValue;
regs.r[3] = SaveAs_WritableField_FileName;
regs.r[4] = user_regs->r[3];
return _kernel_swi (Toolbox_ObjectMiscOp, &regs, &regs);
case SaveAs_GetFileName:
regs.r[0] = 0;
regs.r[1] = (int) sub_object_id;
regs.r[2] = WritableField_GetValue;
regs.r[3] = SaveAs_WritableField_FileName;
regs.r[4] = user_regs->r[3];
regs.r[5] = user_regs->r[4];
if ((e = _kernel_swi (Toolbox_ObjectMiscOp, &regs, &regs)) != NULL)
return e;
user_regs->r[0] = regs.r[0];
user_regs->r[4] = regs.r[5];
case SaveAs_SetFileType:
{
int filetype = user_regs->r[3];
char buffer[12];
internal->filetype = filetype;
find_file_icon (filetype, buffer);
regs.r[0] = 0;
regs.r[1] = (int) sub_object_id;
regs.r[2] = Draggable_SetSprite;
regs.r[3] = SaveAs_Draggable_FileIcon;
regs.r[4] = (int) buffer;
return _kernel_swi (Toolbox_ObjectMiscOp, &regs, &regs);
}
case SaveAs_GetFileType:
user_regs->r[0] = internal->filetype;
return NULL;
case SaveAs_SetFileSize:
internal->approx_size = user_regs->r[3];
return NULL;
case SaveAs_GetFileSize:
user_regs->r[0] = internal->approx_size;
return NULL;
case SaveAs_SelectionAvailable:
return saveas_selection_available (r);
case SaveAs_SetDataAddress:
if (internal->flags & SaveAsInternal_ClientType(1)) { /* Type 1 */
DEBUG debug_output ("m","SaveAs: data address 0x%x, data size 0x%x\n selection address 0x%x, selection size 0x%x\n");
internal->info.type1.data = (void *) user_regs->r[3];
internal->info.type1.size = user_regs->r[4];
internal->info.type1.sel_data = (void *) user_regs->r[5];
internal->info.type1.sel_size = user_regs->r[6];
return NULL;
}
return make_error (SaveAs_NotType1,0);
case SaveAs_BufferFilled:
return saveas_buffer_filled (r,t);
case SaveAs_FileSaveCompleted:
return saveas_file_save_completed (r);
}
return NULL;
}
_kernel_oserror *saveas_selection_available (_kernel_swi_regs *r) {
_kernel_oserror *e;
_kernel_swi_regs regs,
*user_regs = (_kernel_swi_regs *) r->r[4];
SaveAsInternal *internal = (SaveAsInternal *) r->r[2];
regs.r[0] = 0;
regs.r[1] = (int) internal->sub_object_id;
regs.r[2] = Gadget_GetFlags;
regs.r[3] = SaveAs_OptionButton_Selection;
if ((e = _kernel_swi (Toolbox_ObjectMiscOp, &regs, &regs)) != NULL)
return e;
regs.r[0] = 0;
regs.r[2] = Gadget_SetFlags;
if (user_regs->r[3]) {
regs.r[4] = (regs.r[0] & ~(1U<<31));
internal->flags |= SaveAsInternal_SelectionAvailable;
} else {
regs.r[4] = (regs.r[0] | (1U<<31));
internal->flags &= ~SaveAsInternal_SelectionAvailable;
}
if ((e = _kernel_swi (Toolbox_ObjectMiscOp, &regs, &regs)) != NULL)
return e;
return NULL;
}
_kernel_oserror *saveas_buffer_filled (_kernel_swi_regs *r, TaskDescriptor *t) {
_kernel_oserror *e;
_kernel_swi_regs *user_regs = (_kernel_swi_regs *) r->r[4];
SaveAsInternal *internal = (SaveAsInternal *) r->r[2];
char *buffer = (char *) user_regs->r[3];
int transfer_size = user_regs->r[4];
if (!(internal->flags & SaveAsInternal_ClientType(3))) { /* not type 3 */
return make_error (SaveAs_NotType3,0);
}
if (!internal->wimp_message) return NULL;
if (transfer_size > internal->info.type2n3.type3.buffer_size) {
e = make_error (SaveAs_BufferExceeded, 0);
goto clearup1;
}
if ((e = transfer_block (t, internal, buffer, internal->info.type2n3.type3.buffer_size, transfer_size, internal->info.type2n3.type3.destination_task, internal->info.type2n3.your_ref, internal->info.type2n3.type3.destination_buffer)) != NULL) goto clearup1;
/* transfer block
regs.r[0] = 5;
if ((e = _kernel_swi (Wimp_ReadSysInfo, &regs, &regs)) != NULL)
goto clearup1;
regs.r[0] is now the current task handle
DEBUG debug_dump (buffer, transfer_size);
if (transfer_size) {
regs.r[1] = (int) buffer;
regs.r[2] = internal->info.type2n3.type3.destination_task;
regs.r[3] = (int) internal->info.type2n3.type3.destination_buffer;
regs.r[4] = transfer_size;
if ((e = _kernel_swi (Wimp_TransferBlock, &regs, &regs)) != NULL)
goto clearup1;
}
send Message_RAMTransmit & expect subsequent Message_RAMFetches
if (transfer_size < internal->info.type2n3.type3.buffer_size) {
if ((e = save_completed (internal, internal->wimp_message->data.data_save.filename)) != NULL)
return e;
regs.r[0] = 17;
} else {
regs.r[0] = 18;
}
internal->wimp_message->hdr.action = wimp_MRAM_TRANSMIT;
internal->wimp_message->hdr.your_ref = internal->my_ref;
internal->wimp_message->data.ram_transmit.no_bytes = transfer_size;
internal->wimp_message->data.ram_transmit.address = buffer;
regs.r[1] = (int) internal->wimp_message;
regs.r[2] = internal->info.type2n3.type3.destination_task;
if ((e = _kernel_swi (Wimp_SendMessage, &regs, &regs)) != NULL) {
goto clearup1;
}
internal->my_ref = internal->wimp_message->hdr.my_ref;
*/
internal->info.type2n3.type3.buffer = buffer;
internal->info.type2n3.type3.bytes_copied += transfer_size;
return NULL;
clearup1:
if (internal->wimp_message) mem_freek(internal->wimp_message);
internal->wimp_message = NULL;
return e;
}
_kernel_oserror *saveas_file_save_completed (_kernel_swi_regs *r) {
_kernel_oserror *e;
_kernel_swi_regs regs,
*user_regs = (_kernel_swi_regs *) r->r[4];
SaveAsInternal *internal = (SaveAsInternal *) r->r[2];
wimp_Message *wimp_message = internal->wimp_message;
char *filename = (char *) user_regs->r[3];
if (~user_regs->r[0] & 1) {
if (wimp_message)
wimp_message = NULL;
return make_error (SaveAs_SaveFailed, 0);
}
if (wimp_message) {
strcpy (wimp_message->data.data_load.filename, filename);
wimp_message->hdr.your_ref = internal->info.type2n3.your_ref;
wimp_message->hdr.action = wimp_MDATA_LOAD;
wimp_message->hdr.size = 256;
regs.r[0] = 18;
regs.r[1] = (int) internal->wimp_message;
regs.r[2] = internal->info.type2n3.task_handle;
if ((e = _kernel_swi (Wimp_SendMessage, &regs, &regs)) != NULL) {
return e;
}
DEBUG debug_output ("e","SaveAs: sent DataLoad, my_ref = 0x%x\n", wimp_message->hdr.my_ref);
internal->my_ref = wimp_message->hdr.my_ref;
}
return save_completed (internal, filename);
}
/* Copyright 1996 Acorn Computers Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* Title: show.c
* Purpose: show a SaveAs Object
* Author: TGR
* History: 7-Feb-94: TGR: created
*
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "kernel.h"
#include "swis.h"
#include "const.h"
#include "macros.h"
#include "services.h"
#include "debug.h"
#include "mem.h"
#include "messages.h"
#include "objects.toolbox.h"
#include "objects.window.h"
#include "objects.SaveAs.h"
#include "auxiliary.h"
#include "object.h"
#include "task.h"
#include "show.h"
extern _kernel_oserror *show_object (_kernel_swi_regs *r, TaskDescriptor *t)
{
/*
* request to show an object
* R0 = 3
* R1 = Object ID
* R2 = internal handle returned when Object was created
* R3 = wimp task handle of caller (use to identify task descriptor)
* R4 -> user regs R0-R9
* R0 = flags
* R1 = Object ID
* R2 = "show type"
* 0 => default place
* 1 => R3 points to buffer with full data for showing
* 2 => R3 points to buffer with coordinates
* R3 = 0
* OR R3 -> buffer giving Object-specific data for showing this
* Object
* R4 = Parent Object ID
* R5 = Parent Component ID
*/
/*
* Function to "display" an Object on the screen. If R2 == 0, then
* display in default place.
* If Object has bit set to say warn before show, then we should just
* send Toolbox Event, and wait for the next call to Wimp_Poll after
* the event is delivered before the Object is actually shown
* (ie catch it in the prefilter).
*
*/
_kernel_oserror *e;
_kernel_swi_regs regs,
*user_regs = (_kernel_swi_regs *) r->r[4];
SaveAsInternal *internal = (SaveAsInternal *) r->r[2];
SaveAs_AboutToBeShown_Event
*about_to_be_shown;
ToolboxEvent toolbox_event;
/*
global_menu = (user_regs->r[0] & 3) ? object_id : global_menu;
*/
if (internal->show_info) mem_freek (internal->show_info);
internal->flags &= ~SaveAsInternal_SubMenuSemantics
& ~SaveAsInternal_MenuSemantics;
internal->flags |= ((user_regs->r[0] & 1) ? SaveAsInternal_MenuSemantics : 0)
| ((user_regs->r[0] & 2) ? SaveAsInternal_SubMenuSemantics : 0);
switch (user_regs->r[2]) {
case 1: /* full show */
internal->flags |= SaveAsInternal_FullInfoShow;
internal->show_info = mem_alloc (sizeof (WindowShowObjectBlock));
internal->show_info->window_info = *(WindowShowObjectBlock *) user_regs->r[3];
/* NB: failure to malloc space will result in a default show */
break;
case 2: /* coords */
internal->flags &= ~SaveAsInternal_FullInfoShow;
internal->show_info = mem_alloc (2*sizeof(int));
internal->show_info->coords = *(Coordinates *) user_regs->r[3];
break;
default: /* default (!) */
internal->show_info = NULL;
break;
}
regs.r[0] = 0;
regs.r[1] = SaveAs_PostFilter;
regs.r[2] = (int) t;
regs.r[3] = Toolbox_RegisterPostFilter_WimpMessage;
regs.r[4] = (int) messages_of_interest;
if ((e = _kernel_swi (Toolbox_RegisterPostFilter, &regs, &regs)) != NULL)
return e;
if (internal->flags & SaveAsInternal_IncludeSelectionButton) {
regs.r[0] = 0;
regs.r[1] = (int) internal->sub_object_id;
regs.r[2] = OptionButton_GetState;
regs.r[3] = SaveAs_OptionButton_Selection;
if ((e = _kernel_swi (Toolbox_ObjectMiscOp, &regs, &regs)) != NULL)
return e;
if (regs.r[0]) {
regs.r[0] = 0;
regs.r[1] = (int) internal->sub_object_id;
regs.r[2] = OptionButton_SetState;
regs.r[3] = SaveAs_OptionButton_Selection;
regs.r[4] = 0;
if ((e = _kernel_swi (Toolbox_ObjectMiscOp, &regs, &regs)) != NULL)
return e;
if (internal->pathname) {
regs.r[0] = 0;
regs.r[1] = (int) internal->sub_object_id;
regs.r[2] = WritableField_SetValue;
regs.r[3] = SaveAs_WritableField_FileName;
regs.r[4] = (int) internal->pathname;
if ((e = _kernel_swi (Toolbox_ObjectMiscOp, &regs, &regs)) != NULL)
return e;
mem_freek(internal->pathname);
internal->pathname = NULL;
}
}
}
if (internal->flags & SaveAsInternal_GenerateShowEvent) {
regs.r[0] = 0; /* flags*/
regs.r[1] = r->r[1]; /* Object id */
regs.r[2] = -1; /* Component id */
regs.r[3] = (int) &toolbox_event;
toolbox_event.hdr.size = sizeof (SaveAs_AboutToBeShown_Event);
toolbox_event.hdr.event_code = SaveAs_AboutToBeShown;
toolbox_event.hdr.flags = user_regs->r[0];
about_to_be_shown = (SaveAs_AboutToBeShown_Event *) &toolbox_event;
about_to_be_shown->show_type = user_regs->r[2];
if (user_regs->r[2] == 1) {
about_to_be_shown->info.full = *((WindowShowObjectBlock *) user_regs->r[3]);
} else if (user_regs->r[2] == 2) {
about_to_be_shown->info.coords.x = ((int *) user_regs->r[3])[0];
about_to_be_shown->info.coords.y = ((int *) user_regs->r[3])[1];
}
e = _kernel_swi (Toolbox_RaiseToolboxEvent, &regs, &regs);
return e; /* return here whatever */
}
global_next = internal;
return show_actual ();
}
/* Copyright 1996 Acorn Computers Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* Title: task.c
* Purpose: task handling for the SaveAs module
* Author: TGR
* History: 24-Feb-94: TGR: created from IDJ template
*
*/
#include <stdio.h>
#include <stdlib.h>
#include "kernel.h"
#include "swis.h"
#include "const.h"
#include "macros.h"
#include "services.h"
#include "debug.h"
#include "mem.h"
#include "messages.h"
#include "objects.toolbox.h"
#include "objects.saveas.h"
#include "auxiliary.h"
#include "object.h"
#include "task.h"
/*
* This module has a linked list of client tasks.
* task_add gets called when a Service_ToolboxTaskBorn
* service call goes round.
* The task is removed when the Service_WimpCloseDown is
* received.
* Each task keeps an Object list
*/
static TaskDescriptor *task__list = NULL;
extern BOOL task_any_active(void)
{
return task__list != NULL;
}
extern TaskDescriptor *task_find (int task_handle)
{
/*
* Function to return a TaskDescriptor corresponding to
* a task with a given Wimp handle
*/
TaskDescriptor *t;
t = task__list;
while (t != NULL)
{
if (t->task_handle == task_handle)
break;
t = t->next;
}
return t;
}
extern void task_remove (int task_handle)
{
/*
* Function to remove a task descriptor from the list, given its
* Wimp task handle. Memory is freed, and we also delete any objects
* owned by the exiting task.
*/
TaskDescriptor *t = task__list;
TaskDescriptor *prev_t = NULL, *next = NULL;
SaveAsInternal *i,*j;
while (t != NULL)
{
next = t->next;
if (t->task_handle == task_handle)
{
/*
* remove this task's object's list
*/
if (t->object_list != NULL) {
i = t->object_list;
do {
j = i->forward;
if (global_next == i)
global_next = NULL;
if (i->wimp_message) mem_freek (i->wimp_message);
if (i->show_info) mem_freek (i->show_info);
mem_freek (i);
} while ((i=j) != t->object_list);
}
/*
* remove the task descriptor itself
*/
if (t == task__list)
task__list = next;
else
prev_t->next = next;
mem_free (t, "freeing task descriptor (SaveAs)");
break;
}
prev_t = t;
t = next;
}
}
extern void task_add (int task_handle)
{
/*
* Function to add a task descriptor to the list of active
* Toolbox tasks.
*/
/*
* extra safety check, we make sure that the task is not already there!
*/
TaskDescriptor *new_t;
if (task_find (task_handle) != NULL)
return;
/*
* add task to list
*/
if ((new_t = mem_allocate (sizeof(TaskDescriptor), "task descriptor")) == NULL)
{
raise_toolbox_error (SaveAs_AllocFailed,0,-1,0);
return;
}
new_t->task_handle = task_handle;
new_t->next = task__list;
task__list = new_t;
}
; Copyright 1996 Acorn Computers Ltd
;
; Licensed under the Apache License, Version 2.0 (the "License");
; you may not use this file except in compliance with the License.
; You may obtain a copy of the License at
;
; http://www.apache.org/licenses/LICENSE-2.0
;
; Unless required by applicable law or agreed to in writing, software
; distributed under the License is distributed on an "AS IS" BASIS,
; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
; See the License for the specific language governing permissions and
; limitations under the License.
;
; Title: cmhg.toolbox
; Purpose: module header for a SaveAs Object module
; Author: TGR
; History: 17-Feb-94: TGR: version 1.00
; 7-Feb-95: IDJ: version 0.11
;
initialisation-code: SaveAs_init
finalisation-code: SaveAs_finalise
service-call-handler: SaveAs_services 0x44ec1, 0x44ec2, 0x44ec3
title-string: SaveAs
help-string: SaveAs 0.11
command-keyword-table: SaveAs_commands
SaveAs_Memory()
swi-chunk-base-number: 0x82bc0
swi-handler-code: SaveAs_SWI_handler
swi-decoding-table: SaveAs, ClassSWI, PostFilter, PreFilter
; Copyright 1996 Acorn Computers Ltd
;
; Licensed under the Apache License, Version 2.0 (the "License");
; you may not use this file except in compliance with the License.
; You may obtain a copy of the License at
;
; http://www.apache.org/licenses/LICENSE-2.0
;
; Unless required by applicable law or agreed to in writing, software
; distributed under the License is distributed on an "AS IS" BASIS,
; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
; See the License for the specific language governing permissions and
; limitations under the License.
;
; Title: cmhg.toolbox
; Purpose: module header for a SaveAs Object module
; Author: TGR
; History: 17-Feb-94: TGR: version 1.00
; 7-Feb-95: IDJ: version 0.11
;
initialisation-code: SaveAs_init
finalisation-code: SaveAs_finalise
service-call-handler: SaveAs_services 0x44ec1, 0x44ec2, 0x44ec3
title-string: SaveAs
help-string: SaveAs 0.11
swi-chunk-base-number: 0x82bc0
swi-handler-code: SaveAs_SWI_handler
swi-decoding-table: SaveAs, ClassSWI, PostFilter, PreFilter
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment