printdbox 6.53 KB
Newer Older
Neil Turton's avatar
Neil Turton committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
/* 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
30
#include "objects/window.h"
Neil Turton's avatar
Neil Turton committed
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193
#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