Initial import of Scalos. To decrease size I have
[AROS-Contrib.git] / scalos / main / functions.h
blobfec4f462c40635508a91775d0977f902182703d9
1 // Functions.h
2 // $Date$
3 // $Revision$
6 #ifndef FUNCTIONS_H
7 #define FUNCTIONS_H
9 #include <exec/types.h>
10 #include <dos/datetime.h>
11 #include <intuition/intuition.h>
12 #include <datatypes/iconobject.h>
13 #include <scalos/menu.h>
14 #include <scalos/scalos.h>
16 #include "defs.h"
17 #include "scalos_structures.h"
18 #include "Wrappers.h"
20 #include <stdarg.h>
21 #include <stddef.h>
23 /* ------------------------------------------------- */
25 #ifndef min
26 #define min(a, b) ((a) < (b) ? (a) : (b))
27 #endif
29 #ifndef max
30 #define max(a, b) ((a) > (b) ? (a) : (b))
31 #endif
33 /* ------------------------------------------------- */
35 // Debugging Macros
37 #include "debug.h"
39 /* ================================================= */
40 /* ================================================= */
42 /* ------------------------------------------------- */
44 // defined in amiga.lib
46 #ifndef __AROS__
47 extern ULONG HookEntry();
48 #endif
50 //----------------------------------------------------------------------------
52 /* ================================================= */
53 /* ================================================= */
55 // defined in About.c
56 ///
57 void AboutProg(struct internalScaWindowTask *iwt, const struct MenuCmdArg *mcArg);
58 BOOL ReadScalosLogo(struct DatatypesImage **Logo);
59 ///
60 /* ------------------------------------------------- */
62 // defined in AppMenu.c
63 ///
64 void AppMenu_Init(void);
65 BOOL AppMenu_AddItem(struct AppMenuInfo *ami);
66 BOOL AppMenu_RemoveItem(struct AppMenuInfo *ami);
67 void AppMenu_DisposeAppMenuInfo(struct AppMenuInfo *ami);
68 void AppMenu_CreateMenu(void);
69 void AppMenu_ResetMenu(void);
70 struct ScaWindowStruct *FindActiveScalosWindow(void);
71 ///
72 /* ------------------------------------------------- */
74 // defined in AutoUpdate.c
75 ///
76 ULONG DeviceWindowCheckUpdate(struct internalScaWindowTask *iwt);
77 ULONG IconWindowCheckUpdate(struct internalScaWindowTask *iwt);
78 ULONG TextWindowCheckUpdate(struct internalScaWindowTask *iwt);
79 void RealUpdateIcon(struct internalScaWindowTask *iwt, struct UpdateIconData *arg);
80 ///
81 /* ------------------------------------------------- */
83 // defined in Backdrop.c
84 ///
85 void BackDropInitList(struct BackDropList *bdl);
86 LONG BackdropLoadList(struct BackDropList *bdl);
87 void BackdropFreeList(struct BackDropList *bdl);
88 void BackdropFilterList(struct BackDropList *bdl, BPTR dirLock);
89 BOOL BackdropAddLine(struct BackDropList *bdl, CONST_STRPTR NewLine, LONG PosX, LONG PosY);
90 BOOL BackdropRemoveLine(struct BackDropList *bdl, BPTR iconLock);
91 BOOL RewriteBackdrop(struct ScaIconNode *in);
92 ULONG AdjustBackdropRenamed(BPTR oLock, struct ScaIconNode *in);
93 struct ScaIconNode *AddBackdropIcon(BPTR iconDirLock, CONST_STRPTR iconName, WORD PosX, WORD PosY);
94 struct ScaIconNode *FindBackdropIcon(BPTR dirLock, CONST_STRPTR iconName);
95 struct ScaIconNode *FindBackdropIconExclusive(BPTR dirLock, CONST_STRPTR iconName);
96 void DoLeaveOutIcon(struct internalScaWindowTask *iwt, BPTR DirLock,
97 CONST_STRPTR IconName, WORD x, WORD y);
98 BOOL IsPermanentBackDropIcon(struct internalScaWindowTask *iwt, struct BackDropList *bdl,
99 BPTR fLock, CONST_STRPTR FileName);
100 void PutAwayIcon(struct internalScaWindowTask *iwt,
101 BPTR iconDirLock, CONST_STRPTR IconName, BOOL RemovePermanent);
102 BOOL BackdropWait(BPTR dirLock);
104 /* ------------------------------------------------- */
106 // defined in BackFill.c
108 SAVEDS(ULONG) BackFillHookFunc(struct Hook *bfHook, struct RastPort *rp, struct BackFillMsg *msg);
109 void WindowBackFill(struct RastPort *rp,
110 struct BackFillMsg *msg, struct BitMap *bitmap,
111 LONG bmWidth, LONG bmHeight, WORD BGPen,
112 LONG XOffset, LONG YOffset, APTR MaskPlane);
114 /* ------------------------------------------------- */
116 // defined in ButtonClassGadget.c
118 struct ScalosClass *initButtonGadgetClass(const struct PluginClass *plug);
120 /* ------------------------------------------------- */
122 // defined in ChildProcess.c
124 // NumLongs : number of longwords in ArgArray (!!not number of entries!!)
125 BOOL RunProcess(struct ScaWindowTask *iwt, RUNPROCFUNC Routine, ULONG NumLongs,
126 struct WBArg *ArgArray, struct MsgPort *ReplyPort);
127 BOOL ChildProcessRun(struct internalScaWindowTask *iwt, struct ScalosMessage *msg, ULONG FirstTag, ...);
129 /* ------------------------------------------------- */
131 // defined in Class.c
133 ULONG ClassDragQuery(struct DragEnter *drge, struct internalScaWindowTask *swt);
134 ULONG ClassDragEnter(struct DragEnter *drge, struct internalScaWindowTask *swt);
135 ULONG ClassDragLeave(struct DragEnter *drge, struct internalScaWindowTask *swt);
136 void ClassHideDragBobs(struct internalScaWindowTask *iwt, struct DragHandle *dh);
137 void ClassSelectIcon(struct ScaWindowStruct *swi, struct ScaIconNode *sIcon, BOOL Selected);
138 void ClassSelectIconObj(struct ScaWindowStruct *swi, Object *IconObj, BOOL Selected);
139 ULONG ClassCheckInfoData(const struct InfoData *info);
140 BOOL ClassIsDiskWritable(BPTR dLock);
141 ULONG ClassWinTimerMsg(struct internalScaWindowTask *, struct Message *, APTR);
142 void ClassTimerToolTipMsg(struct internalScaWindowTask *iwt);
143 Object *ClassGetWindowIconObject(struct internalScaWindowTask *iwt, Object **allocIconObj);
144 void ClassFormatDate(struct DateTime *dt, ULONG DateMaxLen, ULONG TimeMaxLen); // +jl+ 20010518
145 ULONG ClassCountSelectedIcons(struct internalScaWindowTask *iwt);
146 void ClassDragFinish_IconWin(struct ScalosArg **arglist);
147 void ClassDragBegin_DeviceWin(struct ScalosArg **ArgList, struct DragNode **dnList);
148 void ClassDragBegin_IconWin(struct ScalosArg **ArgList, struct DragNode **dn);
149 void ClassSetDefaultIconFlags(struct ScaIconNode *in, BOOL IsDefIcon);
151 /* ------------------------------------------------- */
153 // defined in cleanup.c
155 void IconWindow_UnCleanup(struct internalScaWindowTask *iwt, struct Region *UnCleanUpRegion);
156 extern void IconWindow_Cleanup(struct internalScaWindowTask *iwt);
158 /* ------------------------------------------------- */
160 // defined in CLIStart.c
162 BOOL CLIStart(BPTR dirLock, CONST_STRPTR PrgName, Object *iconObject, ULONG def_StackSize);
163 BPTR DupWBPathList(void);
165 /* ------------------------------------------------- */
167 // defined in ControlBar.c
169 BOOL ControlBarAdd(struct internalScaWindowTask *iwt);
170 void ControlBarRemove(struct internalScaWindowTask *iwt);
171 void ControlBarRebuild(struct internalScaWindowTask *iwt);
172 void ControlBarUpdateViewMode(struct internalScaWindowTask *iwt, UBYTE ViewByType);
173 UBYTE ControlBarViewModeFromCode(ULONG Code);
174 void ControlBarUpdateShowMode(struct internalScaWindowTask *iwt);
175 void ControlBarUpdateHistory(struct internalScaWindowTask *iwt);
176 void SetControlBarOnOff(struct internalScaWindowTask *iwt);
177 void ControlBarSwitchHistoryEntry(struct internalScaWindowTask *iwt);
178 struct ExtGadget *ControlBarFindGadget(struct internalScaWindowTask *iwt,
179 ULONG GadgetID);
180 struct ControlBarGadgetEntry *ControlBarFindGadgetByID(struct internalScaWindowTask *iwt, UWORD GadgetID);
181 UWORD ControlBarQueryGadgetType(struct internalScaWindowTask *iwt, struct ExtGadget *gg);
182 void ControlBarActionButton(struct internalScaWindowTask *iwt, struct ExtGadget *gg);
184 /* ------------------------------------------------- */
186 // defined in crc32.c
188 ULONG update_crc(ULONG crc, const unsigned char *buf, size_t len);
190 /* ------------------------------------------------- */
192 // defined in CycleGadgetClass.c
194 struct ScalosClass *initCycleGadgetClass(const struct PluginClass *plug);
196 /* ------------------------------------------------- */
198 // defined in DefIcons.c
200 LONG InitDefIcons(void);
201 void CleanupDefIcons(void);
202 void NewDefIconsPrefs(struct internalScaWindowTask *iwt, struct NotifyMessage *msg);
203 BOOL ChangedDefIconsPrefs(void);
204 struct TypeNode *DefIconsIdentify(BPTR dirLock, CONST_STRPTR Name, ULONG IconType);
205 Object *ReturnDefIconObjTags(BPTR dirLock, CONST_STRPTR Name, ULONG FirstTag, ...);
206 Object *ReturnDefIconObj(BPTR dirLock, CONST_STRPTR Name, struct TagItem *TagList);
208 /* ------------------------------------------------- */
210 // defined in DeviceWindowClass.c
212 struct ScalosClass *initDeviceWindowClass(const struct PluginClass *plug);
213 void FreeBackdropIconList(struct ScaBackdropIcon **bdiList);
214 void RemoveScalosBackdropIcon(struct ScaIconNode *in);
215 void CreateSbiForIcon(struct ScaIconNode *in);
217 /* ------------------------------------------------- */
219 // defined in DevListClass.c
221 struct ScalosClass *initDevListClass(const struct PluginClass *plug);
223 /* ------------------------------------------------- */
225 // defined in DoubleClick.c
227 BOOL IconDoubleClick(struct internalScaWindowTask *iwt, struct ScaIconNode *in, ULONG Flags);
228 BOOL ArexxToolStart(struct internalScaWindowTask *iwt, BPTR dirLock, CONST_STRPTR ProgName);
230 /* ------------------------------------------------- */
232 // defined in DragDrop.c
234 void DragDrop(struct Window *win, LONG MouseX, LONG MouseY, ULONG Qualifier,
235 struct internalScaWindowTask *iwt);
236 ULONG ScalosDropAddIcon(BPTR DirLock, CONST_STRPTR IconName, WORD x, WORD y);
237 void ScalosDropRemoveIcon(BPTR DirLock, CONST_STRPTR IconName);
239 /* ------------------------------------------------- */
241 // defined in DragDropBobs.c
243 void InitDrag(struct IntuiMessage *iMsg, struct internalScaWindowTask *iwt);
244 void RestoreDragIcons(struct internalScaWindowTask *iwt);
245 BOOL SuspendDrag(struct DragHandle *dh, struct internalScaWindowTask *iwt);
246 void ResumeDrag(struct DragHandle *dh, struct internalScaWindowTask *iwt, BOOL wasLocked);
247 void ReLockDrag(struct DragHandle *dh, struct internalScaWindowTask *iwt, BOOL wasLocked);
248 LIBFUNC_P2_PROTO(void, sca_LockDrag,
249 A0, struct DragHandle *, dh,
250 A6, struct ScalosBase *, ScalosBase);
251 LIBFUNC_P2_PROTO(ULONG, sca_UnlockDrag,
252 A0, struct DragHandle *, dh,
253 A6, struct ScalosBase *, ScalosBase);
254 void DrawDrag(ULONG DrawFlags, struct internalScaWindowTask *iwt);
255 LIBFUNC_P8_PROTO(BOOL, sca_AddBob,
256 A0, struct DragHandle *, dh,
257 A1, struct BitMap *, bm,
258 A2, APTR, Mask,
259 D0, ULONG, Width,
260 D1, ULONG, Height,
261 D2, LONG, XOffset,
262 D3, LONG, YOffset,
263 A6, struct ScalosBase *, ScalosBase);
264 LIBFUNC_P5_PROTO(void, sca_DrawDrag,
265 A0, struct DragHandle *, dh,
266 D0, LONG, XOffset,
267 D1, LONG, YOffset,
268 D2, ULONG, Flags,
269 A6, struct ScalosBase *, ScalosBase);
270 LIBFUNC_P2_PROTO(void, sca_EndDrag,
271 A0, struct DragHandle *, dh,
272 A6, struct ScalosBase *, ScalosBase);
273 LIBFUNC_P2_PROTO(struct DragHandle *, sca_InitDrag,
274 A0, struct Screen *, Scr,
275 A6, struct ScalosBase *, ScalosBase);
276 void EndDrag(struct internalScaWindowTask *iwt);
277 void EndDragUnlock(struct internalScaWindowTask *iwt);
278 void DragRefreshIcons(struct internalScaWindowTask *iwt);
279 void BlitARGBMask(ULONG SrcWidth, ULONG SrcHeight,
280 const struct ARGB *Src, LONG SrcLeft, LONG SrcTop,
281 ULONG DestWidth, struct ARGB *Dest, LONG DestLeft, LONG DestTop,
282 const struct BitMap *MaskBM, ULONG Trans);
283 void BlitARGB(ULONG SrcWidth, ULONG SrcHeight,
284 const struct ARGB *Src, LONG SrcLeft, LONG SrcTop,
285 ULONG DestWidth, struct ARGB *Dest, LONG DestLeft, LONG DestTop,
286 ULONG Trans);
288 /* ------------------------------------------------- */
290 // defined in DrawIcon.c
292 void EraseIconObject(struct internalScaWindowTask *iwt, Object *IconObj);
293 void DrawIconObject(struct internalScaWindowTask *iwt, Object *IconObj, ULONG Flags);
294 void BlitARGBAlpha(struct RastPort *rp, const struct ARGBHeader *SrcH,
295 ULONG DestLeft, ULONG DestTop,
296 ULONG SrcLeft, ULONG SrcTop,
297 ULONG Width, ULONG Height,
298 struct ARGB *BufferBg);
299 void ScalosBlurPixelArray(struct ARGB *Dest, const struct ARGB *Src,
300 UWORD SizeX, UWORD SizeY, const UBYTE *Mask);
301 ULONG ScalosReadPixelArray(APTR DestRect, UWORD DestMod, struct RastPort *rp,
302 UWORD SrcX, UWORD SrcY, UWORD SizeX, UWORD SizeY);
303 ULONG ScalosWritePixelArray(APTR SrcRect, UWORD SrcMod, struct RastPort *rp,
304 UWORD DestX, UWORD DestY, UWORD SizeX, UWORD SizeY);
305 void RemoveIcons(struct internalScaWindowTask *iwt, struct ScaIconNode **);
306 BOOL IsIconObjVisible(const struct internalScaWindowTask *iwt, const Object *IconObj);
307 void DrawIconObjectTransparent(struct internalScaWindowTask *iwt, Object *IconObj,
308 ULONG ScreenDepth, struct RastPort *rp, struct RastPort *rpMask,
309 ULONG transparency, BOOL RealTransparency);
310 void DrawIconObjectK(struct internalScaWindowTask *iwt, Object *IconObj,
311 ULONG ScreenDepth, struct RastPort *rp, struct RastPort *rpMask,
312 const struct ARGB *K);
314 /* ------------------------------------------------- */
316 // defined in DropMarks.c
318 void CleanupDropMarkInfoList(struct List *dmList);
319 void CleanupDropMarkInfo(struct DropMarkInfo *dmi);
320 void DisplayWindowDropMark(struct internalScaWindowTask *iwt);
321 void EraseWindowDropMark(struct internalScaWindowTask *iwt);
322 void RedrawWindowDropMark(struct internalScaWindowTask *iwt, struct Region *clipRegion);
323 void DisplayIconDropMark(struct internalScaWindowTask *iwt, struct ScaIconNode *in);
324 void EraseIconDropMark(struct internalScaWindowTask *iwt, struct ScaIconNode *in);
325 void DisplayGadgetClickMark(struct internalScaWindowTask *iwt, struct ExtGadget *gg);
326 void EraseGadgetClickMark(struct internalScaWindowTask *iwt, struct ExtGadget *gg);
328 /* ------------------------------------------------- */
330 // defined in dtimage.c
332 BOOL InitDataTypesImage(void);
333 void CleanupDataTypesImage(void);
334 void DisposeDatatypesImage(struct DatatypesImage **dti);
335 struct DatatypesImage *CreateDatatypesImage(CONST_STRPTR ImageName, ULONG Flags);
336 void FillBackground(struct RastPort *rp, struct DatatypesImage *dtImage,
337 WORD MinX, WORD MinY, WORD MaxX, WORD MaxY,
338 ULONG XStart, ULONG YStart);
339 void DtImageDraw(struct DatatypesImage *dti, struct RastPort *rp,
340 LONG Left, LONG Top, LONG Width, LONG Height);
341 BOOL TempName(STRPTR Buffer, size_t MaxLen);
343 /* ------------------------------------------------- */
345 // defined in DtImageClass.c
347 Class *initDtImageClass(void);
349 /* ------------------------------------------------- */
351 // defined in FileCommands.c
353 LONG CreateLinkCommand(Class *cl, Object *o, BPTR SrcDirLock, BPTR DestDirLock,
354 CONST_STRPTR SrcFileName, CONST_STRPTR DestFileName);
355 LONG MoveCommand(Class *cl, Object *o, BPTR SrcDirLock, BPTR DestDirLock, CONST_STRPTR FileName);
356 LONG CopyCommand(Class *cl, Object *o, BPTR SrcDirLock, BPTR DestDirLock,
357 CONST_STRPTR SrcFileName, CONST_STRPTR DestFileName);
358 LONG DeleteCommand(Class *cl, Object *o, BPTR DirLock, CONST_STRPTR FileName);
359 LONG CountCommand(Class *cl, Object *o, BPTR parentLock, CONST_STRPTR Name, BOOL Recursive);
360 BOOL ExistsObject(BPTR DirLock, CONST_STRPTR Name);
362 /* ------------------------------------------------- */
364 // defined in FileTransClass.c
366 struct ScalosClass *initFileTransClass(const struct PluginClass *plug);
368 /* ------------------------------------------------- */
370 // defined in FileTypes.c
372 BOOL FileTypeInit(void);
373 void FileTypeCleanup(void);
374 void FileTypeFlush(BOOL Final);
375 struct FileTypeDef *FindFileType(struct internalScaWindowTask *iwt, const struct ScaIconNode *in);
376 struct FileTypeDef *FindFileTypeForTypeNode(struct internalScaWindowTask *iwt, const struct TypeNode *tNode);
377 void ReleaseFileType(struct FileTypeDef *ftd);
378 void NewFileTypesPrefs(struct internalScaWindowTask *iwt, struct NotifyMessage *msg);
379 BOOL ChangedFileTypesPrefs(struct MainTask *mt);
381 /* ------------------------------------------------- */
383 // defined in FontUtil.c
385 BOOL FontUtilInit(void);
386 WORD Scalos_TextLength(struct RastPort *rp, CONST_STRPTR string, WORD Length);
387 ULONG Scalos_TextFit(struct RastPort *rp, CONST_STRPTR string, WORD Length,
388 struct TextExtent *textExtent, struct TextExtent *constrainingExtent,
389 WORD strDirection, UWORD constrainingBitWidth, UWORD constrainingBitHeight);
390 void Scalos_TextExtent(struct RastPort *rp, CONST_STRPTR string,
391 WORD Length, struct TextExtent *tExt);
392 void Scalos_Text(struct RastPort *rp, CONST_STRPTR string, WORD Length);
393 UWORD Scalos_GetFontHeight(struct RastPort *rp);
394 UWORD Scalos_GetFontBaseline(struct RastPort *rp);
395 ULONG Scalos_SetSoftStyle(struct RastPort *rp, ULONG style, ULONG enable, struct TTFontFamily *ttff);
396 void Scalos_SetFontTransparency(struct RastPort *rp, ULONG Transparency);
397 void Scalos_SetFont(struct RastPort *rp, struct TextFont *tf, struct TTFontFamily *ttFont);
398 ULONG Scalos_SetSoftStyle(struct RastPort *rp, ULONG style, ULONG enable, struct TTFontFamily *ttff);
399 APTR Scalos_OpenTTFont(CONST_STRPTR FontDesc, struct TTFontFamily *ttff);
400 void Scalos_CloseFont(struct TextFont **tf, struct TTFontFamily *ttFont);
401 void Scalos_InitRastPort(struct RastPort *rp);
402 void Scalos_DoneRastPort(struct RastPort *rp);
404 /* ------------------------------------------------- */
406 // defined in FrameImageClass.c
408 struct ScalosClass *initFrameImageClass(const struct PluginClass *plug);
410 /* ------------------------------------------------- */
412 // defined in Functions.c
414 LIBFUNC_P2_PROTO(BOOL, sca_OpenIconWindow,
415 A0, struct TagItem *, TagList,
416 A6, struct ScalosBase *, ScalosBase);
417 BPTR DiskInfoLock(const struct ScaIconNode *in);
418 STRPTR GetWsNameFromLock(BPTR WsLock);
419 Object *FunctionsFindIconObjectForPath(CONST_STRPTR Path, BOOL *WindowListLocked,
420 struct ScaWindowStruct **wsIconListLocked, Object **allocIconObj);
421 void FunctionsGetSettingsFromIconObject(struct IconWindowProperties *iwp, Object *IconObj);
423 /* ------------------------------------------------- */
425 // defined in GadgetBarClass.c
427 struct ScalosClass *initGadgetBarClass(const struct PluginClass *plug);
429 /* ------------------------------------------------- */
431 // defined in GadgetBarImageClass.c
433 struct ScalosClass *initGadgetBarImageClass(const struct PluginClass *plug);
435 /* ------------------------------------------------- */
437 // defined in GadgetBarTextClass.c
439 struct ScalosClass *initGadgetBarTextClass(const struct PluginClass *plug);
441 /* ------------------------------------------------- */
443 // defined in GaugeGadgetClass.c
445 struct ScalosClass *initGaugeGadgetClass(const struct PluginClass *plug);
447 /* ------------------------------------------------- */
449 // defined in HistoryGadgetClass.c
451 struct ScalosClass *initHistoryGadgetClass(const struct PluginClass *plug);
453 /* ------------------------------------------------- */
455 // defined in idcmp.c
457 ULONG IDCMPRefreshWindow(struct internalScaWindowTask *iwt, struct IntuiMessage *iMsg);
458 ULONG IDCMPDiskInserted(struct internalScaWindowTask *iwt, struct IntuiMessage *iMsg);
459 void AbortFunctions(struct internalScaWindowTask *iwt);
460 void RemoveDeviceIcon(struct internalScaWindowTask *iwt, struct ScaDeviceIcon *di,
461 struct ScaIconNode **IconList);
463 /* ------------------------------------------------- */
465 // defined in IconifyClass.c
467 Class * initIconifyClass(void);
469 /* ------------------------------------------------- */
471 // defined in IconImageClass.c
473 Class *initIconImageClass(void);
474 BOOL freeIconImageClass(Class *cl);
476 /* ------------------------------------------------- */
478 // defined in IconWindowClass.c
480 struct ScalosClass *initIconWindowClass(const struct PluginClass *plug);
482 /* ------------------------------------------------- */
484 // defined in IconWindow_MouseMove.c
486 void IDCMPDragMouseMove(struct internalScaWindowTask *iwt, struct IntuiMessage *msg);
487 void IconWin_EndDrag(struct internalScaWindowTask *iwt);
488 void IDCMPMMBMouseMove(struct internalScaWindowTask *iwt);
489 void IDCMPDragIntuiTicks(struct internalScaWindowTask *iwt, struct IntuiMessage *msg);
491 /* ------------------------------------------------- */
493 // defined in InputHandler.c
495 BOOL InitInputHandler(void);
496 void CleanupInputHandler(void);
497 BOOL PointInGadget(WORD x, WORD y, const struct Window *win, const struct Gadget *gad);
499 /* ------------------------------------------------- */
501 // defined in Lasso.c
503 void Lasso(WORD StartX, WORD StartY, ULONG Mode, struct internalScaWindowTask *iwt);
504 void BeginLasso(struct internalScaWindowTask *iwt, UWORD Qualifier);
505 void EndLasso(struct internalScaWindowTask *iwt);
507 /* ------------------------------------------------- */
509 // defined in LocaleStrings.c
511 CONST_STRPTR GetLocString(LONG StringID);
513 /* ------------------------------------------------- */
515 // defined in MainWait.c
517 void MainWait(struct MainTask *mainTask);
518 void RememberPrefsChanges(struct internalScaWindowTask *iwt, ULONG PrefsChangeFlags);
519 void StartMainTaskTimer(struct MainTask *mt);
520 struct NotifyNode *AddToMainNotifyList(struct NotifyTab *nft, ULONG Flags);
521 void RemFromMainNotifyList(struct NotifyNode *non);
523 /* ------------------------------------------------- */
525 // defined in Memory.c
527 BOOL MemoryInit(void);
528 void MemoryCleanup(void);
529 #ifndef DEBUG_MEMORY
530 APTR ScalosAlloc(ULONG Size);
531 APTR ScalosRealloc(APTR OldMem, ULONG NewSize);
532 void ScalosFree(APTR mem);
533 #endif /* DEBUG_MEMORY */
534 STRPTR AllocCopyString(CONST_STRPTR clp);
535 void FreeCopyString(STRPTR lp);
536 void *ScalosAllocNode(size_t size);
537 void ScalosFreeNode(void *node);
538 void *ScalosAllocMessage(size_t size);
539 void ScalosFreeMessage(void *node);
540 struct AnchorPath *ScalosAllocAnchorPath(ULONG Flags, size_t MaxPathLen);
541 void ScalosFreeAnchorPath(struct AnchorPath *ap);
542 struct InfoData *ScalosAllocInfoData(void);
543 void ScalosFreeInfoData(struct InfoData **pId);
544 STRPTR AllocPathBuffer(void);
545 void FreePathBuffer(STRPTR Buffer);
547 /* ------------------------------------------------- */
549 // defined in Menu.c
551 ULONG GetWindowMenuFlags(struct internalScaWindowTask *iwt);
552 ULONG ReadMenuPrefs(void);
553 void FreeMenuPrefs(void);
554 void ParseMenu(struct Menu *theMenu);
555 BOOL CompareCommand(CONST_STRPTR MenuComName, CONST_STRPTR CommandName);
556 void SetMenuOnOff(struct internalScaWindowTask *iwt);
557 void NewMenuPrefs(struct internalScaWindowTask *, struct NotifyMessage *);
558 BOOL ChangedMenuPrefs(struct MainTask *mt);
559 void CreateScalosMenu(void);
560 ULONG UpdateIconCount(struct internalScaWindowTask *iwt);
561 void ClearMainMenu(void);
563 /* ------------------------------------------------- */
565 // defined in MenuCommand.c
567 void WBInfoStart(struct internalScaWindowTask *iwt, struct ScaIconNode *in, APTR undoEvent);
568 void GetIconsBoundingBox(struct internalScaWindowTask *iwt, struct Rectangle *BBox);
569 void DeleteProg(struct internalScaWindowTask *iwt, const struct MenuCmdArg *mcArg);
570 void UpdateAllProg(struct internalScaWindowTask *iwt, const struct MenuCmdArg *mcArg);
571 void ClearSelectionProg(struct internalScaWindowTask *iwt, const struct MenuCmdArg *mcArg);
572 BOOL ViewWindowBy(struct internalScaWindowTask *iwt, UBYTE NewViewByType);
573 void SetIconWindowRect(struct ScaIconNode *in);
575 /* ------------------------------------------------- */
577 // defined in Messages.c
579 ULONG CloseWindowMsg(struct internalScaWindowTask *iwt, struct Message *Msg, APTR p);
580 ULONG AsyncReplyMsg(struct internalScaWindowTask *iwt, struct Message *Msg, APTR p);
581 LONG SendAppMessage(struct AppObject *appo, ULONG AmClass, WORD x, WORD y);
582 BPTR LockScaModsDir(void); /* *** DM0008 */
584 /* ------------------------------------------------- */
586 // defined in MouseIcon.c
588 struct ScaIconNode *CheckMouseIcon(struct ScaIconNode **IconList,
589 struct internalScaWindowTask *iwt,
590 LONG x, LONG y);
591 struct ScaIconNode *CheckMouseIconOuterBounds(struct ScaIconNode **IconList,
592 LONG x, LONG y);
594 /* ------------------------------------------------- */
596 // defined in OpenDrawerByName.c
598 struct ScaWindowStruct *OpenDrawerByName(CONST_STRPTR Path, struct TagItem *TagList);
600 /* ------------------------------------------------- */
602 // defined in Patches.c
604 void SetAllPatches(struct MainTask *mt);
605 ULONG RemoveAllPatches(struct MainTask *mt);
606 BOOL PatchInit(void);
607 void PatchCleanup(void);
609 /* ------------------------------------------------- */
611 // defined in PopOpenWindows.c
613 void PopOpenWindow(struct internalScaWindowTask *iwt, struct DragHandle *dh);
614 void PopChildWindowDispose(struct internalScaWindowTask *iwt, struct ScaPopChildWindow *spcw);
615 void ClosePopupWindows(BOOL CloseAll);
617 /* ------------------------------------------------- */
619 // defined in PopupMenus.c
621 LONG TestPopup(struct internalScaWindowTask *iwt, WORD MouseX, WORD MouseY, UWORD Qualifier);
622 void ShowPopupMenu(struct internalScaWindowTask *iwt, struct msg_ShowPopupMenu *mpm);
624 /* ------------------------------------------------- */
626 // defined in Patterns.c
628 void RandomizePatterns(void);
629 void PatternsOff(struct MainTask *mt, struct MsgPort *ReplyPort);
630 void PatternsOn(struct MainTask *mt);
631 struct PatternNode *GetPatternNode(WORD PatternNo, const struct PatternNode *pNodeOld);
632 ULONG NewWindowPatternMsg(struct internalScaWindowTask *iwt, struct Message *Msg, APTR p);
633 void FreeBackFill(struct PatternInfo *);
634 BOOL SetBackFill(struct internalScaWindowTask *iwt, struct PatternNode *ptNode,
635 struct PatternInfo *ptInfo, ULONG Flags, struct Screen *Scr);
636 void SetScreenBackfillHook(struct Hook *bfHook);
638 /* ------------------------------------------------- */
640 // defined in Prefs.c
642 ULONG ReadPalettePrefs(void);
643 void FreePalettePrefs(void);
644 void ReadFontPrefs(void);
645 void FreeFontPrefs(void);
646 LONG WriteWBConfig(void);
647 LONG ReadWBConfig(void);
648 void InitScalosPrefs(void);
649 BOOL ReadScalosPrefs(void);
650 void FreeScalosPrefs(void);
651 LONG ReadPatternPrefs(void);
652 void FreePatternPrefs(void);
653 ULONG RandomNumber(ULONG MaxRand);
654 void NewPatternPrefs(struct internalScaWindowTask *, struct NotifyMessage *);
655 BOOL ChangedPatternPrefs(struct MainTask *mt);
656 void NewMainPrefs(struct internalScaWindowTask *, struct NotifyMessage *);
657 BOOL ChangedMainPrefs(struct MainTask *mt);
658 void NewPalettePrefs(struct internalScaWindowTask *, struct NotifyMessage *);
659 BOOL ChangedPalettePrefs(struct MainTask *mt);
660 void NewFontPrefs(struct internalScaWindowTask *, struct NotifyMessage *);
661 BOOL ChangedFontPrefs(struct MainTask *mt);
662 ULONG GetPrefsCRCFromFH(BPTR fh);
663 ULONG GetPrefsCRCFromName(CONST_STRPTR FileName);
664 void OpenIconWindowFont(void);
665 void OpenTextWindowFont(void);
667 /* ------------------------------------------------- */
669 // defined in Rename.c
671 BOOL CollectRenameAdjustHistoryPaths(struct List *HList, BPTR fLock);
672 void AdjustRenameAdjustHistoryPaths(struct List *HList, BPTR fLock);
673 void CleanupRenameAdjustHistoryPaths(struct List *HList, BOOL WinListLocked);
675 /* ------------------------------------------------- */
677 // defined in Request.c
679 LONG UseRequest(struct Window *parentWin, ULONG BodyTextNum,
680 ULONG GadgetsTextNum, APTR ArgList);
681 LONG UseRequestArgs(struct Window *parentWin,
682 ULONG BodyTextNum, ULONG GadgetsTextNum, ULONG NumArgs, ...);
683 void UseAsyncRequestArgs(struct internalScaWindowTask *,
684 LONG BodyTextNum, LONG GadgetTextNum, ULONG NumArgs, ...);
686 /* ------------------------------------------------- */
688 // defined in RootClass.c
690 Class * initRootClass(void);
691 void ProcessRootTimers(void);
693 /* ------------------------------------------------- */
695 // defined in ScaLibrary.c (is platform specific)
697 struct ScalosBase *sca_MakeLibrary(void);
699 /* ------------------------------------------------- */
701 // defined in Scalos.c
703 void SelectIcons(WORD StartX, WORD StartY, WORD StopX, WORD StopY, struct internalScaWindowTask *iwt);
704 void FreeIconList(struct internalScaWindowTask *iwt, struct ScaIconNode **IconList);
705 void FreeIconNode(struct internalScaWindowTask *iwt, struct ScaIconNode **IconList, struct ScaIconNode *in);
706 BOOL TestRegionNotEmpty(const struct Region *region);
707 void RefreshIconList(struct internalScaWindowTask *iwt, struct ScaIconNode *in, struct Region *DrawingRegion);
708 void RefreshIcons(struct internalScaWindowTask *iwt, struct Region *DrawingRegion);
709 ULONG ChipMemAttr(void);
710 LONG ScaSameLock(BPTR Lock1, BPTR Lock2);
711 void DisplayScreenTitleError(struct internalScaWindowTask *iwt, ULONG MsgId);
712 BOOL ExistsAssign(CONST_STRPTR AssignName);
713 LONG ScalosTagListInit(struct ScalosTagList *tagList);
714 void ScalosTagListCleanup(struct ScalosTagList *tagList);
715 LONG ScalosTagListNewEntry(struct ScalosTagList *tagList, ULONG tag, ULONG data);
716 void ScalosTagListEnd(struct ScalosTagList *tagList);
717 struct TagItem *ScalosVTagList(ULONG FirstTag, va_list args);
718 ULONG TranslateViewModesFromIcon(ULONG IconViewMode);
719 ULONG TranslateViewModesToIcon(ULONG ScalosIconViewMode);
720 ULONG TranslateScalosViewMode(ULONG ScalosViewMode);
721 BOOL IsIwtViewByIcon(struct internalScaWindowTask *iwt);
722 BOOL IsViewByIcon(ULONG ScalosViewMode);
723 BOOL IsShowAll(const struct ScaWindowStruct *ws);
724 BOOL IsShowAllType(UWORD ShowType);
725 void ScalosEndNotify(struct NotifyRequest *nr);
726 void SubtractDateStamp(struct DateStamp *from, const struct DateStamp *to);
727 Object *CloneIconObject(Object *OrigIconObj);
729 #if !defined(__SASC) && !defined(__MORPHOS__)
730 // SAS/C compatibility functions
731 extern char *stpblk(const char *);
732 extern size_t stccpy(char *, const char *, size_t);
733 extern void strins(char *to, const char *from);
734 #endif
736 /* ------------------------------------------------- */
738 // defined in Scalos_Cx.c
740 BOOL InitCx(void);
741 void CleanupCx(void);
742 struct Screen *SearchMouseScreen(LONG x, LONG y);
743 void HighlightIconUnderMouse(void);
744 void InvalidateLastIwtUnderPointer(struct internalScaWindowTask *iwt);
746 /* ------------------------------------------------- */
748 // defined in ScalosInit.c
750 SAVEDS(ULONG) LockScalosPens(void);
751 SAVEDS(void) UnlockScalosPens(void);
752 BOOL ChangedLocalePrefs(struct MainTask *mt);
754 /* ------------------------------------------------- */
756 // defined in ScalosLocale.c
758 void NewLocalePrefs(struct internalScaWindowTask *iwt, struct NotifyMessage *msg);
759 BOOL ChangedLocalePrefs(struct MainTask *mt);
760 void InitLocale(void);
761 void CleanupLocale(void);
763 /* ------------------------------------------------- */
765 // defined in ScanDir.c
767 enum ScanDirResult ReadIconList(struct internalScaWindowTask *iwt);
768 struct ScaIconNode *IconWindowReadIcon(struct internalScaWindowTask *iwt,
769 CONST_STRPTR Name, struct ScaReadIconArg *ria);
770 void SetIconSupportsFlags(struct ScaIconNode *in, BOOL isDiskWritable);
771 BOOL IsSoftLink(CONST_STRPTR Name);
772 BOOL IsNoIconPosition(const struct ExtGadget *gg);
773 void SetIconName(Object *IconObj, struct ScaIconNode *in);
774 enum ScanDirResult GetFileList(struct ReadIconListControl *rilc,
775 enum ScanDirResult (*CheckFunc)(struct ReadIconListControl *rilc),
776 BOOL UseExAll, BOOL FetchIconType, BOOL CheckOverlap);
777 BOOL RilcInit(struct ReadIconListControl *rilc, struct internalScaWindowTask *iwt);
778 void RilcCleanup(struct ReadIconListControl *rilc);
779 enum ScanDirResult LinkIconScanList(struct ReadIconListControl *rilc);
780 LONG AddFileToFilesList(struct ReadIconListControl *rilc, BPTR dirLock, CONST_STRPTR Name);
781 BOOL IsFileHidden(CONST_STRPTR Filename, ULONG Protection);
782 BOOL ScanDirIsBackDropIcon(struct internalScaWindowTask *iwt, struct BackDropList *bdl,
783 BPTR fLock, CONST_STRPTR FileName);
784 void ScanDirFillRildFromIse(struct ReadIconListData *rild, const struct IconScanEntry *ise);
785 void ScanDirUpdateStatusBarText(struct internalScaWindowTask *iwt, ULONG TotalIcons);
786 BOOL ScanDirIsError(enum ScanDirResult sdResult);
788 /* ------------------------------------------------- */
790 // defined in ScanDirText.c
792 struct ScaIconNode *TextWindowReadIcon(struct internalScaWindowTask *iwt,
793 CONST_STRPTR Name, struct ScaReadIconArg *ria);
794 enum ScanDirResult ReadTextWindowIconList(struct internalScaWindowTask *iwt);
796 /* ------------------------------------------------- */
798 // defined in Semaphores.c
800 BOOL AttemptSemaphoreNoNest(SCALOSSEMAPHORE *sema);
801 void ScaObtainSemaphoreListA(struct TagItem *TagList);
802 void ScaObtainSemaphoreList(ULONG FirstTag, ...);
803 BOOL ScaAttemptSemaphoreListA(struct TagItem *OriginalTagList);
804 BOOL ScaAttemptSemaphoreList(ULONG FirstTag, ...);
806 #ifdef DEBUG_SEMAPHORES
808 SCALOSSEMAPHORE *DebugScalosCreateSemaphore(CONST_STRPTR, CONST_STRPTR, ULONG);
809 void DebugScalosDeleteSemaphore(SCALOSSEMAPHORE *sema, CONST_STRPTR, CONST_STRPTR, ULONG);
810 void DebugScalosInitSemaphore(SCALOSSEMAPHORE *xsema, CONST_STRPTR, CONST_STRPTR, ULONG);
811 void DebugScalosObtainSemaphore(SCALOSSEMAPHORE *xsema, CONST_STRPTR, CONST_STRPTR, ULONG);
812 void DebugScalosObtainSemaphoreShared(SCALOSSEMAPHORE *xsema, CONST_STRPTR, CONST_STRPTR, ULONG);
813 void DebugScalosReleaseSemaphore(SCALOSSEMAPHORE *xsema, CONST_STRPTR, CONST_STRPTR, ULONG);
814 ULONG DebugScalosAttemptSemaphore(SCALOSSEMAPHORE *xsema, CONST_STRPTR, CONST_STRPTR, ULONG);
815 ULONG DebugScalosAttemptSemaphoreShared(SCALOSSEMAPHORE *xsema, CONST_STRPTR, CONST_STRPTR, ULONG);
817 void DebugScalosLockIconListShared(struct internalScaWindowTask *iwt,
818 CONST_STRPTR CallingFile, CONST_STRPTR CallingFunc, ULONG CallingLine);
819 void DebugScalosLockIconListExclusive(struct internalScaWindowTask *iwt,
820 CONST_STRPTR CallingFile, CONST_STRPTR CallingFunc, ULONG CallingLine);
822 #else /* DEBUG_SEMAPHORES */
824 SCALOSSEMAPHORE *ScalosCreateSemaphore(void);
825 void ScalosDeleteSemaphore(SCALOSSEMAPHORE *sema);
826 void ScalosInitSemaphore(SCALOSSEMAPHORE *xsema);
827 void ScalosObtainSemaphore(SCALOSSEMAPHORE *xsema);
828 void ScalosObtainSemaphoreShared(SCALOSSEMAPHORE *xsema);
829 void ScalosReleaseSemaphore(SCALOSSEMAPHORE *xsema);
830 ULONG ScalosAttemptSemaphore(SCALOSSEMAPHORE *xsema);
831 ULONG ScalosAttemptSemaphoreShared(SCALOSSEMAPHORE *xsema);
833 #endif /* DEBUG_SEMAPHORES */
836 /* ------------------------------------------------- */
838 // defined in SeparatorClassGadget.c
840 struct ScalosClass *initSeparatorGadgetClass(const struct PluginClass *plug);
842 /* ------------------------------------------------- */
844 // defined in Shortcuts.c
846 BOOL ShortcutAddLines(struct BackDropList *bdlVolume);
847 void ShortcutReadPrefs(void);
848 void ShortcutFreePrefs(void);
849 BOOL ShortcutAddEntry(STRPTR path, LONG PosX, LONG PosY);
850 BOOL ShortcutRemoveEntry(BPTR iconLock);
852 /* ------------------------------------------------- */
854 // defined in Splash.c
856 ULONG InitSplash(struct MsgPort *ReplyPort);
857 void SplashAddUser(void);
858 void SplashRemoveUser(void);
859 void SplashDisplayProgress(const char *fmt, ULONG NumArgs, ...);
861 /* ------------------------------------------------- */
863 // defined in StatusBar.c
865 BOOL StatusBarAdd(struct internalScaWindowTask *iwt);
866 void StatusBarRemove(struct internalScaWindowTask *iwt);
867 UWORD StatusBarQueryGadgetID(struct internalScaWindowTask *iwt,
868 const struct ExtGadget *gg, WORD x, WORD y);
870 /* ------------------------------------------------- */
872 // defined in StringGadgetClass.c
874 struct ScalosClass *initStringGadgetClass(const struct PluginClass *plug);
876 /* ------------------------------------------------- */
878 // defined in Subroutines.c
880 void StripTrailingColon(STRPTR Line);
881 void StripTrailingLF(STRPTR Line);
882 void StripIconExtension(STRPTR Line);
883 BOOL CheckOverlap(struct internalScaWindowTask *iwt, struct ScaIconNode *in);
884 BOOL ScaRectInRegion(const struct Region *TestRegion, const struct Rectangle *TestRect);
885 ULONG CheckPosition(struct internalScaWindowTask *iwt, struct ScaIconNode *in);
886 STRPTR SafeStrCat(STRPTR dest, CONST_STRPTR src, size_t DestLen);
887 BOOL CheckAllowCloseWB(void);
888 void ClearMsgPort(struct MsgPort *msgPort);
890 ULONG WaitReply(struct MsgPort *port, struct internalScaWindowTask *iwt, ULONG MsgType);
891 ULONG HandleWindowTaskIconPortMessages(struct internalScaWindowTask *iwt,
892 struct Message *msg, ULONG *MessageType);
894 /* ------------------------------------------------- */
896 // defined in TextIconClass.c
898 Class * initTextIconClass(void);
900 /* ------------------------------------------------- */
902 // defined in TextIconHighlightClass.c
904 Class *initTextIconHighlightClass(void);
906 /* ------------------------------------------------- */
908 // defined in TextWindowClass.c
910 struct ScalosClass *initTextWindowClass(const struct PluginClass *plug);
911 void ReposTextIcons2(struct internalScaWindowTask *iwt);
912 HOOKFUNC GetTextIconSortFunction(struct internalScaWindowTask *iwt);
914 /* ------------------------------------------------- */
916 // defined in TitleClass.c
918 struct ScalosClass *initTitleClass(const struct PluginClass *plug);
919 void TitleClass_Convert64KMG(ULONG64 Number, STRPTR Buffer, size_t MaxLen);
920 void TitleClass_Convert64KMGRounded(ULONG64 Number, STRPTR Buffer, size_t MaxLen, ULONG Round);
922 /* ------------------------------------------------- */
924 // defined in ThumbnailCache.c
926 BOOL ThumbnailCacheInit(void);
927 void CleanupThumbnailCache(void);
928 BOOL ThumbnailCacheOpen(APTR *pThumbnailCacheHandle);
929 void ThumbnailCacheClose(APTR *pThumbnailCacheHandle);
930 void ThumbnailCacheAddARGB(BPTR fLock, APTR ThumbnailCacheHandle,
931 const struct ARGBHeader *argbh, ULONG LifetimeDays);
932 void ThumbnailCacheAddRemapped(BPTR fLock, APTR ThumbnailCacheHandle,
933 const struct ScalosBitMapAndColor *sac, ULONG LifetimeDays);
934 BOOL ThumbnailCacheFindARGB(BPTR fLock, APTR ThumbnailCacheHandle,
935 struct ARGBHeader *argbh, ULONG LifetimeDays);
936 struct ScalosBitMapAndColor *ThumbnailCacheFindRemapped(BPTR fLock,
937 APTR ThumbnailCacheHandle, ULONG LifetimeDays);
938 BOOL ThumbnailCacheRemoveEntry(BPTR DirLock, CONST_STRPTR FileName);
939 BOOL ThumbnailCacheCleanup(APTR ThumbnailCacheHandle);
940 BOOL ThumbnailCacheBegin(APTR ThumbnailCacheHandle);
941 BOOL ThumbnailCacheFinish(APTR ThumbnailCacheHandle);
943 /* ------------------------------------------------- */
945 // defined in Thumbnails.c
947 BOOL AddThumbnailIcon(struct internalScaWindowTask *iwt, Object *IconObj,
948 BPTR DirLock, CONST_STRPTR Name, ULONG Flags, APTR UndoStep);
949 BOOL GenerateThumbnails(struct internalScaWindowTask *iwt);
950 void RearrangeThumbnailList(struct internalScaWindowTask *iwt);
951 void FlushThumbnailEntries(struct internalScaWindowTask *iwt);
952 void RemoveThumbnailEntry(struct internalScaWindowTask *iwt, Object *IconObj);
953 BOOL SetIconThumbnailARGB(struct internalScaWindowTask *iwt,
954 struct SM_SetThumbnailImage_ARGB *smtia);
955 BOOL SetIconThumbnailRemapped(struct internalScaWindowTask *iwt,
956 struct SM_SetThumbnailImage_Remapped *smtir);
957 void ThumbnailsStartCleanup(BOOL Force);
959 /* ------------------------------------------------- */
961 // defined in ToolTip.c
963 ULONG IconWinShowIconToolTip(struct internalScaWindowTask *iwt, struct ScaIconNode *in);
964 ULONG IconWinShowGadgetToolTip(struct internalScaWindowTask *iwt, ULONG GadgetID, struct Hook *GadgetTextHook);
965 void ResetToolTips(struct internalScaWindowTask *iwt);
966 void GetProtectionString(ULONG Protection, STRPTR String, size_t MaxLen);
968 /* ------------------------------------------------- */
970 // defined in ToolTypes.c
972 LONG SetToolType(Object *iconObj, CONST_STRPTR ToolTypeName, CONST_STRPTR ToolTypeValue, BOOL SaveIcon);
973 LONG RemoveToolType(Object *iconObj, CONST_STRPTR ToolTypeName, BOOL SaveIcon);
974 STRPTR *CloneToolTypeArray(CONST_STRPTR *ToolTypeArray, ULONG AdditionalEntries);
976 /* ------------------------------------------------- */
978 // defined in TTLayout.c
980 void ScaFormatString(char *Buffer, const char *Format, ...);
981 void ScaFormatStringMaxLength(char *Buffer, size_t BuffLen, const char *Format, ...);
982 void ScaFormatStringArgs(char *Buffer, size_t BuffLength, const char *Format, APTR Args);
984 /* ------------------------------------------------- */
986 // defined in Undo.c
988 void UndoCleanup(void);
989 BOOL UndoAddEvent(struct internalScaWindowTask *iwt, enum ScalosUndoType type, ULONG FirstTag, ...);
990 BOOL UndoAddEventTagList(struct internalScaWindowTask *iwt, enum ScalosUndoType type, struct TagItem *TagList);
991 APTR UndoBeginStep(void);
992 void UndoEndStep(struct internalScaWindowTask *iwt, APTR event);
993 BOOL Undo(struct internalScaWindowTask *iwt);
994 BOOL Redo(struct internalScaWindowTask *iwt);
995 CONST_STRPTR UndoGetDescription(void);
996 CONST_STRPTR RedoGetDescription(void);
997 void UndoWindowSignalOpening(struct internalScaWindowTask *iwt);
998 void UndoWindowSignalClosing(struct internalScaWindowTask *iwt);
1000 /* ------------------------------------------------- */
1002 // defined in Wbl.c
1004 SAVEDS(ULONG) INTERRUPT WblTask(void);
1005 void RemWBProgram(struct WBStartup *wbStart);
1007 /* ------------------------------------------------- */
1009 // defined in WBStartup.c
1011 SAVEDS(void) INTERRUPT WBStartup(void);
1012 void WBStartupFinished(void);
1014 /* ------------------------------------------------- */
1016 // defined in Window.c
1018 BOOL QueryObjectUnderPointer(struct internalScaWindowTask **iWinUnderPtr,
1019 struct ScaIconNode **IconUnderPtr,
1020 struct ScaIconNode **OuterBoundsIconUnderPtr,
1021 struct Window **foreignWindow);
1022 void AdjustIconActive(struct internalScaWindowTask *iwt);
1023 BOOL isCopyQualifier(ULONG Qualifier);
1024 BOOL isMakeLinkQualifier(ULONG Qualifier);
1025 BOOL isMoveQualifier(ULONG Qualifier);
1026 BOOL isAlternateLssoQualifier(ULONG Qualifier);
1027 void RunMenuCommand(struct internalScaWindowTask *iwt,
1028 struct ScalosMenuTree *mtr, struct ScaIconNode *in, ULONG Flags);
1029 void RunMenuCommandExt(struct internalScaWindowTask *iwt, struct internalScaWindowTask *iwtDest,
1030 struct ScalosMenuTree *mtr, struct ScaIconNode *in, ULONG Flags);
1031 LONG ScalosPutIcon(struct ScaIconNode *in, BPTR destDirLock, BOOL NeedUpdateIcon);
1032 Object *LoadIconObject(BPTR DirLock, CONST_STRPTR IconName, struct TagItem *TagList);
1033 LONG SaveIconObject(Object *IconObj, BPTR DirLock,
1034 CONST_STRPTR IconName, BOOL NeedUpdateIcon,
1035 struct TagItem *TagList);
1036 void LockedCloseWindow(struct Window *win);
1037 struct Window *LockedOpenWindowTagList(struct NewWindow *nw, struct TagItem *TagList);
1038 struct Window *LockedOpenWindowTags(struct NewWindow *nw, ULONG FirstTag, ...);
1039 VOID LockedSetWindowTitles(struct Window *win,
1040 CONST_STRPTR WindowTitle, CONST_STRPTR ScreenTitle);
1041 void SafeSetMenuStrip(struct Window *win);
1042 void SafeClearMenuStrip(struct Window *win);
1043 CONST_STRPTR GetIconName(const struct ScaIconNode *in);
1044 ULONG DisposeScalosWindow(struct internalScaWindowTask *iwt, struct ScaWindowStruct **WindowList);
1045 void AdjustRenamedWindowName(BPTR objLock);
1046 void LockWindow(struct internalScaWindowTask *iwt);
1047 void UnLockWindow(struct internalScaWindowTask *iwt);
1048 struct ScalosMenuTree *CloneMenuTree(const struct ScalosMenuTree *mtr);
1049 void DisposeMenuTree(struct ScalosMenuTree *mtr);
1050 void AppendToMenuTree(struct ScalosMenuTree **mtreList, struct ScalosMenuTree *mTree);
1051 void SetIconWindowReadOnly(struct internalScaWindowTask *iwt, BOOL IsReadOnly);
1052 void RedrawResizedWindow(struct internalScaWindowTask *iwt,
1053 WORD OldInnerWidth, WORD OldInnerHeight);
1054 void ScaLockLayers(struct Layer_Info *li);
1055 void ScaUnlockLayers(struct Layer_Info *li);
1056 void ScaLockScreenLayers(void);
1057 void ScaUnlockScreenLayers(void);
1058 ULONG ScaLockIBase(ULONG LockNumber);
1059 void ScaUnlockIBase(ULONG Lock);
1060 void UpdateIconOverlays(struct internalScaWindowTask *iwt);
1061 void AddIconOverlay(Object *IconObj, ULONG NewOverlay);
1062 void RemoveIconOverlay(Object *IconObj, ULONG OldOverlay);
1063 BOOL ScalosAttemptLockIconListShared(struct internalScaWindowTask *iwt);
1064 BOOL ScalosAttemptLockIconListExclusive(struct internalScaWindowTask *iwt);
1066 #ifndef DEBUG_SEMAPHORES
1067 void ScalosLockIconListShared(struct internalScaWindowTask *iwt);
1068 void ScalosLockIconListExclusive(struct internalScaWindowTask *iwt);
1069 #endif /* DEBUG_SEMAPHORES */
1071 void ScalosUnLockIconList(struct internalScaWindowTask *iwt);
1072 struct WindowHistoryEntry *WindowAddHistoryEntry(struct internalScaWindowTask *iwt, BPTR wsLock);
1073 void WindowHistoryEntryDispose(struct internalScaWindowTask *iwt, struct WindowHistoryEntry *whe);
1074 struct WindowHistoryEntry *WindowFindHistoryEntry(struct internalScaWindowTask *iwt, BPTR wsLock);
1075 void WindowNewPath(struct internalScaWindowTask *iwt, CONST_STRPTR path);
1076 void WindowCastShadow(struct Window *win, LONG ShadowWidth, LONG ShadowHeight);
1077 void WindowSendAppIconMsg(struct internalScaWindowTask *iwt, ULONG AppIconClass, struct ScaIconNode *in);
1078 void WindowFadeIn(struct Window *win);
1079 void WindowFadeOut(struct Window *win);
1081 /* ------------------------------------------------- */
1083 // defined in WindowClass.c
1085 struct ScalosClass *initWindowClass(const struct PluginClass *plug);
1087 /* ------------------------------------------------- */
1089 // defined in windowtask.c
1091 extern void WindowTask(void);
1093 /* ------------------------------------------------- */
1095 // Handling of varargs
1097 #if defined(__MORPHOS__) || defined(__amigaos4__)
1099 #include <stdarg.h>
1101 #define ScaFormatString(Buffer, Format, ...) \
1102 ({ ULONG _args[] = { __VA_ARGS__ }; \
1103 ScaFormatStringArgs((Buffer), INT_MAX, (Format), _args); })
1105 #define ScaFormatStringMaxLength(Buffer, BuffLen, Format, ...) \
1106 ({ ULONG _args[] = { __VA_ARGS__ }; \
1107 ScaFormatStringArgs((Buffer), BuffLen, (Format), _args); })
1109 #endif /* __MORPHOS__ */
1112 #if defined(__SASC)
1113 int snprintf(char *, size_t, const char *, /*args*/ ...);
1114 int vsnprintf(char *, size_t, const char *, va_list ap);
1115 #endif /* __SASC */
1117 #endif /* FUNCTIONS_H */