Diff of /sys_mac.h [000000] .. [e19029]  Maximize  Restore

  Switch to unified view

a b/sys_mac.h
1
/* Panorama_Tools -   Generate, Edit and Convert Panoramic Images
2
   Copyright (C) 1998,1999 - Helmut Dersch  der@fh-furtwangen.de
3
   
4
   This program is free software; you can redistribute it and/or modify
5
   it under the terms of the GNU General Public License as published by
6
   the Free Software Foundation; either version 2, or (at your option)
7
   any later version.
8
9
   This program is distributed in the hope that it will be useful,
10
   but WITHOUT ANY WARRANTY; without even the implied warranty of
11
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
   GNU General Public License for more details.
13
14
   You should have received a copy of the GNU General Public License
15
   along with this program; if not, write to the Free Software
16
   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
17
18
/*------------------------------------------------------------*/
19
20
#ifndef SYS_MAC_H
21
#define SYS_MAC_H         
22
23
24
#include "filter.h"
25
#include <Controls.h>
26
#include <TextUtils.h>
27
#include <Menus.h>
28
#include <Errors.h>
29
#include <StandardFile.h>
30
#include <ToolUtils.h>
31
#include <Devices.h>
32
#include <Folders.h>
33
#include <Events.h>
34
#include <LowMem.h>
35
#include <Dialogs.h>
36
#include <MacMemory.h>
37
#include <Files.h>
38
#include <LowMem.h>
39
#include <stdio.h>
40
#include <stdlib.h>
41
#include <stdarg.h>
42
#include <AppleEvents.h>
43
#include <Aliases.h>
44
#include <Files.h>
45
#include <MixedMode.h>
46
#include <CodeFragments.h>
47
#include <Fonts.h>
48
49
50
51
#define       SetLbl( kRes, string)                                               \
52
          sprintf(numString,  "%s", string);                                  \
53
          GetDialogItem( dialog, kRes, &itemType, &myHandle, &itemRect);      \
54
          SetDialogItemText (myHandle,    c2pstr( numString ) );
55
56
#define   CheckButton( rNum, isChecked )                                      \
57
          GetDialogItem(dialog, rNum, &itemType,  &myHandle,  &itemRect);     \
58
          SetControlValue( (ControlHandle) myHandle, (isChecked) ) ;          
59
60
61
#define       SetText( rNum, string, var )                                        \
62
          sprintf(numString,  string, var);                                   \
63
          GetDialogItem( dialog, rNum, &itemType, &myHandle, &itemRect);      \
64
          SetDialogItemText (myHandle,    c2pstr( numString ) );
65
66
#define       GetText( rNum, string, varaddr )                                    \
67
          GetDialogItem( dialog, rNum, &itemType, &myHandle, &itemRect);      \
68
          GetDialogItemText (myHandle,    (unsigned char*)numString );        \
69
          sscanf(p2cstr((unsigned char*)numString), string, varaddr);             
70
71
72
73
#define       GenDialog( VarType,  DlgRes, Title, SetControl,SText,               \
74
                      GText, DlgAction, WinFunc)                              \
75
                                                                              \
76
          DialogPtr       dialog;                                             \
77
          Boolean         dialogDone = false;                                 \
78
          short           itemHit, itemType;                                  \
79
          Rect            itemRect;                                           \
80
          Handle          myHandle;                                           \
81
          char            numString[256];                                     \
82
          VarType         localPrefs;                                         \
83
                                                                              \
84
          memcpy((char*)&localPrefs,(char*)thePrefs, sizeof(VarType));        \
85
                                                                              \
86
          dialog = GetNewDialog( DlgRes , nil , (WindowPtr)-1L);              \
87
          strcpy( numString, Title);                                          \
88
          SetWTitle( dialog, c2pstr( numString ));                            \
89
          ShowWindow( dialog );                                               \
90
          SetPort( dialog );                                                  \
91
                                                                              \
92
          SetDialogDefaultItem( dialog, ok );                                 \
93
          SetDialogCancelItem( dialog, cancel );                              \
94
          SetDialogTracksCursor(dialog, true);                                \
95
                                                                              \
96
          SetControl;                                                         \
97
          SText;                                                              \
98
                                                                              \
99
          while( !dialogDone )                                                \
100
          {                                                                   \
101
              ModalDialog( nil, &itemHit);                                    \
102
              switch ( itemHit )                                              \
103
              {                                                               \
104
          case ok:                                                            \
105
          case cancel:                                                        \
106
              dialogDone = true;                                              \
107
              break;                                                          \
108
          DlgAction;                                                          \
109
          default:                                                            \
110
              break;                                                          \
111
      }                                                                       \
112
      SetControl;                                                             \
113
  }                                                                           \
114
  if ( itemHit == cancel )                                                    \
115
  {                                                                           \
116
      DisposeDialog( dialog );                                                \
117
      return FALSE;                                                           \
118
  }                                                                           \
119
  else                                                                        \
120
  {                                                                           \
121
      GText;                                                                  \
122
      memcpy((char*)thePrefs, (char*)&localPrefs, sizeof(VarType));           \
123
      DisposeDialog( dialog );                                                \
124
      return TRUE;                                                            \
125
  }                                                                           \
126
127
          
128
129
130
131
132
//-------------------------- Dialog Resources-----------------------------------------
133
134
//-------------------------- Dialogs for remap  -------------------------------------------
135
136
#define       kSetRemapPrefs_dlg                  310 
137
#define       kSetRemapPrefs_InRect               4
138
#define       kSetRemapPrefs_InPano               5
139
#define       kSetRemapPrefs_InErect              6
140
#define       kSetRemapPrefs_InSphereCenter       15
141
#define       kSetRemapPrefs_InSphereTop          7
142
#define       kSetRemapPrefs_OutRect              9
143
#define       kSetRemapPrefs_OutPano              10
144
#define       kSetRemapPrefs_OutErect             11
145
#define       kSetRemapPrefs_OutSphereCenter      16
146
#define       kSetRemapPrefs_OutSphereTop         12
147
#define       kSetRemapPrefs_Hfov                 14
148
#define       kSetRemapPrefs_Vfov                 18
149
#define       kSetRemapPrefs_InMirror             19
150
#define       kSetRemapPrefs_OutMirror            20
151
#define     kSetRemapPrefs_SetPrefs               21
152
153
154
//-------------------------- Dialogs for perspective  -------------------------------------------
155
156
#define       kSetPerspectivePrefs_dlg            320     
157
#define       kSetPerspectivePrefs_InRect         4       
158
#define       kSetPerspectivePrefs_InSphere       5
159
#define       kSetPerspectivePrefs_Degree         13
160
#define       kSetPerspectivePrefs_Points         14
161
#define       kSetPerspectivePrefs_Keep           22
162
#define       kSetPerspectivePrefs_X              10
163
#define       kSetPerspectivePrefs_Y              11
164
#define       kSetPerspectivePrefs_Gamma          16
165
#define       kSetPerspectivePrefs_Hfov           7
166
#define       kSetPerspectivePrefs_Width          18
167
#define     kSetPerspectivePrefs_Height           20
168
#define       kSetPerspectivePrefs_SetPrefs       23
169
170
171
// ------------------------- Dialogs for correct ------------------------------------------------
172
173
#define       kSetCorrectPrefs_dlg                300
174
#define       kSetCorrectPrefs_Save               3
175
#define       kSetCorrectPrefs_Load               4
176
#define       kSetCorrectPrefs_Radial             5
177
#define       kSetCorrectPrefs_RadialOption       6
178
#define       kSetCorrectPrefs_Horizontal         9
179
#define       kSetCorrectPrefs_HorizontalOption   10
180
#define       kSetCorrectPrefs_Vertical           7
181
#define       kSetCorrectPrefs_VerticalOption     8
182
#define       kSetCorrectPrefs_Shear              11
183
#define       kSetCorrectPrefs_ShearOption        12
184
#define       kSetCorrectPrefs_Scale              13
185
#define       kSetCorrectPrefs_ScaleOption        14
186
#define       kSetCorrectPrefs_Lum                15
187
#define       kSetCorrectPrefs_LumOpt             16
188
#define       kSetCorrectPrefs_SetPrefs           17
189
#define       kSetCorrectPrefs_CutFrame           18
190
#define       kSetCorrectPrefs_CutOpt             19
191
#define       kSetCorrectPrefs_Fourier            20
192
#define       kSetCorrectPrefs_FourierOpt         21
193
194
195
#define   kSetLumOptions_dlg                  302
196
#define   kSetLumOptions_Red                  6
197
#define   kSetLumOptions_Green                7
198
#define   kSetLumOptions_Blue                 8
199
#define   kSetLumOptions_RedText              3
200
#define   kSetLumOptions_GreenText            4
201
#define   kSetLumOptions_BlueText             5
202
203
204
#define   kSetRadialOptions_dlg               301
205
#define   kSetRadialOptions_radial            22
206
#define   kSetRadialOptions_vertical          23
207
#define   kSetRadialOptions_horizontal        24
208
#define     kSetRadialOptions_Red0                10
209
#define     kSetRadialOptions_Red1                11
210
#define     kSetRadialOptions_Red2                12
211
#define     kSetRadialOptions_Red3                13
212
#define     kSetRadialOptions_Green0          14
213
#define     kSetRadialOptions_Green1          15
214
#define     kSetRadialOptions_Green2          16
215
#define     kSetRadialOptions_Green3          17
216
#define     kSetRadialOptions_Blue0               18
217
#define     kSetRadialOptions_Blue1               19
218
#define     kSetRadialOptions_Blue2               20
219
#define     kSetRadialOptions_Blue3               21
220
221
#define   kSetHorizontalOptions_dlg           302
222
#define       kSetHorizontalOptions_Red            6
223
#define       kSetHorizontalOptions_Green          7
224
#define       kSetHorizontalOptions_Blue           8
225
226
#define   kSetShearOptions_dlg                303
227
#define   kSetShearOptions_vname               3
228
#define   kSetShearOptions_vvar                4
229
#define   kSetShearOptions_hname               5
230
#define   kSetShearOptions_hvar                6
231
232
#define       kSetFourierOptions_dlg              450
233
#define       kSetFourierOptions_PSDname          5
234
#define       kSetFourierOptions_findPSD          6
235
#define       kSetFourierOptions_addBlur          7
236
#define       kSetFourierOptions_remBlur          8
237
#define       kSetFourierOptions_internal         11
238
#define       kSetFourierOptions_custom           12
239
#define       kSetFourierOptions_findNFF          13
240
#define       kSetFourierOptions_filterfactor     15
241
#define       kSetFourierOptions_fourier_frame    17
242
#define       kSetFourierOptions_scale            18
243
244
245
//-------------------  Dialogs for Adjust --------------------------
246
247
248
#define       kSetAdjustPrefs_dlg                 330 
249
#define       kSetAdjustPrefs_Insert              7
250
#define       kSetAdjustPrefs_Extract             10
251
#define       kSetAdjustPrefs_SetCtrlPts          9
252
#define       kSetAdjustPrefs_RunOptimizer        5
253
#define       kSetAdjustPrefs_Options             3
254
#define     kSetAdjustPrefs_Script                11
255
#define     kSetAdjustPrefs_FindScript             6
256
#define       kSetAdjustPrefs_SetOpt              4
257
#define       kSetAdjustPrefs_SetPrefs            8
258
259
#define       kSetCreateOptions_dlg               331     
260
#define       kSetCreateOptions_ImR               4
261
#define       kSetCreateOptions_ImP               14
262
#define       kSetCreateOptions_ImFf              5
263
#define       kSetCreateOptions_ImFc              20
264
#define       kSetCreateOptions_ImEq              51
265
#define       kSetCreateOptions_ImHfov            6
266
#define       kSetCreateOptions_ImW               21
267
#define       kSetCreateOptions_ImH               22
268
#define       kSetCreateOptions_Correct           43
269
#define       kSetCreateOptions_PRe               26
270
#define       kSetCreateOptions_PPa               27
271
#define       kSetCreateOptions_PSp               28
272
#define       kSetCreateOptions_PHfov             30
273
#define       kSetCreateOptions_PWi               32
274
#define       kSetCreateOptions_PHe               34
275
#define       kSetCreateOptions_PSave             44
276
#define       kSetCreateOptions_TY                9
277
#define       kSetCreateOptions_TP                11
278
#define       kSetCreateOptions_TR                13
279
#define       kSetCreateOptions_SLoad             37
280
#define       kSetCreateOptions_SPaste            39
281
#define       kSetCreateOptions_SBlend            40
282
#define       kSetCreateOptions_SF                42
283
#define       kSetCreateOptions_SIm               46
284
#define       kSetCreateOptions_SBuf              47
285
#define       kSetCreateOptions_Sboth             48
286
#define       kSetCreateOptions_Snone             49
287
288
289
#define kSetIntp  400
290
#define kPoly 3
291
#define kSp16 4
292
#define kSp36 5
293
#define kSinc 6
294
#define kBil  9
295
#define kNN       10
296
#define kSetIntp_Gamma    11
297
#define kSp64 12
298
299
300
#define       kSetSizePrefs_dlg                   (can_resize ? 350 : 360)
301
#define       kSetSizePrefs_Crop                  4
302
#define       kSetSizePrefs_SFile                 5
303
#define       kSetSizePrefs_OpenF                 8
304
#define       kSetSizePrefs_BrFile                7
305
#define       kSetSizePrefs_SetInt                6
306
#define       kSetSizePrefs_NoAlpha               9
307
308
309
void          open_selection( FSSpec *filespec );
310
311
312
313
#endif
314

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks