/* 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. */ /* File: printdbox.h * Purpose: PrintDbox Objects * Author: Timothy G Roddis * History: 25-May-94: TGR: created * */ #ifndef __PrintDbox_h #define __PrintDbox_h #ifndef __os_h #include "os.h" #endif #ifndef __window_h #include "objects/window.h" #endif #ifndef __wimp_h #include "twimp.h" #endif /* PrintDbox SWI calls ****************************************************************************/ #define PrintDbox_SWIChunkBase 0x82b00 #define PrintDbox_ObjectClass PrintDbox_SWIChunkBase #define PrintDbox_ClassSWI (PrintDbox_SWIChunkBase + 0) #define PrintDbox_PostFilter (PrintDbox_SWIChunkBase + 1) #define PrintDbox_PreFilter (PrintDbox_SWIChunkBase + 2) /* PrintDbox Templates ****************************************************************************/ /* flags */ #define PrintDbox_GenerateShowEvent 0x00000001 #define PrintDbox_GenerateHideEvent 0x00000002 #define PrintDbox_GenerateShowSetupEvent 0x00000004 #define PrintDbox_IncludeAllFromTo 0x00000008 #define PrintDbox_IncludeCopies 0x00000010 #define PrintDbox_IncludeScale 0x00000020 #define PrintDbox_IncludeOrientation 0x00000040 #define PrintDbox_IncludeSave 0x00000080 #define PrintDbox_IncludeSetUp 0x00000100 #define PrintDbox_IncludeDraft 0x00000200 #define PrintDbox_SelectFromTo 0x00000400 #define PrintDbox_SelectSideways 0x00000800 #define PrintDbox_SelectDraft 0x00001000 /* templates */ typedef struct { int flags; int from; int to; int copies; int scale; char *further_options; char *window; } PrintDboxTemplate; /* display field component IDs */ #define PrintDbox_ComponentIDBase (PrintDbox_SWIChunkBase<<4) #define PrintDbox_ActionButton_Print (PrintDbox_ComponentIDBase) #define PrintDbox_ActionButton_Save (PrintDbox_ComponentIDBase + 1) #define PrintDbox_ActionButton_Cancel (PrintDbox_ComponentIDBase + 2) #define PrintDbox_RadioButton_FromTo (PrintDbox_ComponentIDBase + 3) #define PrintDbox_RadioButton_All (PrintDbox_ComponentIDBase + 4) #define PrintDbox_WritableField_From (PrintDbox_ComponentIDBase + 5) #define PrintDbox_WritableField_To (PrintDbox_ComponentIDBase + 6) #define PrintDbox_NumberRange_Copies (PrintDbox_ComponentIDBase + 7) #define PrintDbox_NumberRange_Scale (PrintDbox_ComponentIDBase + 8) #define PrintDbox_RadioButton_Upright (PrintDbox_ComponentIDBase + 9) #define PrintDbox_RadioButton_Sideways (PrintDbox_ComponentIDBase + 10) #define PrintDbox_OptionButton_Draft (PrintDbox_ComponentIDBase + 11) #define PrintDbox_ActionButton_SetUp (PrintDbox_ComponentIDBase + 12) #define PrintDbox_Label_To (PrintDbox_ComponentIDBase + 13) #define PrintDbox_Label_Copies (PrintDbox_ComponentIDBase + 14) #define PrintDbox_Label_Scale (PrintDbox_ComponentIDBase + 15) #define PrintDbox_Label_Percent (PrintDbox_ComponentIDBase + 16) /* PrintDbox Methods ******************************************************************************/ #define PrintDbox_GetWindowID 0 #define PrintDbox_SetPageRange 1 #define PrintDbox_GetPageRange 2 #define PrintDbox_SetCopies 3 #define PrintDbox_GetCopies 4 #define PrintDbox_SetScale 5 #define PrintDbox_GetScale 6 #define PrintDbox_SetOrientation 7 #define PrintDbox_GetOrientation 8 #define PrintDbox_GetTitle 9 #define PrintDbox_SetDraft 10 #define PrintDbox_GetDraft 11 /* PrintDbox Toolbox Events ***********************************************************************/ #define PrintDbox_AboutToBeShown PrintDbox_SWIChunkBase #define PrintDbox_DialogueCompleted (PrintDbox_SWIChunkBase + 1) #define PrintDbox_SetUpAboutToBeShown (PrintDbox_SWIChunkBase + 2) #define PrintDbox_Save (PrintDbox_SWIChunkBase + 3) #define PrintDbox_SetUp (PrintDbox_SWIChunkBase + 4) #define PrintDbox_Print (PrintDbox_SWIChunkBase + 5) #define PrintDboxEvents_PrintSave_Sideways 0x00000001 #define PrintDboxEvents_PrintSave_Draft 0x00000002 typedef struct { ToolboxEventHeader hdr; int show_type; union { struct { int x,y; } coords; WindowShowObjectBlock full; } info; } PrintDbox_AboutToBeShown_Event; typedef struct { ToolboxEventHeader hdr; } PrintDbox_DialogueCompleted_Event; typedef struct { ToolboxEventHeader hdr; ObjectID object_id; int show_type; union { struct { int x,y; } coords; WindowShowObjectBlock full; } info; } PrintDbox_SetUpAboutToBeShown_Event; typedef struct { ToolboxEventHeader hdr; int start_page; int finish_page; int copies; int scale_factor; } PrintDbox_Save_Event; typedef struct { ToolboxEventHeader hdr; } PrintDbox_SetUp_Event; typedef struct { ToolboxEventHeader hdr; int start_page; int finish_page; int copies; int scale_factor; } PrintDbox_Print_Event; /* PrintDbox Errors *******************************************************************************/ #define PrintDbox_ErrorBase (Program_Error | 0x0080B300) #define PrintDbox_AllocFailed (PrintDbox_ErrorBase+0x01) #define PrintDbox_ShortBuffer (PrintDbox_ErrorBase+0x02) #define PrintDbox_NoSuchTask (PrintDbox_ErrorBase+0x11) #define PrintDbox_NoSuchMethod (PrintDbox_ErrorBase+0x12) #define PrintDbox_NoSuchMiscOpMethod (PrintDbox_ErrorBase+0x13) #define PrintDbox_TasksActive (PrintDbox_ErrorBase+0x00) #endif