9 #include <exec/types.h>
10 #include <dos/datetime.h>
11 #include <intuition/intuition.h>
12 #include <datatypes/iconobject.h>
13 #include <scalos/scalos.h>
16 #include "scalos_structures.h"
22 /* ------------------------------------------------- */
25 #define min(a, b) ((a) < (b) ? (a) : (b))
29 #define max(a, b) ((a) > (b) ? (a) : (b))
32 /* ------------------------------------------------- */
38 /* ================================================= */
39 /* ================================================= */
41 /* ------------------------------------------------- */
43 // defined in amiga.lib
46 extern ULONG
HookEntry();
49 //----------------------------------------------------------------------------
51 /* ================================================= */
52 /* ================================================= */
56 void AboutProg(struct internalScaWindowTask
*iwt
, const struct MenuCmdArg
*mcArg
);
57 BOOL
ReadScalosLogo(struct DatatypesImage
**Logo
);
59 /* ------------------------------------------------- */
61 // defined in AppMenu.c
63 void AppMenu_Init(void);
64 BOOL
AppMenu_AddItem(struct AppMenuInfo
*ami
);
65 BOOL
AppMenu_RemoveItem(struct AppMenuInfo
*ami
);
66 void AppMenu_DisposeAppMenuInfo(struct AppMenuInfo
*ami
);
67 void AppMenu_CreateMenu(void);
68 void AppMenu_ResetMenu(void);
69 struct ScaWindowStruct
*FindActiveScalosWindow(void);
71 /* ------------------------------------------------- */
73 // defined in AutoUpdate.c
75 ULONG
DeviceWindowCheckUpdate(struct internalScaWindowTask
*iwt
);
76 ULONG
IconWindowCheckUpdate(struct internalScaWindowTask
*iwt
);
77 ULONG
TextWindowCheckUpdate(struct internalScaWindowTask
*iwt
);
78 void RealUpdateIcon(struct internalScaWindowTask
*iwt
, struct UpdateIconData
*arg
);
80 /* ------------------------------------------------- */
82 // defined in Backdrop.c
84 void BackDropInitList(struct BackDropList
*bdl
);
85 LONG
BackdropLoadList(struct BackDropList
*bdl
);
86 void BackdropFreeList(struct BackDropList
*bdl
);
87 void BackdropFilterList(struct BackDropList
*bdl
, BPTR dirLock
);
88 BOOL
BackdropAddLine(struct BackDropList
*bdl
, CONST_STRPTR NewLine
, LONG PosX
, LONG PosY
);
89 BOOL
BackdropRemoveLine(struct BackDropList
*bdl
, BPTR iconLock
);
90 BOOL
RewriteBackdrop(struct ScaIconNode
*in
);
91 ULONG
AdjustBackdropRenamed(BPTR oLock
, struct ScaIconNode
*in
);
92 struct ScaIconNode
*AddBackdropIcon(BPTR iconDirLock
, CONST_STRPTR iconName
, WORD PosX
, WORD PosY
);
93 struct ScaIconNode
*FindBackdropIcon(BPTR dirLock
, CONST_STRPTR iconName
);
94 struct ScaIconNode
*FindBackdropIconExclusive(BPTR dirLock
, CONST_STRPTR iconName
);
95 void DoLeaveOutIcon(struct internalScaWindowTask
*iwt
, BPTR DirLock
,
96 CONST_STRPTR IconName
, WORD x
, WORD y
);
97 BOOL
IsPermanentBackDropIcon(struct internalScaWindowTask
*iwt
, struct BackDropList
*bdl
,
98 BPTR fLock
, CONST_STRPTR FileName
);
99 void PutAwayIcon(struct internalScaWindowTask
*iwt
,
100 BPTR iconDirLock
, CONST_STRPTR IconName
, BOOL RemovePermanent
);
101 BOOL
BackdropWait(BPTR dirLock
);
103 /* ------------------------------------------------- */
105 // defined in BackFill.c
107 SAVEDS(ULONG
) BackFillHookFunc(struct Hook
*bfHook
, struct RastPort
*rp
, struct BackFillMsg
*msg
);
108 void WindowBackFill(struct RastPort
*rp
,
109 struct BackFillMsg
*msg
, struct BitMap
*bitmap
,
110 LONG bmWidth
, LONG bmHeight
, WORD BGPen
,
111 LONG XOffset
, LONG YOffset
, APTR MaskPlane
);
113 /* ------------------------------------------------- */
115 // defined in ButtonClassGadget.c
117 struct ScalosClass
*initButtonGadgetClass(const struct PluginClass
*plug
);
119 /* ------------------------------------------------- */
121 // defined in ChildProcess.c
123 // NumLongs : number of longwords in ArgArray (!!not number of entries!!)
124 BOOL
RunProcess(struct ScaWindowTask
*iwt
, RUNPROCFUNC Routine
, ULONG NumLongs
,
125 struct WBArg
*ArgArray
, struct MsgPort
*ReplyPort
);
126 BOOL
ChildProcessRun(struct internalScaWindowTask
*iwt
, struct ScalosMessage
*msg
, ULONG FirstTag
, ...);
128 /* ------------------------------------------------- */
130 // defined in Class.c
132 ULONG
ClassDragQuery(struct DragEnter
*drge
, struct internalScaWindowTask
*swt
);
133 ULONG
ClassDragEnter(struct DragEnter
*drge
, struct internalScaWindowTask
*swt
);
134 ULONG
ClassDragLeave(struct DragEnter
*drge
, struct internalScaWindowTask
*swt
);
135 void ClassHideDragBobs(struct internalScaWindowTask
*iwt
, struct DragHandle
*dh
);
136 void ClassSelectIcon(struct ScaWindowStruct
*swi
, struct ScaIconNode
*sIcon
, BOOL Selected
);
137 void ClassSelectIconObj(struct ScaWindowStruct
*swi
, Object
*IconObj
, BOOL Selected
);
138 ULONG
ClassCheckInfoData(const struct InfoData
*info
);
139 BOOL
ClassIsDiskWritable(BPTR dLock
);
140 ULONG
ClassWinTimerMsg(struct internalScaWindowTask
*, struct Message
*, APTR
);
141 void ClassTimerToolTipMsg(struct internalScaWindowTask
*iwt
);
142 Object
*ClassGetWindowIconObject(struct internalScaWindowTask
*iwt
, Object
**allocIconObj
);
143 void ClassFormatDate(struct DateTime
*dt
, ULONG DateMaxLen
, ULONG TimeMaxLen
); // +jl+ 20010518
144 ULONG
ClassCountSelectedIcons(struct internalScaWindowTask
*iwt
);
145 void ClassDragFinish_IconWin(struct ScalosArg
**arglist
);
146 void ClassDragBegin_DeviceWin(struct ScalosArg
**ArgList
, struct DragNode
**dnList
);
147 void ClassDragBegin_IconWin(struct ScalosArg
**ArgList
, struct DragNode
**dn
);
148 void ClassSetDefaultIconFlags(struct ScaIconNode
*in
, BOOL IsDefIcon
);
150 /* ------------------------------------------------- */
152 // defined in cleanup.c
154 void IconWindow_UnCleanup(struct internalScaWindowTask
*iwt
, struct Region
*UnCleanUpRegion
);
155 extern void IconWindow_Cleanup(struct internalScaWindowTask
*iwt
);
157 /* ------------------------------------------------- */
159 // defined in CLIStart.c
161 BOOL
CLIStart(BPTR dirLock
, CONST_STRPTR PrgName
, Object
*iconObject
, ULONG def_StackSize
);
162 BPTR
DupWBPathList(void);
164 /* ------------------------------------------------- */
166 // defined in ControlBar.c
168 BOOL
ControlBarAdd(struct internalScaWindowTask
*iwt
);
169 void ControlBarRemove(struct internalScaWindowTask
*iwt
);
170 void ControlBarRebuild(struct internalScaWindowTask
*iwt
);
171 void ControlBarUpdateViewMode(struct internalScaWindowTask
*iwt
, UBYTE ViewByType
);
172 UBYTE
ControlBarViewModeFromCode(ULONG Code
);
173 void ControlBarUpdateShowMode(struct internalScaWindowTask
*iwt
);
174 void ControlBarUpdateHistory(struct internalScaWindowTask
*iwt
);
175 void SetControlBarOnOff(struct internalScaWindowTask
*iwt
);
176 void ControlBarSwitchHistoryEntry(struct internalScaWindowTask
*iwt
);
177 struct ExtGadget
*ControlBarFindGadget(struct internalScaWindowTask
*iwt
,
179 struct ControlBarGadgetEntry
*ControlBarFindGadgetByID(struct internalScaWindowTask
*iwt
, UWORD GadgetID
);
180 UWORD
ControlBarQueryGadgetType(struct internalScaWindowTask
*iwt
, struct ExtGadget
*gg
);
181 void ControlBarActionButton(struct internalScaWindowTask
*iwt
, struct ExtGadget
*gg
);
183 /* ------------------------------------------------- */
185 // defined in crc32.c
187 ULONG
update_crc(ULONG crc
, const unsigned char *buf
, size_t len
);
189 /* ------------------------------------------------- */
191 // defined in CycleGadgetClass.c
193 struct ScalosClass
*initCycleGadgetClass(const struct PluginClass
*plug
);
195 /* ------------------------------------------------- */
197 // defined in DefIcons.c
199 LONG
InitDefIcons(void);
200 void CleanupDefIcons(void);
201 void NewDefIconsPrefs(struct internalScaWindowTask
*iwt
, struct NotifyMessage
*msg
);
202 BOOL
ChangedDefIconsPrefs(void);
203 struct TypeNode
*DefIconsIdentify(BPTR dirLock
, CONST_STRPTR Name
, IPTR IconType
);
204 Object
*ReturnDefIconObjTags(BPTR dirLock
, CONST_STRPTR Name
, ULONG FirstTag
, ...);
205 Object
*ReturnDefIconObj(BPTR dirLock
, CONST_STRPTR Name
, struct TagItem
*TagList
);
207 /* ------------------------------------------------- */
209 // defined in DeviceWindowClass.c
211 struct ScalosClass
*initDeviceWindowClass(const struct PluginClass
*plug
);
212 void FreeBackdropIconList(struct ScaBackdropIcon
**bdiList
);
213 void RemoveScalosBackdropIcon(struct ScaIconNode
*in
);
214 void CreateSbiForIcon(struct ScaIconNode
*in
);
216 /* ------------------------------------------------- */
218 // defined in DevListClass.c
220 struct ScalosClass
*initDevListClass(const struct PluginClass
*plug
);
222 /* ------------------------------------------------- */
224 // defined in DoubleClick.c
226 BOOL
IconDoubleClick(struct internalScaWindowTask
*iwt
, struct ScaIconNode
*in
, ULONG Flags
);
227 BOOL
ArexxToolStart(struct internalScaWindowTask
*iwt
, BPTR dirLock
, CONST_STRPTR ProgName
);
229 /* ------------------------------------------------- */
231 // defined in DragDrop.c
233 void DragDrop(struct Window
*win
, LONG MouseX
, LONG MouseY
, ULONG Qualifier
,
234 struct internalScaWindowTask
*iwt
);
235 ULONG
ScalosDropAddIcon(BPTR DirLock
, CONST_STRPTR IconName
, WORD x
, WORD y
);
236 void ScalosDropRemoveIcon(BPTR DirLock
, CONST_STRPTR IconName
);
238 /* ------------------------------------------------- */
240 // defined in DragDropBobs.c
242 void InitDrag(struct IntuiMessage
*iMsg
, struct internalScaWindowTask
*iwt
);
243 void RestoreDragIcons(struct internalScaWindowTask
*iwt
);
244 BOOL
SuspendDrag(struct DragHandle
*dh
, struct internalScaWindowTask
*iwt
);
245 void ResumeDrag(struct DragHandle
*dh
, struct internalScaWindowTask
*iwt
, BOOL wasLocked
);
246 void ReLockDrag(struct DragHandle
*dh
, struct internalScaWindowTask
*iwt
, BOOL wasLocked
);
247 LIBFUNC_P2_PROTO(void, sca_LockDrag
,
248 A0
, struct DragHandle
*, dh
,
249 A6
, struct ScalosBase
*, ScalosBase
, 0);
250 LIBFUNC_P2_PROTO(ULONG
, sca_UnlockDrag
,
251 A0
, struct DragHandle
*, dh
,
252 A6
, struct ScalosBase
*, ScalosBase
, 0);
253 void DrawDrag(ULONG DrawFlags
, struct internalScaWindowTask
*iwt
);
254 LIBFUNC_P8_PROTO(BOOL
, sca_AddBob
,
255 A0
, struct DragHandle
*, dh
,
256 A1
, struct BitMap
*, bm
,
262 A6
, struct ScalosBase
*, ScalosBase
, 0);
263 LIBFUNC_P5_PROTO(void, sca_DrawDrag
,
264 A0
, struct DragHandle
*, dh
,
268 A6
, struct ScalosBase
*, ScalosBase
, 0);
269 LIBFUNC_P2_PROTO(void, sca_EndDrag
,
270 A0
, struct DragHandle
*, dh
,
271 A6
, struct ScalosBase
*, ScalosBase
, 0);
272 LIBFUNC_P2_PROTO(struct DragHandle
*, sca_InitDrag
,
273 A0
, struct Screen
*, Scr
,
274 A6
, struct ScalosBase
*, ScalosBase
, 0);
275 void EndDrag(struct internalScaWindowTask
*iwt
);
276 void EndDragUnlock(struct internalScaWindowTask
*iwt
);
277 void DragRefreshIcons(struct internalScaWindowTask
*iwt
);
278 void BlitARGBMask(ULONG SrcWidth
, ULONG SrcHeight
,
279 const struct ARGB
*Src
, LONG SrcLeft
, LONG SrcTop
,
280 ULONG DestWidth
, struct ARGB
*Dest
, LONG DestLeft
, LONG DestTop
,
281 const struct BitMap
*MaskBM
, ULONG Trans
);
282 void BlitARGB(ULONG SrcWidth
, ULONG SrcHeight
,
283 const struct ARGB
*Src
, LONG SrcLeft
, LONG SrcTop
,
284 ULONG DestWidth
, struct ARGB
*Dest
, LONG DestLeft
, LONG DestTop
,
287 /* ------------------------------------------------- */
289 // defined in DrawIcon.c
291 void EraseIconObject(struct internalScaWindowTask
*iwt
, Object
*IconObj
);
292 void DrawIconObject(struct internalScaWindowTask
*iwt
, Object
*IconObj
, ULONG Flags
);
293 void BlitARGBAlpha(struct RastPort
*rp
, const struct ARGBHeader
*SrcH
,
294 ULONG DestLeft
, ULONG DestTop
,
295 ULONG SrcLeft
, ULONG SrcTop
,
296 ULONG Width
, ULONG Height
,
297 struct ARGB
*BufferBg
);
298 void ScalosBlurPixelArray(struct ARGB
*Dest
, const struct ARGB
*Src
,
299 UWORD SizeX
, UWORD SizeY
, const UBYTE
*Mask
);
300 ULONG
ScalosReadPixelArray(APTR DestRect
, UWORD DestMod
, struct RastPort
*rp
,
301 UWORD SrcX
, UWORD SrcY
, UWORD SizeX
, UWORD SizeY
);
302 ULONG
ScalosWritePixelArray(APTR SrcRect
, UWORD SrcMod
, struct RastPort
*rp
,
303 UWORD DestX
, UWORD DestY
, UWORD SizeX
, UWORD SizeY
);
304 void RemoveIcons(struct internalScaWindowTask
*iwt
, struct ScaIconNode
**);
305 BOOL
IsIconObjVisible(const struct internalScaWindowTask
*iwt
, const Object
*IconObj
);
306 void DrawIconObjectTransparent(struct internalScaWindowTask
*iwt
, Object
*IconObj
,
307 ULONG ScreenDepth
, struct RastPort
*rp
, struct RastPort
*rpMask
,
308 ULONG transparency
, BOOL RealTransparency
);
309 void DrawIconObjectK(struct internalScaWindowTask
*iwt
, Object
*IconObj
,
310 ULONG ScreenDepth
, struct RastPort
*rp
, struct RastPort
*rpMask
,
311 const struct ARGB
*K
);
313 /* ------------------------------------------------- */
315 // defined in DropMarks.c
317 void CleanupDropMarkInfoList(struct List
*dmList
);
318 void CleanupDropMarkInfo(struct DropMarkInfo
*dmi
);
319 void DisplayWindowDropMark(struct internalScaWindowTask
*iwt
);
320 void EraseWindowDropMark(struct internalScaWindowTask
*iwt
);
321 void RedrawWindowDropMark(struct internalScaWindowTask
*iwt
, struct Region
*clipRegion
);
322 void DisplayIconDropMark(struct internalScaWindowTask
*iwt
, struct ScaIconNode
*in
);
323 void EraseIconDropMark(struct internalScaWindowTask
*iwt
, struct ScaIconNode
*in
);
324 void DisplayGadgetClickMark(struct internalScaWindowTask
*iwt
, struct ExtGadget
*gg
);
325 void EraseGadgetClickMark(struct internalScaWindowTask
*iwt
, struct ExtGadget
*gg
);
327 /* ------------------------------------------------- */
329 // defined in dtimage.c
331 BOOL
InitDataTypesImage(void);
332 void CleanupDataTypesImage(void);
333 void DisposeDatatypesImage(struct DatatypesImage
**dti
);
334 struct DatatypesImage
*CreateDatatypesImage(CONST_STRPTR ImageName
, ULONG Flags
);
335 void FillBackground(struct RastPort
*rp
, struct DatatypesImage
*dtImage
,
336 WORD MinX
, WORD MinY
, WORD MaxX
, WORD MaxY
,
337 ULONG XStart
, ULONG YStart
);
338 void DtImageDraw(struct DatatypesImage
*dti
, struct RastPort
*rp
,
339 LONG Left
, LONG Top
, LONG Width
, LONG Height
);
340 BOOL
TempName(STRPTR Buffer
, size_t MaxLen
);
342 /* ------------------------------------------------- */
344 // defined in DtImageClass.c
346 Class
*initDtImageClass(void);
348 /* ------------------------------------------------- */
350 // defined in FileCommands.c
352 LONG
CreateLinkCommand(Class
*cl
, Object
*o
, BPTR SrcDirLock
, BPTR DestDirLock
,
353 CONST_STRPTR SrcFileName
, CONST_STRPTR DestFileName
);
354 LONG
MoveCommand(Class
*cl
, Object
*o
, BPTR SrcDirLock
, BPTR DestDirLock
, CONST_STRPTR FileName
);
355 LONG
CopyCommand(Class
*cl
, Object
*o
, BPTR SrcDirLock
, BPTR DestDirLock
,
356 CONST_STRPTR SrcFileName
, CONST_STRPTR DestFileName
);
357 LONG
DeleteCommand(Class
*cl
, Object
*o
, BPTR DirLock
, CONST_STRPTR FileName
);
358 LONG
CountCommand(Class
*cl
, Object
*o
, BPTR parentLock
, CONST_STRPTR Name
, BOOL Recursive
);
359 BOOL
ExistsObject(BPTR DirLock
, CONST_STRPTR Name
);
361 /* ------------------------------------------------- */
363 // defined in FileTransClass.c
365 struct ScalosClass
*initFileTransClass(const struct PluginClass
*plug
);
367 /* ------------------------------------------------- */
369 // defined in FileTypes.c
371 BOOL
FileTypeInit(void);
372 void FileTypeCleanup(void);
373 void FileTypeFlush(BOOL Final
);
374 struct FileTypeDef
*FindFileType(struct internalScaWindowTask
*iwt
, const struct ScaIconNode
*in
);
375 struct FileTypeDef
*FindFileTypeForTypeNode(struct internalScaWindowTask
*iwt
, const struct TypeNode
*tNode
);
376 void ReleaseFileType(struct FileTypeDef
*ftd
);
377 void NewFileTypesPrefs(struct internalScaWindowTask
*iwt
, struct NotifyMessage
*msg
);
378 BOOL
ChangedFileTypesPrefs(struct MainTask
*mt
);
380 /* ------------------------------------------------- */
382 // defined in FontUtil.c
384 BOOL
FontUtilInit(void);
385 WORD
Scalos_TextLength(struct RastPort
*rp
, CONST_STRPTR string
, WORD Length
);
386 ULONG
Scalos_TextFit(struct RastPort
*rp
, CONST_STRPTR string
, WORD Length
,
387 struct TextExtent
*textExtent
, struct TextExtent
*constrainingExtent
,
388 WORD strDirection
, UWORD constrainingBitWidth
, UWORD constrainingBitHeight
);
389 void Scalos_TextExtent(struct RastPort
*rp
, CONST_STRPTR string
,
390 WORD Length
, struct TextExtent
*tExt
);
391 void Scalos_Text(struct RastPort
*rp
, CONST_STRPTR string
, WORD Length
);
392 UWORD
Scalos_GetFontHeight(struct RastPort
*rp
);
393 UWORD
Scalos_GetFontBaseline(struct RastPort
*rp
);
394 ULONG
Scalos_SetSoftStyle(struct RastPort
*rp
, ULONG style
, ULONG enable
, struct TTFontFamily
*ttff
);
395 void Scalos_SetFontTransparency(struct RastPort
*rp
, ULONG Transparency
);
396 void Scalos_SetFont(struct RastPort
*rp
, struct TextFont
*tf
, struct TTFontFamily
*ttFont
);
397 ULONG
Scalos_SetSoftStyle(struct RastPort
*rp
, ULONG style
, ULONG enable
, struct TTFontFamily
*ttff
);
398 APTR
Scalos_OpenTTFont(CONST_STRPTR FontDesc
, struct TTFontFamily
*ttff
);
399 void Scalos_CloseFont(struct TextFont
**tf
, struct TTFontFamily
*ttFont
);
400 void Scalos_InitRastPort(struct RastPort
*rp
);
401 void Scalos_DoneRastPort(struct RastPort
*rp
);
403 /* ------------------------------------------------- */
405 // defined in FrameImageClass.c
407 struct ScalosClass
*initFrameImageClass(const struct PluginClass
*plug
);
409 /* ------------------------------------------------- */
411 // defined in Functions.c
413 LIBFUNC_P2_PROTO(BOOL
, sca_OpenIconWindow
,
414 A0
, struct TagItem
*, TagList
,
415 A6
, struct ScalosBase
*, ScalosBase
, 0);
416 BPTR
DiskInfoLock(const struct ScaIconNode
*in
);
417 STRPTR
GetWsNameFromLock(BPTR WsLock
);
418 Object
*FunctionsFindIconObjectForPath(CONST_STRPTR Path
, BOOL
*WindowListLocked
,
419 struct ScaWindowStruct
**wsIconListLocked
, Object
**allocIconObj
);
420 void FunctionsGetSettingsFromIconObject(struct IconWindowProperties
*iwp
, Object
*IconObj
);
422 /* ------------------------------------------------- */
424 // defined in GadgetBarClass.c
426 struct ScalosClass
*initGadgetBarClass(const struct PluginClass
*plug
);
428 /* ------------------------------------------------- */
430 // defined in GadgetBarImageClass.c
432 struct ScalosClass
*initGadgetBarImageClass(const struct PluginClass
*plug
);
434 /* ------------------------------------------------- */
436 // defined in GadgetBarTextClass.c
438 struct ScalosClass
*initGadgetBarTextClass(const struct PluginClass
*plug
);
440 /* ------------------------------------------------- */
442 // defined in GaugeGadgetClass.c
444 struct ScalosClass
*initGaugeGadgetClass(const struct PluginClass
*plug
);
446 /* ------------------------------------------------- */
448 // defined in HistoryGadgetClass.c
450 struct ScalosClass
*initHistoryGadgetClass(const struct PluginClass
*plug
);
452 /* ------------------------------------------------- */
454 // defined in idcmp.c
456 ULONG
IDCMPRefreshWindow(struct internalScaWindowTask
*iwt
, struct IntuiMessage
*iMsg
);
457 ULONG
IDCMPDiskInserted(struct internalScaWindowTask
*iwt
, struct IntuiMessage
*iMsg
);
458 void AbortFunctions(struct internalScaWindowTask
*iwt
);
459 void RemoveDeviceIcon(struct internalScaWindowTask
*iwt
, struct ScaDeviceIcon
*di
,
460 struct ScaIconNode
**IconList
);
462 /* ------------------------------------------------- */
464 // defined in IconifyClass.c
466 Class
* initIconifyClass(void);
468 /* ------------------------------------------------- */
470 // defined in IconImageClass.c
472 Class
*initIconImageClass(void);
473 BOOL
freeIconImageClass(Class
*cl
);
475 /* ------------------------------------------------- */
477 // defined in IconWindowClass.c
479 struct ScalosClass
*initIconWindowClass(const struct PluginClass
*plug
);
481 /* ------------------------------------------------- */
483 // defined in IconWindow_MouseMove.c
485 void IDCMPDragMouseMove(struct internalScaWindowTask
*iwt
, struct IntuiMessage
*msg
);
486 void IconWin_EndDrag(struct internalScaWindowTask
*iwt
);
487 void IDCMPMMBMouseMove(struct internalScaWindowTask
*iwt
);
488 void IDCMPDragIntuiTicks(struct internalScaWindowTask
*iwt
, struct IntuiMessage
*msg
);
490 /* ------------------------------------------------- */
492 // defined in InputHandler.c
494 BOOL
InitInputHandler(void);
495 void CleanupInputHandler(void);
496 BOOL
PointInGadget(WORD x
, WORD y
, const struct Window
*win
, const struct Gadget
*gad
);
498 /* ------------------------------------------------- */
500 // defined in Lasso.c
502 void Lasso(WORD StartX
, WORD StartY
, ULONG Mode
, struct internalScaWindowTask
*iwt
);
503 void BeginLasso(struct internalScaWindowTask
*iwt
, UWORD Qualifier
);
504 void EndLasso(struct internalScaWindowTask
*iwt
);
506 /* ------------------------------------------------- */
508 // defined in LocaleStrings.c
510 CONST_STRPTR
GetLocString(LONG StringID
);
512 /* ------------------------------------------------- */
514 // defined in MainWait.c
516 void MainWait(struct MainTask
*mainTask
);
517 void RememberPrefsChanges(struct internalScaWindowTask
*iwt
, ULONG PrefsChangeFlags
);
518 void StartMainTaskTimer(struct MainTask
*mt
);
519 struct NotifyNode
*AddToMainNotifyList(struct NotifyTab
*nft
, ULONG Flags
);
520 void RemFromMainNotifyList(struct NotifyNode
*non
);
522 /* ------------------------------------------------- */
524 // defined in Memory.c
526 BOOL
MemoryInit(void);
527 void MemoryCleanup(void);
529 APTR
ScalosAlloc(ULONG Size
);
530 APTR
ScalosRealloc(APTR OldMem
, ULONG NewSize
);
531 void ScalosFree(APTR mem
);
532 #endif /* DEBUG_MEMORY */
533 STRPTR
AllocCopyString(CONST_STRPTR clp
);
534 void FreeCopyString(STRPTR lp
);
535 void *ScalosAllocNode(size_t size
);
536 void ScalosFreeNode(void *node
);
537 void *ScalosAllocMessage(size_t size
);
538 void ScalosFreeMessage(void *node
);
539 struct AnchorPath
*ScalosAllocAnchorPath(ULONG Flags
, size_t MaxPathLen
);
540 void ScalosFreeAnchorPath(struct AnchorPath
*ap
);
541 struct InfoData
*ScalosAllocInfoData(void);
542 void ScalosFreeInfoData(struct InfoData
**pId
);
543 STRPTR
AllocPathBuffer(void);
544 void FreePathBuffer(STRPTR Buffer
);
546 /* ------------------------------------------------- */
550 ULONG
GetWindowMenuFlags(struct internalScaWindowTask
*iwt
);
551 ULONG
ReadMenuPrefs(void);
552 void FreeMenuPrefs(void);
553 void ParseMenu(struct Menu
*theMenu
);
554 BOOL
CompareCommand(CONST_STRPTR MenuComName
, CONST_STRPTR CommandName
);
555 void SetMenuOnOff(struct internalScaWindowTask
*iwt
);
556 void NewMenuPrefs(struct internalScaWindowTask
*, struct NotifyMessage
*);
557 BOOL
ChangedMenuPrefs(struct MainTask
*mt
);
558 void CreateScalosMenu(void);
559 ULONG
UpdateIconCount(struct internalScaWindowTask
*iwt
);
560 void ClearMainMenu(void);
562 /* ------------------------------------------------- */
564 // defined in MenuCommand.c
566 void WBInfoStart(struct internalScaWindowTask
*iwt
, struct ScaIconNode
*in
, APTR undoEvent
);
567 void GetIconsBoundingBox(struct internalScaWindowTask
*iwt
, struct Rectangle
*BBox
);
568 void DeleteProg(struct internalScaWindowTask
*iwt
, const struct MenuCmdArg
*mcArg
);
569 void UpdateAllProg(struct internalScaWindowTask
*iwt
, const struct MenuCmdArg
*mcArg
);
570 void ClearSelectionProg(struct internalScaWindowTask
*iwt
, const struct MenuCmdArg
*mcArg
);
571 BOOL
ViewWindowBy(struct internalScaWindowTask
*iwt
, UBYTE NewViewByType
);
572 void SetIconWindowRect(struct ScaIconNode
*in
);
574 /* ------------------------------------------------- */
576 // defined in Messages.c
578 ULONG
CloseWindowMsg(struct internalScaWindowTask
*iwt
, struct Message
*Msg
, APTR p
);
579 ULONG
AsyncReplyMsg(struct internalScaWindowTask
*iwt
, struct Message
*Msg
, APTR p
);
580 LONG
SendAppMessage(struct AppObject
*appo
, ULONG AmClass
, WORD x
, WORD y
);
581 BPTR
LockScaModsDir(void); /* *** DM0008 */
583 /* ------------------------------------------------- */
585 // defined in MouseIcon.c
587 struct ScaIconNode
*CheckMouseIcon(struct ScaIconNode
**IconList
,
588 struct internalScaWindowTask
*iwt
,
590 struct ScaIconNode
*CheckMouseIconOuterBounds(struct ScaIconNode
**IconList
,
593 /* ------------------------------------------------- */
595 // defined in OpenDrawerByName.c
597 struct ScaWindowStruct
*OpenDrawerByName(CONST_STRPTR Path
, struct TagItem
*TagList
);
599 /* ------------------------------------------------- */
601 // defined in Patches.c
603 void SetAllPatches(struct MainTask
*mt
);
604 ULONG
RemoveAllPatches(struct MainTask
*mt
);
605 BOOL
PatchInit(void);
606 void PatchCleanup(void);
608 /* ------------------------------------------------- */
610 // defined in PopOpenWindows.c
612 void PopOpenWindow(struct internalScaWindowTask
*iwt
, struct DragHandle
*dh
);
613 void PopChildWindowDispose(struct internalScaWindowTask
*iwt
, struct ScaPopChildWindow
*spcw
);
614 void ClosePopupWindows(BOOL CloseAll
);
616 /* ------------------------------------------------- */
618 // defined in PopupMenus.c
620 LONG
TestPopup(struct internalScaWindowTask
*iwt
, WORD MouseX
, WORD MouseY
, UWORD Qualifier
);
621 void ShowPopupMenu(struct internalScaWindowTask
*iwt
, struct msg_ShowPopupMenu
*mpm
);
623 /* ------------------------------------------------- */
625 // defined in Patterns.c
627 void RandomizePatterns(void);
628 void PatternsOff(struct MainTask
*mt
, struct MsgPort
*ReplyPort
);
629 void PatternsOn(struct MainTask
*mt
);
630 struct PatternNode
*GetPatternNode(WORD PatternNo
, const struct PatternNode
*pNodeOld
);
631 ULONG
NewWindowPatternMsg(struct internalScaWindowTask
*iwt
, struct Message
*Msg
, APTR p
);
632 void FreeBackFill(struct PatternInfo
*);
633 BOOL
SetBackFill(struct internalScaWindowTask
*iwt
, struct PatternNode
*ptNode
,
634 struct PatternInfo
*ptInfo
, ULONG Flags
, struct Screen
*Scr
);
635 void SetScreenBackfillHook(struct Hook
*bfHook
);
637 /* ------------------------------------------------- */
639 // defined in Prefs.c
641 ULONG
ReadPalettePrefs(void);
642 void FreePalettePrefs(void);
643 void ReadFontPrefs(void);
644 void FreeFontPrefs(void);
645 LONG
WriteWBConfig(void);
646 LONG
ReadWBConfig(void);
647 void InitScalosPrefs(void);
648 BOOL
ReadScalosPrefs(void);
649 void FreeScalosPrefs(void);
650 LONG
ReadPatternPrefs(void);
651 void FreePatternPrefs(void);
652 ULONG
RandomNumber(ULONG MaxRand
);
653 void NewPatternPrefs(struct internalScaWindowTask
*, struct NotifyMessage
*);
654 BOOL
ChangedPatternPrefs(struct MainTask
*mt
);
655 void NewMainPrefs(struct internalScaWindowTask
*, struct NotifyMessage
*);
656 BOOL
ChangedMainPrefs(struct MainTask
*mt
);
657 void NewPalettePrefs(struct internalScaWindowTask
*, struct NotifyMessage
*);
658 BOOL
ChangedPalettePrefs(struct MainTask
*mt
);
659 void NewFontPrefs(struct internalScaWindowTask
*, struct NotifyMessage
*);
660 BOOL
ChangedFontPrefs(struct MainTask
*mt
);
661 ULONG
GetPrefsCRCFromFH(BPTR fh
);
662 ULONG
GetPrefsCRCFromName(CONST_STRPTR FileName
);
663 void OpenIconWindowFont(void);
664 void OpenTextWindowFont(void);
666 /* ------------------------------------------------- */
668 // defined in Rename.c
670 BOOL
CollectRenameAdjustHistoryPaths(struct List
*HList
, BPTR fLock
);
671 void AdjustRenameAdjustHistoryPaths(struct List
*HList
, BPTR fLock
);
672 void CleanupRenameAdjustHistoryPaths(struct List
*HList
, BOOL WinListLocked
);
674 /* ------------------------------------------------- */
676 // defined in Request.c
678 LONG
UseRequest(struct Window
*parentWin
, ULONG BodyTextNum
,
679 ULONG GadgetsTextNum
, APTR ArgList
);
680 LONG
UseRequestArgs(struct Window
*parentWin
,
681 ULONG BodyTextNum
, ULONG GadgetsTextNum
, ULONG NumArgs
, ...);
682 void UseAsyncRequestArgs(struct internalScaWindowTask
*,
683 LONG BodyTextNum
, LONG GadgetTextNum
, ULONG NumArgs
, ...);
685 /* ------------------------------------------------- */
687 // defined in RootClass.c
689 Class
* initRootClass(void);
690 void ProcessRootTimers(void);
692 /* ------------------------------------------------- */
694 // defined in ScaLibrary.c (is platform specific)
696 struct ScalosBase
*sca_MakeLibrary(void);
698 /* ------------------------------------------------- */
700 // defined in Scalos.c
702 void SelectIcons(WORD StartX
, WORD StartY
, WORD StopX
, WORD StopY
, struct internalScaWindowTask
*iwt
);
703 void FreeIconList(struct internalScaWindowTask
*iwt
, struct ScaIconNode
**IconList
);
704 void FreeIconNode(struct internalScaWindowTask
*iwt
, struct ScaIconNode
**IconList
, struct ScaIconNode
*in
);
705 BOOL
TestRegionNotEmpty(const struct Region
*region
);
706 void RefreshIconList(struct internalScaWindowTask
*iwt
, struct ScaIconNode
*in
, struct Region
*DrawingRegion
);
707 void RefreshIcons(struct internalScaWindowTask
*iwt
, struct Region
*DrawingRegion
);
708 ULONG
ChipMemAttr(void);
709 LONG
ScaSameLock(BPTR Lock1
, BPTR Lock2
);
710 void DisplayScreenTitleError(struct internalScaWindowTask
*iwt
, ULONG MsgId
);
711 BOOL
ExistsAssign(CONST_STRPTR AssignName
);
712 LONG
ScalosTagListInit(struct ScalosTagList
*tagList
);
713 void ScalosTagListCleanup(struct ScalosTagList
*tagList
);
714 LONG
ScalosTagListNewEntry(struct ScalosTagList
*tagList
, ULONG tag
, ULONG data
);
715 void ScalosTagListEnd(struct ScalosTagList
*tagList
);
716 struct TagItem
*ScalosVTagList(ULONG FirstTag
, va_list args
);
717 ULONG
TranslateViewModesFromIcon(ULONG IconViewMode
);
718 ULONG
TranslateViewModesToIcon(ULONG ScalosIconViewMode
);
719 ULONG
TranslateScalosViewMode(ULONG ScalosViewMode
);
720 BOOL
IsIwtViewByIcon(struct internalScaWindowTask
*iwt
);
721 BOOL
IsViewByIcon(ULONG ScalosViewMode
);
722 BOOL
IsShowAll(const struct ScaWindowStruct
*ws
);
723 BOOL
IsShowAllType(UWORD ShowType
);
724 void ScalosEndNotify(struct NotifyRequest
*nr
);
725 void SubtractDateStamp(struct DateStamp
*from
, const struct DateStamp
*to
);
726 Object
*CloneIconObject(Object
*OrigIconObj
);
728 #if !defined(__SASC) && !defined(__MORPHOS__)
729 // SAS/C compatibility functions
730 extern char *stpblk(const char *);
731 extern size_t stccpy(char *, const char *, size_t);
732 extern void strins(char *to
, const char *from
);
735 /* ------------------------------------------------- */
737 // defined in Scalos_Cx.c
740 void CleanupCx(void);
741 struct Screen
*SearchMouseScreen(LONG x
, LONG y
);
742 void HighlightIconUnderMouse(void);
743 void InvalidateLastIwtUnderPointer(struct internalScaWindowTask
*iwt
);
745 /* ------------------------------------------------- */
747 // defined in ScalosInit.c
749 SAVEDS(ULONG
) LockScalosPens(void);
750 SAVEDS(void) UnlockScalosPens(void);
751 BOOL
ChangedLocalePrefs(struct MainTask
*mt
);
753 /* ------------------------------------------------- */
755 // defined in ScalosLocale.c
757 void NewLocalePrefs(struct internalScaWindowTask
*iwt
, struct NotifyMessage
*msg
);
758 BOOL
ChangedLocalePrefs(struct MainTask
*mt
);
759 void InitLocale(void);
760 void CleanupLocale(void);
762 /* ------------------------------------------------- */
764 // defined in ScanDir.c
766 enum ScanDirResult
ReadIconList(struct internalScaWindowTask
*iwt
);
767 struct ScaIconNode
*IconWindowReadIcon(struct internalScaWindowTask
*iwt
,
768 CONST_STRPTR Name
, struct ScaReadIconArg
*ria
);
769 void SetIconSupportsFlags(struct ScaIconNode
*in
, BOOL isDiskWritable
);
770 BOOL
IsSoftLink(CONST_STRPTR Name
);
771 BOOL
IsNoIconPosition(const struct ExtGadget
*gg
);
772 void SetIconName(Object
*IconObj
, struct ScaIconNode
*in
);
773 enum ScanDirResult
GetFileList(struct ReadIconListControl
*rilc
,
774 enum ScanDirResult (*CheckFunc
)(struct ReadIconListControl
*rilc
),
775 BOOL UseExAll
, BOOL FetchIconType
, BOOL CheckOverlap
);
776 BOOL
RilcInit(struct ReadIconListControl
*rilc
, struct internalScaWindowTask
*iwt
);
777 void RilcCleanup(struct ReadIconListControl
*rilc
);
778 enum ScanDirResult
LinkIconScanList(struct ReadIconListControl
*rilc
);
779 LONG
AddFileToFilesList(struct ReadIconListControl
*rilc
, BPTR dirLock
, CONST_STRPTR Name
);
780 BOOL
IsFileHidden(CONST_STRPTR Filename
, ULONG Protection
);
781 BOOL
ScanDirIsBackDropIcon(struct internalScaWindowTask
*iwt
, struct BackDropList
*bdl
,
782 BPTR fLock
, CONST_STRPTR FileName
);
783 void ScanDirFillRildFromIse(struct ReadIconListData
*rild
, const struct IconScanEntry
*ise
);
784 void ScanDirUpdateStatusBarText(struct internalScaWindowTask
*iwt
, ULONG TotalIcons
);
785 BOOL
ScanDirIsError(enum ScanDirResult sdResult
);
787 /* ------------------------------------------------- */
789 // defined in ScanDirText.c
791 struct ScaIconNode
*TextWindowReadIcon(struct internalScaWindowTask
*iwt
,
792 CONST_STRPTR Name
, struct ScaReadIconArg
*ria
);
793 enum ScanDirResult
ReadTextWindowIconList(struct internalScaWindowTask
*iwt
);
795 /* ------------------------------------------------- */
797 // defined in Semaphores.c
799 BOOL
AttemptSemaphoreNoNest(SCALOSSEMAPHORE
*sema
);
800 void ScaObtainSemaphoreListA(struct TagItem
*TagList
);
801 void ScaObtainSemaphoreList(ULONG FirstTag
, ...);
802 BOOL
ScaAttemptSemaphoreListA(struct TagItem
*OriginalTagList
);
803 BOOL
ScaAttemptSemaphoreList(ULONG FirstTag
, ...);
805 #ifdef DEBUG_SEMAPHORES
807 SCALOSSEMAPHORE
*DebugScalosCreateSemaphore(CONST_STRPTR
, CONST_STRPTR
, ULONG
);
808 void DebugScalosDeleteSemaphore(SCALOSSEMAPHORE
*sema
, CONST_STRPTR
, CONST_STRPTR
, ULONG
);
809 void DebugScalosInitSemaphore(SCALOSSEMAPHORE
*xsema
, CONST_STRPTR
, CONST_STRPTR
, ULONG
);
810 void DebugScalosObtainSemaphore(SCALOSSEMAPHORE
*xsema
, CONST_STRPTR
, CONST_STRPTR
, ULONG
);
811 void DebugScalosObtainSemaphoreShared(SCALOSSEMAPHORE
*xsema
, CONST_STRPTR
, CONST_STRPTR
, ULONG
);
812 void DebugScalosReleaseSemaphore(SCALOSSEMAPHORE
*xsema
, CONST_STRPTR
, CONST_STRPTR
, ULONG
);
813 ULONG
DebugScalosAttemptSemaphore(SCALOSSEMAPHORE
*xsema
, CONST_STRPTR
, CONST_STRPTR
, ULONG
);
814 ULONG
DebugScalosAttemptSemaphoreShared(SCALOSSEMAPHORE
*xsema
, CONST_STRPTR
, CONST_STRPTR
, ULONG
);
816 void DebugScalosLockIconListShared(struct internalScaWindowTask
*iwt
,
817 CONST_STRPTR CallingFile
, CONST_STRPTR CallingFunc
, ULONG CallingLine
);
818 void DebugScalosLockIconListExclusive(struct internalScaWindowTask
*iwt
,
819 CONST_STRPTR CallingFile
, CONST_STRPTR CallingFunc
, ULONG CallingLine
);
821 #else /* DEBUG_SEMAPHORES */
823 SCALOSSEMAPHORE
*ScalosCreateSemaphore(void);
824 void ScalosDeleteSemaphore(SCALOSSEMAPHORE
*sema
);
825 void ScalosInitSemaphore(SCALOSSEMAPHORE
*xsema
);
826 void ScalosObtainSemaphore(SCALOSSEMAPHORE
*xsema
);
827 void ScalosObtainSemaphoreShared(SCALOSSEMAPHORE
*xsema
);
828 void ScalosReleaseSemaphore(SCALOSSEMAPHORE
*xsema
);
829 ULONG
ScalosAttemptSemaphore(SCALOSSEMAPHORE
*xsema
);
830 ULONG
ScalosAttemptSemaphoreShared(SCALOSSEMAPHORE
*xsema
);
832 #endif /* DEBUG_SEMAPHORES */
835 /* ------------------------------------------------- */
837 // defined in SeparatorClassGadget.c
839 struct ScalosClass
*initSeparatorGadgetClass(const struct PluginClass
*plug
);
841 /* ------------------------------------------------- */
843 // defined in Shortcuts.c
845 BOOL
ShortcutAddLines(struct BackDropList
*bdlVolume
);
846 void ShortcutReadPrefs(void);
847 void ShortcutFreePrefs(void);
848 BOOL
ShortcutAddEntry(STRPTR path
, LONG PosX
, LONG PosY
);
849 BOOL
ShortcutRemoveEntry(BPTR iconLock
);
851 /* ------------------------------------------------- */
853 // defined in Splash.c
855 ULONG
InitSplash(struct MsgPort
*ReplyPort
);
856 void SplashAddUser(void);
857 void SplashRemoveUser(void);
858 void SplashDisplayProgress(const char *fmt
, ULONG NumArgs
, ...);
860 /* ------------------------------------------------- */
862 // defined in StatusBar.c
864 BOOL
StatusBarAdd(struct internalScaWindowTask
*iwt
);
865 void StatusBarRemove(struct internalScaWindowTask
*iwt
);
866 UWORD
StatusBarQueryGadgetID(struct internalScaWindowTask
*iwt
,
867 const struct ExtGadget
*gg
, WORD x
, WORD y
);
869 /* ------------------------------------------------- */
871 // defined in StringGadgetClass.c
873 struct ScalosClass
*initStringGadgetClass(const struct PluginClass
*plug
);
875 /* ------------------------------------------------- */
877 // defined in Subroutines.c
879 void StripTrailingColon(STRPTR Line
);
880 void StripTrailingLF(STRPTR Line
);
881 void StripIconExtension(STRPTR Line
);
882 BOOL
CheckOverlap(struct internalScaWindowTask
*iwt
, struct ScaIconNode
*in
);
883 BOOL
ScaRectInRegion(const struct Region
*TestRegion
, const struct Rectangle
*TestRect
);
884 ULONG
CheckPosition(struct internalScaWindowTask
*iwt
, struct ScaIconNode
*in
);
885 STRPTR
SafeStrCat(STRPTR dest
, CONST_STRPTR src
, size_t DestLen
);
886 BOOL
CheckAllowCloseWB(void);
887 void ClearMsgPort(struct MsgPort
*msgPort
);
889 ULONG
WaitReply(struct MsgPort
*port
, struct internalScaWindowTask
*iwt
, ULONG MsgType
);
890 ULONG
HandleWindowTaskIconPortMessages(struct internalScaWindowTask
*iwt
,
891 struct Message
*msg
, ULONG
*MessageType
);
893 /* ------------------------------------------------- */
895 // defined in TextIconClass.c
897 Class
* initTextIconClass(void);
899 /* ------------------------------------------------- */
901 // defined in TextIconHighlightClass.c
903 Class
*initTextIconHighlightClass(void);
905 /* ------------------------------------------------- */
907 // defined in TextWindowClass.c
909 struct ScalosClass
*initTextWindowClass(const struct PluginClass
*plug
);
910 void ReposTextIcons2(struct internalScaWindowTask
*iwt
);
911 HOOKFUNC
GetTextIconSortFunction(struct internalScaWindowTask
*iwt
);
913 /* ------------------------------------------------- */
915 // defined in TitleClass.c
917 struct ScalosClass
*initTitleClass(const struct PluginClass
*plug
);
918 void TitleClass_Convert64KMG(ULONG64 Number
, STRPTR Buffer
, size_t MaxLen
);
919 void TitleClass_Convert64KMGRounded(ULONG64 Number
, STRPTR Buffer
, size_t MaxLen
, ULONG Round
);
921 /* ------------------------------------------------- */
923 // defined in ThumbnailCache.c
925 BOOL
ThumbnailCacheInit(void);
926 void CleanupThumbnailCache(void);
927 BOOL
ThumbnailCacheOpen(APTR
*pThumbnailCacheHandle
);
928 void ThumbnailCacheClose(APTR
*pThumbnailCacheHandle
);
929 void ThumbnailCacheAddARGB(BPTR fLock
, APTR ThumbnailCacheHandle
,
930 const struct ARGBHeader
*argbh
, ULONG LifetimeDays
);
931 void ThumbnailCacheAddRemapped(BPTR fLock
, APTR ThumbnailCacheHandle
,
932 const struct ScalosBitMapAndColor
*sac
, ULONG LifetimeDays
);
933 BOOL
ThumbnailCacheFindARGB(BPTR fLock
, APTR ThumbnailCacheHandle
,
934 struct ARGBHeader
*argbh
, ULONG LifetimeDays
);
935 struct ScalosBitMapAndColor
*ThumbnailCacheFindRemapped(BPTR fLock
,
936 APTR ThumbnailCacheHandle
, ULONG LifetimeDays
);
937 BOOL
ThumbnailCacheRemoveEntry(BPTR DirLock
, CONST_STRPTR FileName
);
938 BOOL
ThumbnailCacheCleanup(APTR ThumbnailCacheHandle
);
939 BOOL
ThumbnailCacheBegin(APTR ThumbnailCacheHandle
);
940 BOOL
ThumbnailCacheFinish(APTR ThumbnailCacheHandle
);
942 /* ------------------------------------------------- */
944 // defined in Thumbnails.c
946 BOOL
AddThumbnailIcon(struct internalScaWindowTask
*iwt
, Object
*IconObj
,
947 BPTR DirLock
, CONST_STRPTR Name
, ULONG Flags
, APTR UndoStep
);
948 BOOL
GenerateThumbnails(struct internalScaWindowTask
*iwt
);
949 void RearrangeThumbnailList(struct internalScaWindowTask
*iwt
);
950 void FlushThumbnailEntries(struct internalScaWindowTask
*iwt
);
951 void RemoveThumbnailEntry(struct internalScaWindowTask
*iwt
, Object
*IconObj
);
952 BOOL
SetIconThumbnailARGB(struct internalScaWindowTask
*iwt
,
953 struct SM_SetThumbnailImage_ARGB
*smtia
);
954 BOOL
SetIconThumbnailRemapped(struct internalScaWindowTask
*iwt
,
955 struct SM_SetThumbnailImage_Remapped
*smtir
);
956 void ThumbnailsStartCleanup(BOOL Force
);
958 /* ------------------------------------------------- */
960 // defined in ToolTip.c
962 ULONG
IconWinShowIconToolTip(struct internalScaWindowTask
*iwt
, struct ScaIconNode
*in
);
963 ULONG
IconWinShowGadgetToolTip(struct internalScaWindowTask
*iwt
, ULONG GadgetID
, struct Hook
*GadgetTextHook
);
964 void ResetToolTips(struct internalScaWindowTask
*iwt
);
965 void GetProtectionString(ULONG Protection
, STRPTR String
, size_t MaxLen
);
967 /* ------------------------------------------------- */
969 // defined in ToolTypes.c
971 LONG
SetToolType(Object
*iconObj
, CONST_STRPTR ToolTypeName
, CONST_STRPTR ToolTypeValue
, BOOL SaveIcon
);
972 LONG
RemoveToolType(Object
*iconObj
, CONST_STRPTR ToolTypeName
, BOOL SaveIcon
);
973 STRPTR
*CloneToolTypeArray(CONST_STRPTR
*ToolTypeArray
, ULONG AdditionalEntries
);
975 /* ------------------------------------------------- */
977 // defined in TTLayout.c
979 void ScaFormatString(char *Buffer
, const char *Format
, ...);
980 void ScaFormatStringMaxLength(char *Buffer
, size_t BuffLen
, const char *Format
, ...);
981 void ScaFormatStringArgs(char *Buffer
, size_t BuffLength
, const char *Format
, RAWARG Args
);
983 /* ------------------------------------------------- */
987 void UndoCleanup(void);
988 BOOL
UndoAddEvent(struct internalScaWindowTask
*iwt
, enum ScalosUndoType type
, ULONG FirstTag
, ...);
989 BOOL
UndoAddEventTagList(struct internalScaWindowTask
*iwt
, enum ScalosUndoType type
, struct TagItem
*TagList
);
990 APTR
UndoBeginStep(void);
991 void UndoEndStep(struct internalScaWindowTask
*iwt
, APTR event
);
992 BOOL
Undo(struct internalScaWindowTask
*iwt
);
993 BOOL
Redo(struct internalScaWindowTask
*iwt
);
994 CONST_STRPTR
UndoGetDescription(void);
995 CONST_STRPTR
RedoGetDescription(void);
996 void UndoWindowSignalOpening(struct internalScaWindowTask
*iwt
);
997 void UndoWindowSignalClosing(struct internalScaWindowTask
*iwt
);
999 /* ------------------------------------------------- */
1003 SAVEDS(ULONG
) INTERRUPT
WblTask(void);
1004 void RemWBProgram(struct WBStartup
*wbStart
);
1006 /* ------------------------------------------------- */
1008 // defined in WBStartup.c
1010 SAVEDS(void) INTERRUPT
WBStartup(void);
1011 void WBStartupFinished(void);
1013 /* ------------------------------------------------- */
1015 // defined in Window.c
1017 BOOL
QueryObjectUnderPointer(struct internalScaWindowTask
**iWinUnderPtr
,
1018 struct ScaIconNode
**IconUnderPtr
,
1019 struct ScaIconNode
**OuterBoundsIconUnderPtr
,
1020 struct Window
**foreignWindow
);
1021 void AdjustIconActive(struct internalScaWindowTask
*iwt
);
1022 BOOL
isCopyQualifier(ULONG Qualifier
);
1023 BOOL
isMakeLinkQualifier(ULONG Qualifier
);
1024 BOOL
isMoveQualifier(ULONG Qualifier
);
1025 BOOL
isAlternateLssoQualifier(ULONG Qualifier
);
1026 void RunMenuCommand(struct internalScaWindowTask
*iwt
,
1027 struct SCALOS_MENUTREE
*mtr
, struct ScaIconNode
*in
, ULONG Flags
);
1028 void RunMenuCommandExt(struct internalScaWindowTask
*iwt
, struct internalScaWindowTask
*iwtDest
,
1029 struct SCALOS_MENUTREE
*mtr
, struct ScaIconNode
*in
, ULONG Flags
);
1030 LONG
ScalosPutIcon(struct ScaIconNode
*in
, BPTR destDirLock
, BOOL NeedUpdateIcon
);
1031 Object
*LoadIconObject(BPTR DirLock
, CONST_STRPTR IconName
, struct TagItem
*TagList
);
1032 LONG
SaveIconObject(Object
*IconObj
, BPTR DirLock
,
1033 CONST_STRPTR IconName
, BOOL NeedUpdateIcon
,
1034 struct TagItem
*TagList
);
1035 void LockedCloseWindow(struct Window
*win
);
1036 struct Window
*LockedOpenWindowTagList(struct NewWindow
*nw
, struct TagItem
*TagList
);
1037 struct Window
*LockedOpenWindowTags(struct NewWindow
*nw
, ULONG FirstTag
, ...);
1038 VOID
LockedSetWindowTitles(struct Window
*win
,
1039 CONST_STRPTR WindowTitle
, CONST_STRPTR ScreenTitle
);
1040 void SafeSetMenuStrip(struct Window
*win
);
1041 void SafeClearMenuStrip(struct Window
*win
);
1042 CONST_STRPTR
GetIconName(const struct ScaIconNode
*in
);
1043 ULONG
DisposeScalosWindow(struct internalScaWindowTask
*iwt
, struct ScaWindowStruct
**WindowList
);
1044 void AdjustRenamedWindowName(BPTR objLock
);
1045 void LockWindow(struct internalScaWindowTask
*iwt
);
1046 void UnLockWindow(struct internalScaWindowTask
*iwt
);
1047 struct SCALOS_MENUTREE
*CloneMenuTree(const struct SCALOS_MENUTREE
*mtr
);
1048 void DisposeMenuTree(struct SCALOS_MENUTREE
*mtr
);
1049 void AppendToMenuTree(struct SCALOS_MENUTREE
**mtreList
, struct SCALOS_MENUTREE
*mTree
);
1050 void SetIconWindowReadOnly(struct internalScaWindowTask
*iwt
, BOOL IsReadOnly
);
1051 void RedrawResizedWindow(struct internalScaWindowTask
*iwt
,
1052 WORD OldInnerWidth
, WORD OldInnerHeight
);
1053 void ScaLockLayers(struct Layer_Info
*li
);
1054 void ScaUnlockLayers(struct Layer_Info
*li
);
1055 void ScaLockScreenLayers(void);
1056 void ScaUnlockScreenLayers(void);
1057 ULONG
ScaLockIBase(ULONG LockNumber
);
1058 void ScaUnlockIBase(ULONG Lock
);
1059 void UpdateIconOverlays(struct internalScaWindowTask
*iwt
);
1060 void AddIconOverlay(Object
*IconObj
, ULONG NewOverlay
);
1061 void RemoveIconOverlay(Object
*IconObj
, ULONG OldOverlay
);
1062 BOOL
ScalosAttemptLockIconListShared(struct internalScaWindowTask
*iwt
);
1063 BOOL
ScalosAttemptLockIconListExclusive(struct internalScaWindowTask
*iwt
);
1065 #ifndef DEBUG_SEMAPHORES
1066 void ScalosLockIconListShared(struct internalScaWindowTask
*iwt
);
1067 void ScalosLockIconListExclusive(struct internalScaWindowTask
*iwt
);
1068 #endif /* DEBUG_SEMAPHORES */
1070 void ScalosUnLockIconList(struct internalScaWindowTask
*iwt
);
1071 struct WindowHistoryEntry
*WindowAddHistoryEntry(struct internalScaWindowTask
*iwt
, BPTR wsLock
);
1072 void WindowHistoryEntryDispose(struct internalScaWindowTask
*iwt
, struct WindowHistoryEntry
*whe
);
1073 struct WindowHistoryEntry
*WindowFindHistoryEntry(struct internalScaWindowTask
*iwt
, BPTR wsLock
);
1074 void WindowNewPath(struct internalScaWindowTask
*iwt
, CONST_STRPTR path
);
1075 void WindowCastShadow(struct Window
*win
, LONG ShadowWidth
, LONG ShadowHeight
);
1076 void WindowSendAppIconMsg(struct internalScaWindowTask
*iwt
, ULONG AppIconClass
, struct ScaIconNode
*in
);
1077 void WindowFadeIn(struct Window
*win
);
1078 void WindowFadeOut(struct Window
*win
);
1080 /* ------------------------------------------------- */
1082 // defined in WindowClass.c
1084 struct ScalosClass
*initWindowClass(const struct PluginClass
*plug
);
1086 /* ------------------------------------------------- */
1088 // defined in windowtask.c
1090 extern void WindowTask(void);
1092 /* ------------------------------------------------- */
1094 // Handling of varargs
1096 #if defined(__MORPHOS__) || defined(__amigaos4__)
1100 #define ScaFormatString(Buffer, Format, ...) \
1101 ({ ULONG _args[] = { __VA_ARGS__ }; \
1102 ScaFormatStringArgs((Buffer), INT_MAX, (Format), _args); })
1104 #define ScaFormatStringMaxLength(Buffer, BuffLen, Format, ...) \
1105 ({ ULONG _args[] = { __VA_ARGS__ }; \
1106 ScaFormatStringArgs((Buffer), BuffLen, (Format), _args); })
1108 #endif /* __MORPHOS__ */
1112 int snprintf(char *, size_t, const char *, /*args*/ ...);
1113 int vsnprintf(char *, size_t, const char *, va_list ap
);
1116 #endif /* FUNCTIONS_H */