4 Original GPL release version 4.12
5 Copyright 1993-2000 Jonathan Potter
7 This program is free software; you can redistribute it and/or
8 modify it under the terms of the GNU General Public License
9 as published by the Free Software Foundation; either version 2
10 of the License, or (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 All users of Directory Opus 4 (including versions distributed
22 under the GPL) are entitled to upgrade to the latest version of
23 Directory Opus version 5 at a reduced price. Please see
24 http://www.gpsoft.com.au for more information.
26 The release of Directory Opus 4 under the GPL in NO WAY affects
27 the existing commercial status of Directory Opus 5.
31 /* Definitions of any data that relates to the Screen display. Includes
32 TextAttrs, NewScreen structures and TagItems, and various global data */
36 /* TextAttr structures */
39 main_screen_attr
={NULL
,0,0,0}, /* Main screen font */
40 screen_attr
={NULL
,8,0,0}, /* General screen font */
41 menu_attr
={NULL
,0,0,0}; /* Menu font */
43 /* Screen tag lists */
45 UWORD scr_drawinfo
[NUMDRIPENS
+1]; /* Pen lists */
46 UWORD zoom_data
[]={0,0,640,200}; /* Zoom gadget data */
49 mainscreen_tags
[]={ /* Tags for the main screen */
51 {SA_Pens
,(IPTR
)scr_drawinfo
},
52 {SA_PubName
,(IPTR
)str_arexx_portname
},
53 {SA_Overscan
,OSCAN_TEXT
},
55 {SA_Interleaved
,TRUE
},
60 stdscreen_tags
[]={ /* Tags for a standard HIRES screen */
61 {SA_DisplayID
,HIRES_KEY
},
62 {SA_Pens
,(IPTR
)scr_drawinfo
},
65 mainwindow_tags
[]={ /* Tags for the main window */
68 {WA_Zoom
,(IPTR
)zoom_data
},
71 /* NewScreen structures */
74 main_scr
={ /* Main screen */
78 CUSTOMSCREEN
|SCREENBEHIND
|NS_EXTENDED
,
80 (STRPTR
)str_arexx_portname
,
85 0,0,640,0,1,0,1, /* Font screen */
87 CUSTOMSCREEN
|SCREENBEHIND
|SCREENQUIET
|NS_EXTENDED
,
88 NULL
,NULL
,NULL
,NULL
,stdscreen_tags
},
89 blank_scr
={ /* Blank screen */
90 0,0,320,STDSCREENHEIGHT
,1,0,1,
92 CUSTOMSCREEN
|SCREENQUIET
,
93 NULL
,NULL
,NULL
,NULL
,NULL
};
95 /* NewWindow structures */
98 main_win
={ /* Main window */
100 IDCMP_MOUSEBUTTONS
|IDCMP_MENUPICK
|IDCMP_GADGETUP
|
101 IDCMP_GADGETDOWN
|IDCMP_RAWKEY
|IDCMP_MOUSEMOVE
|
102 IDCMP_DISKINSERTED
|IDCMP_DISKREMOVED
|IDCMP_INACTIVEWINDOW
|
103 IDCMP_ACTIVEWINDOW
|IDCMP_CLOSEWINDOW
|IDCMP_NEWSIZE
,
105 NULL
,NULL
,NULL
,NULL
,NULL
,640,200,65535,65535,CUSTOMSCREEN
,
109 font_win
={ /* Font window */
111 IDCMP_MOUSEBUTTONS
|IDCMP_RAWKEY
|IDCMP_INACTIVEWINDOW
,
112 WFLG_RMBTRAP
|WFLG_BORDERLESS
|WFLG_SIMPLE_REFRESH
|WFLG_NOCAREREFRESH
,
113 NULL
,NULL
,NULL
,NULL
,NULL
,0,0,0,0,CUSTOMSCREEN
},
115 disk_win
={ /* DiskInfo window */
117 IDCMP_RAWKEY
|IDCMP_DISKINSERTED
|IDCMP_DISKREMOVED
|IDCMP_GADGETUP
|IDCMP_VANILLAKEY
,
118 WFLG_BORDERLESS
|WFLG_RMBTRAP
|WFLG_ACTIVATE
,
119 NULL
,NULL
,NULL
,NULL
,NULL
,0,0,0,0,CUSTOMSCREEN
};
121 struct AppWindow
*dopus_appwindow
=NULL
; /* AppWindow when on Workbench screen */
124 /* Definitions for the custom menus */
126 struct Menu menu_menus
[5]; /* Custom menus */
127 struct MenuItem
*menu_menuitem
; /* Custom menu items */
128 struct IntuiText
*menu_intuitext
; /* IntuiText for custom menu items */
130 char *menu_itemnames
; /* Names of the menu items */
131 char menu_spaceitemnames
[5][80]; /* Space background of menu items */
133 UBYTE menu_real_number
[5]; /* The real ordinal number of each menu */
135 /* Internal Screen Data */
137 struct ColourTable screen_pens
[16]; /* Colour pen table */
139 UWORD scrdata_norm_width
; /* Normal width of the display */
140 UWORD scrdata_norm_height
; /* Normal height of the display */
141 UWORD scrdata_scr_height
; /* Main screen/window height */
143 UWORD scrdata_dispwin_lines
; /* Number of lines in each window */
144 UWORD scrdata_dispwin_width
[2]; /* Displayed width in each window */
145 UWORD scrdata_dispwin_height
; /* Height of directory windows */
146 UWORD scrdata_dispwin_nchars
[2]; /* Width of each window in characters */
147 UWORD scrdata_dispwin_ypos
; /* Y-Position of directory windows */
148 UWORD scrdata_dispwin_left
[2]; /* Left edge of directory windows */
149 UWORD scrdata_dispwin_xpos
[2]; /* Left edge of text in windows */
150 UWORD scrdata_dispwin_center
; /* Center of the two windows */
152 UWORD scrdata_dirwin_xpos
[2]; /* Rendered X-Position of each window */
153 UWORD scrdata_dirwin_ypos
[2]; /* Rendered Y-Position of each window */
154 UWORD scrdata_dirwin_width
[2]; /* Rendered width of each window */
155 UWORD scrdata_dirwin_height
; /* Rendered height of directory windows */
156 UWORD scrdata_dirwin_bottom
; /* Rendered bottom of each window */
157 UWORD scrdata_dirwin_center
; /* Rendered center of the two windows */
159 UWORD scrdata_drive_width
; /* Width of the drive gadgets */
160 UWORD scrdata_gadget_offset
; /* X-Offset of entire gadget display */
161 UWORD scrdata_gadget_xpos
; /* X-Position of the custom gadgets */
162 UWORD scrdata_gadget_ypos
; /* Y-Position of the custom gadgets */
163 UWORD scrdata_gadget_width
; /* Width of the custom gadgets */
164 UWORD scrdata_gadget_height
; /* Height of the custom gadgets */
166 UWORD scrdata_clock_width
; /* Width of the clock bar */
167 UWORD scrdata_clock_height
; /* Height of the clock bar */
168 UWORD scrdata_clock_xpos
; /* x-pos of the clock bar */
169 UWORD scrdata_clock_ypos
; /* y-pos of the clock bar */
170 UWORD scrdata_status_xpos
; /* X-Position of the status bar */
171 UWORD scrdata_status_ypos
; /* Y-Position of the status bar */
172 UWORD scrdata_status_width
; /* Width of the status bar */
173 UWORD scrdata_status_height
; /* Height of the status bar */
174 UWORD scrdata_diskname_width
[2]; /* Width of each diskname display */
175 UWORD scrdata_diskname_height
; /* Height of the diskname displays */
176 UWORD scrdata_diskname_ypos
; /* Y-Position of the diskname displays */
177 UWORD scrdata_diskname_xpos
[2]; /* X-Position of each diskname display */
178 UWORD scrdata_prop_height
; /* Height of the vertical sliders */
179 UWORD scrdata_string_height
; /* Height of the path string gadgets */
180 UWORD scrdata_closegad_width
; /* Width of the screen close gadget */
182 UWORD scrdata_font_xsize
; /* X-Size of the dir window font */
183 UWORD scrdata_font_ysize
; /* Y-Size of the dir window font */
184 UWORD scrdata_font_baseline
; /* Baseline of the dir window font */
186 UBYTE scrdata_is_pal
; /* Indicates PAL or NTSC system */
187 UBYTE scrdata_statustext_pos
=0; /* Status text positioning */
188 LONG scrdata_old_offset_store
=-1; /* Stored offset in directory window */
190 UWORD scrdata_xoffset
; /* General x-offset */
191 UWORD scrdata_yoffset
; /* General y-offset */
192 UWORD scrdata_width
; /* Display width */
193 UWORD scrdata_height
; /* Display height */
195 /* Definitions of screen objects */
198 vert_propinfo
[2]={ /* Vertical slider PropInfo */
199 {FREEVERT
|PROPBORDERLESS
,0,0,0,0xffff},
200 {FREEVERT
|PROPBORDERLESS
,0,0,0,0xffff}},
202 horiz_propinfo
[2]={ /* Horizontal slider PropInfo */
203 {FREEHORIZ
|PROPBORDERLESS
,0,0,0x4152,0},
204 {FREEHORIZ
|PROPBORDERLESS
,0,0,0x4152,0}},
206 drive_propinfo
={ /* Drive banks slider PropInfo */
207 FREEVERT
|PROPBORDERLESS
,0,0,0,0xffff},
209 gadget_propinfo
={ /* Gadget banks slider PropInfo */
210 FREEVERT
|PROPBORDERLESS
,0,0,0,0xffff};
213 vert_propimage
[2], /* Vertical slider Image */
214 horiz_propimage
[2], /* Horizontal slider Image */
215 drive_propimage
={ /* Drive banks slider Image */
216 0,0,8,0,1,NULL
,0,0,NULL
},
217 gadget_propimage
={ /* Gadget banks slider Image */
218 0,0,8,0,1,NULL
,0,0,NULL
};
220 struct StringExtend
/* Path fields StringExtension */
222 NULL
,{0,0},{0,0},SGM_EXITHELP
,NULL
,NULL
,{0,0,0,0}},
224 requester_stringex
={ /* Requester StringExtension */
225 NULL
,{0,0},{0,0},0,NULL
,NULL
,{0,0,0,0}};
227 char str_pathbuffer
[2][256]; /* Path fields buffers */
228 char str_undobuffer
[256]; /* General undo buffer for string gads */
230 struct StringInfo
/* Path fields StringInfos */
232 {(STRPTR
)str_pathbuffer
[0],(STRPTR
)str_undobuffer
,0,256,0},
233 {(STRPTR
)str_pathbuffer
[1],(STRPTR
)str_undobuffer
,0,256,0}};
236 *main_gadgets
, /* Custom gadgets */
237 *drive_gadgets
, /* Drive gadgets */
239 path_strgadget
[2]={ /* Path field gadgets */
240 {&path_strgadget
[1],2,0,0,0,
241 GFLG_GADGHCOMP
|GFLG_STRINGEXTEND
|GFLG_TABCYCLE
,
242 GACT_IMMEDIATE
|GACT_RELVERIFY
|GACT_TOGGLESELECT
,
243 GTYP_STRGADGET
,NULL
,NULL
,NULL
,NULL
,
244 (APTR
)&path_stringinfo
[0],SCRGAD_LEFTSTRING
,NULL
},
246 GFLG_GADGHCOMP
|GFLG_STRINGEXTEND
|GFLG_TABCYCLE
,
247 GACT_IMMEDIATE
|GACT_RELVERIFY
|GACT_TOGGLESELECT
,
248 GTYP_STRGADGET
,NULL
,NULL
,NULL
,NULL
,
249 (APTR
)&path_stringinfo
[1],SCRGAD_RIGHTSTRING
,NULL
}},
251 vert_propgad
[2]={ /* Vertical slider gadgets */
252 {&vert_propgad
[1],0,0,8,0,
254 GACT_IMMEDIATE
|GACT_RELVERIFY
|GACT_FOLLOWMOUSE
,
255 GTYP_PROPGADGET
,(APTR
)&vert_propimage
[0],NULL
,NULL
,NULL
,
256 (APTR
)&vert_propinfo
[0],SCRGAD_LEFTPROP
,NULL
},
259 GACT_IMMEDIATE
|GACT_RELVERIFY
|GACT_FOLLOWMOUSE
,
260 GTYP_PROPGADGET
,(APTR
)&vert_propimage
[1],NULL
,NULL
,NULL
,
261 (APTR
)&vert_propinfo
[1],SCRGAD_RIGHTPROP
,NULL
}},
263 horiz_propgad
[2]={ /* Horizontal slider gadgets */
264 {&horiz_propgad
[1],0,0,0,5,
266 GACT_IMMEDIATE
|GACT_RELVERIFY
|GACT_FOLLOWMOUSE
,
267 GTYP_PROPGADGET
,(APTR
)&horiz_propimage
[0],NULL
,NULL
,NULL
,
268 (APTR
)&horiz_propinfo
[0],SCRGAD_LEFTHPROP
,NULL
},
271 GACT_IMMEDIATE
|GACT_RELVERIFY
|GACT_FOLLOWMOUSE
,
272 GTYP_PROPGADGET
,(APTR
)&horiz_propimage
[1],NULL
,NULL
,NULL
,
273 (APTR
)&horiz_propinfo
[1],SCRGAD_RIGHTHPROP
,NULL
}},
275 drive_propgad
={ /* Drive banks slider gadget */
278 GACT_IMMEDIATE
|GACT_RELVERIFY
|GACT_FOLLOWMOUSE
,
279 GTYP_PROPGADGET
,(APTR
)&drive_propimage
,NULL
,NULL
,NULL
,
280 (APTR
)&drive_propinfo
,SCRGAD_DRIVEPROP
,NULL
},
282 gadget_propgad
={ /* Gadget banks slider gadget */
285 GACT_IMMEDIATE
|GACT_RELVERIFY
|GACT_FOLLOWMOUSE
,
286 GTYP_PROPGADGET
,(APTR
)&gadget_propimage
,NULL
,NULL
,NULL
,
287 (APTR
)&gadget_propinfo
,SCRGAD_GADGETPROP
,NULL
},
289 screen_gadgets
[24]={ /* General screen gadgets */
290 {&screen_gadgets
[1],0,0,2,0,
293 GTYP_BOOLGADGET
,NULL
,NULL
,NULL
,NULL
,
294 NULL
,FUNC_PARENT1
,NULL
},
295 {&screen_gadgets
[2],0,0,2,0,
298 GTYP_BOOLGADGET
,NULL
,NULL
,NULL
,NULL
,
299 NULL
,FUNC_PARENT2
,NULL
},
300 {&screen_gadgets
[3],0,0,0,0,
303 GTYP_BOOLGADGET
,NULL
,NULL
,NULL
,NULL
,
304 NULL
,FUNC_BUFFERLIST
,NULL
},
305 {&screen_gadgets
[4],0,0,0,0,
308 GTYP_BOOLGADGET
,NULL
,NULL
,NULL
,NULL
,
309 NULL
,FUNC_RESELECT
,NULL
},
310 {&screen_gadgets
[5],0,0,0,0,
313 GTYP_BOOLGADGET
,NULL
,NULL
,NULL
,NULL
,
314 NULL
,FUNC_SELECT
,NULL
},
315 {&screen_gadgets
[6],0,0,0,0,
318 GTYP_BOOLGADGET
,NULL
,NULL
,NULL
,NULL
,
319 NULL
,FUNC_AREXX
,NULL
},
320 {&screen_gadgets
[7],0,0,19,0,
322 GACT_RELVERIFY
|GACT_TOGGLESELECT
,
323 GTYP_BOOLGADGET
,NULL
,NULL
,NULL
,NULL
,
324 NULL
,FUNC_HELP
,NULL
},
325 {&screen_gadgets
[8],0,0,19,0,
328 GTYP_BOOLGADGET
,NULL
,NULL
,NULL
,NULL
,
329 NULL
,FUNC_ERRORHELP
,NULL
},
330 {&screen_gadgets
[9],0,0,19,0,
332 GACT_RELVERIFY
|GACT_TOGGLESELECT
,
333 GTYP_BOOLGADGET
,NULL
,NULL
,NULL
,NULL
,
334 NULL
,SCRGAD_TINYFILTER
,NULL
},
335 {&screen_gadgets
[10],0,0,19,0,
338 GTYP_BOOLGADGET
,NULL
,NULL
,NULL
,NULL
,
339 NULL
,FUNC_CONFIGURE
,NULL
},
340 {&screen_gadgets
[11],0,0,19,0,
343 GTYP_BOOLGADGET
,NULL
,NULL
,NULL
,NULL
,
344 NULL
,FUNC_ICONIFY
,NULL
},
345 {&screen_gadgets
[12],0,0,19,0,
348 GTYP_BOOLGADGET
,NULL
,NULL
,NULL
,NULL
,
349 NULL
,FUNC_QUIT
,NULL
},
350 {&screen_gadgets
[13],0,0,16,0,
352 GACT_IMMEDIATE
|GACT_RELVERIFY
,
353 GTYP_BOOLGADGET
,NULL
,NULL
,NULL
,NULL
,
354 NULL
,SCRGAD_MOVELEFT1
,NULL
},
355 {&screen_gadgets
[14],0,0,16,0,
357 GACT_IMMEDIATE
|GACT_RELVERIFY
,
358 GTYP_BOOLGADGET
,NULL
,NULL
,NULL
,NULL
,
359 NULL
,SCRGAD_MOVELEFT2
,NULL
},
360 {&screen_gadgets
[15],0,0,16,0,
362 GACT_IMMEDIATE
|GACT_RELVERIFY
,
363 GTYP_BOOLGADGET
,NULL
,NULL
,NULL
,NULL
,
364 NULL
,SCRGAD_MOVERIGHT1
,NULL
},
365 {&screen_gadgets
[16],0,0,16,0,
367 GACT_IMMEDIATE
|GACT_RELVERIFY
,
368 GTYP_BOOLGADGET
,NULL
,NULL
,NULL
,NULL
,
369 NULL
,SCRGAD_MOVERIGHT2
,NULL
},
370 {&screen_gadgets
[17],0,0,0,9,
372 GACT_IMMEDIATE
|GACT_RELVERIFY
,
373 GTYP_BOOLGADGET
,NULL
,NULL
,NULL
,NULL
,
374 NULL
,SCRGAD_MOVEUP1
,NULL
},
375 {&screen_gadgets
[18],0,0,0,9,
377 GACT_IMMEDIATE
|GACT_RELVERIFY
,
378 GTYP_BOOLGADGET
,NULL
,NULL
,NULL
,NULL
,
379 NULL
,SCRGAD_MOVEUP2
,NULL
},
380 {&screen_gadgets
[19],0,0,0,9,
382 GACT_IMMEDIATE
|GACT_RELVERIFY
,
383 GTYP_BOOLGADGET
,NULL
,NULL
,NULL
,NULL
,
384 NULL
,SCRGAD_MOVEDOWN1
,NULL
},
385 {&screen_gadgets
[20],0,0,0,9,
387 GACT_IMMEDIATE
|GACT_RELVERIFY
,
388 GTYP_BOOLGADGET
,NULL
,NULL
,NULL
,NULL
,
389 NULL
,SCRGAD_MOVEDOWN2
,NULL
},
390 {&screen_gadgets
[21],0,0,16,0,
392 GACT_IMMEDIATE
|GACT_RELVERIFY
,
393 GTYP_BOOLGADGET
,NULL
,NULL
,NULL
,NULL
,
394 NULL
,SCRGAD_BUFFERLEFT1
,NULL
},
395 {&screen_gadgets
[22],0,0,16,0,
397 GACT_IMMEDIATE
|GACT_RELVERIFY
,
398 GTYP_BOOLGADGET
,NULL
,NULL
,NULL
,NULL
,
399 NULL
,SCRGAD_BUFFERLEFT2
,NULL
},
400 {&screen_gadgets
[23],0,0,16,0,
402 GACT_IMMEDIATE
|GACT_RELVERIFY
,
403 GTYP_BOOLGADGET
,NULL
,NULL
,NULL
,NULL
,
404 NULL
,SCRGAD_BUFFERRIGHT1
,NULL
},
407 GACT_IMMEDIATE
|GACT_RELVERIFY
,
408 GTYP_BOOLGADGET
,NULL
,NULL
,NULL
,NULL
,
409 NULL
,SCRGAD_BUFFERRIGHT2
,NULL
}},
412 {&size_gadgets
[1],0,0,0,0,
414 GACT_IMMEDIATE
|GACT_RELVERIFY
,
415 GTYP_SIZING
,NULL
,NULL
,NULL
,NULL
,
419 GACT_IMMEDIATE
|GACT_RELVERIFY
,
420 GTYP_SIZING
,NULL
,NULL
,NULL
,NULL
,
424 mainrmbgads
[7]={ /* Screen right mouse button gadgets */
426 0,0,0,0,0,FUNC_NEXTDRIVES
}, /* Drive banks (NextDrives) */
428 0,0,0,0,0,FUNC_CLEARBUFFERS
}, /* B tiny gadget (clear buffers) */
430 0,0,0,0,0,FUNC_RESCAN
}, /* R tiny gadget (rescan) */
432 0,0,0,0,0,FUNC_DEVICELIST
}, /* S tiny gadget (device list) */
434 0,0,0,0,0,FUNC_DIRTREE
}, /* A tiny gadget (dir tree) */
436 0,0,0,0,0,FUNC_ROOT
}, /* Left parent gadget (root) */
438 0,0,0,0,0,FUNC_ROOT
}}; /* Right parent gadget (root) */
440 /* Click-M-Click dragging data */
442 struct VSprite drag_sprite
={ /* VSprite used for dragging */
443 NULL
,NULL
,NULL
,NULL
,0,0,
444 SAVEBACK
,0,0,0,0,0,0,0,
445 NULL
,NULL
,NULL
,NULL
,&drag_bob
,0,0};
447 struct Bob drag_bob
={ /* BOB used for dragging */
448 0,NULL
,NULL
,NULL
,NULL
,
449 &drag_sprite
,NULL
,NULL
};
451 struct BitMap drag_bob_bitmap
; /* Bitmap used to render BOB */
452 struct RastPort drag_bob_rastport
; /* Rastport used to render BOB */
454 PLANEPTR drag_bob_buffer
=NULL
; /* BOB buffer */
455 PLANEPTR drag_bob_savebuffer
=NULL
; /* BOB background save buffer */
457 struct GelsInfo drag_gelsinfo
={0}; /* GelsInfo structure for BOB */
458 struct VSprite drag_dummy_sprite1
={0}; /* Dummy sprite 1 for GELs list */
459 struct VSprite drag_dummy_sprite2
={0}; /* Dummy sprite 2 for GELs list */
461 /* General screen data */
463 struct Rectangle scr_scroll_borders
[2]; /* Scroll borders for dir windows */
465 /* Borders for gadget highlighting */
467 struct DOpusRemember
*border_key
=NULL
; /* Memory key for border data */
469 struct Border
*gadget_sel_border
; /* Borders for main gadgets */
470 struct Border
*gadget_unsel_border
;
472 struct Border
*gadget_dog_sel_border
; /* Main gadgets with dog-ears*/
473 struct Border
*gadget_dog_unsel_border
;
475 struct Border
*drive_sel_border
; /* Borders for drive gadgets */
476 struct Border
*drive_unsel_border
;
478 struct Border
*drive_bank_sel_border
; /* Borders for the drive bank */
479 struct Border
*drive_bank_unsel_border
;