6 #include <exec/types.h>
7 #include <graphics/gels.h>
8 #include <graphics/rastport.h>
9 #include <intuition/classusr.h>
11 #include <dos/dostags.h>
12 #include <dos/exall.h>
16 #include <proto/exec.h>
17 #include <proto/layers.h>
18 #include <proto/graphics.h>
19 #include <proto/intuition.h>
20 #include <proto/iconobject.h>
21 #include <proto/utility.h>
22 #include <proto/datatypes.h>
24 #include <proto/scalos.h>
26 #include <clib/alib_protos.h>
29 #include <datatypes/iconobject.h>
30 #include <scalos/scalos.h>
38 #include "scalos_structures.h"
39 #include "functions.h"
40 #include "Variables.h"
42 //----------------------------------------------------------------------------
44 struct LassoWindowNode
46 struct Node lwn_Node
; // MUST be first structure member
47 struct internalScaWindowTask
*lwn_WindowTask
;
52 struct Node lin_Node
; // MUST be first structure member
53 struct Region
*lin_Region
;
54 struct internalScaWindowTask
*lin_WindowTask
;
55 struct ScaIconNode
*lin_IconNode
;
59 // Values in lin_Flags
60 #define LINFLGB_Selected 0 // Icon has been selected by Lasso()
61 #define LINFLGF_Selected (1 << LINFLGB_Selected)
63 //----------------------------------------------------------------------------
67 static void LassoInit(struct internalScaWindowTask
*iwt
, UWORD Qualifier
);
68 static void LassoCleanup(struct internalScaWindowTask
*iwt
);
69 static ULONG
LassoCleanupIconList(struct internalScaWindowTask
*iwt
);
70 static void AdjustLassoIcons(struct internalScaWindowTask
*iwt
,
71 WORD StartX
, WORD StartY
, WORD StopX
, WORD StopY
);
72 static void DrawRect(struct RastPort
*rp
, WORD x1
, WORD y1
, WORD x2
, WORD y2
);
73 static void LassoScrollWindow(struct internalScaWindowTask
*iwt
, LONG DeltaX
, LONG DeltaY
);
74 static ULONG
FillLassoIconList(struct internalScaWindowTask
*iwt
,
75 struct internalScaWindowTask
*iwtIcon
, struct Rectangle
*myRect
,
76 struct Region
*Region2
, struct Window
*win
);
77 static void LassoUpdateIconList(struct internalScaWindowTask
*iwt
);
78 static struct LassoWindowNode
*LassoAddWindow(struct LassoInfo
*li
, struct internalScaWindowTask
*iwt
);
80 //----------------------------------------------------------------------------
82 // build list of all visible icons
83 static void LassoInit(struct internalScaWindowTask
*iwt
, UWORD Qualifier
)
85 struct Region
*Region2
;
86 struct LassoInfo
*li
= &iwt
->iwt_LassoInfo
;
88 NewList((struct List
*) &li
->linf_IconList
);
89 NewList((struct List
*) &li
->linf_WindowList
);
91 Region2
= NewRegion();
95 li
->linf_SingleWindow
= isAlternateLssoQualifier(Qualifier
);
97 if (li
->linf_SingleWindow
)
99 // Lasso is limited to current window
100 li
->linf_Limits
.MinX
= li
->linf_Limits
.MaxX
= iwt
->iwt_WindowTask
.wt_Window
->LeftEdge
+ iwt
->iwt_InnerLeft
;
101 li
->linf_Limits
.MaxX
+= iwt
->iwt_InnerWidth
;
102 li
->linf_Limits
.MinY
= li
->linf_Limits
.MaxY
= iwt
->iwt_WindowTask
.wt_Window
->TopEdge
+ iwt
->iwt_InnerTop
;
103 li
->linf_Limits
.MaxY
+= iwt
->iwt_InnerHeight
;
105 if (LassoAddWindow(li
, iwt
))
107 OrRectRegion(Region2
, &li
->linf_Limits
);
109 ScalosLockIconListShared(iwt
);
110 FillLassoIconList(iwt
, iwt
, &li
->linf_Limits
, Region2
,
111 iwt
->iwt_WindowTask
.wt_Window
);
112 // ScalosUnLockIconList is done in LassoCleanup
117 // use entire screen for Lasso
118 struct Region
*Region1
;
119 struct Rectangle myRect
;
122 li
->linf_Limits
.MinX
= li
->linf_Limits
.MaxX
= iwt
->iwt_WinScreen
->LeftEdge
;
123 li
->linf_Limits
.MinY
= li
->linf_Limits
.MaxY
= iwt
->iwt_WinScreen
->TopEdge
;
124 li
->linf_Limits
.MaxX
+= iwt
->iwt_WinScreen
->Width
- 1;
125 li
->linf_Limits
.MaxY
+= iwt
->iwt_WinScreen
->Height
- 1;
127 Region1
= NewRegion();
130 DisposeRegion(Region2
);
134 myRect
= li
->linf_Limits
;
136 OrRectRegion(Region1
, &myRect
);
138 d1(kprintf("%s/%s/%ld: Region1: xmin=%ld ymin=%ld xmax=%ld ymax=%ld RegionRectangle=%08lx\n", \
139 __FILE__
, __FUNC__
, __LINE__
, Region1
->bounds
.MinX
, Region1
->bounds
.MinY
, Region1
->bounds
.MaxX
, \
140 Region1
->bounds
.MaxY
, Region1
->RegionRectangle
));
142 SCA_LockWindowList(SCA_LockWindowList_Shared
);
144 for (layer
= iwt
->iwt_WindowTask
.wt_Window
->WLayer
->LayerInfo
->top_layer
; layer
; layer
=layer
->back
)
146 struct Window
*win
= (struct Window
*) layer
->Window
;
147 struct ScaWindowStruct
*ws
;
149 d1(kprintf("%s/%s/%ld: layer=%08lx Window=%08lx\n", __FILE__
, __FUNC__
, __LINE__
, layer
, win
));
151 for (ws
=winlist
.wl_WindowStruct
; win
&& ws
; ws
= (struct ScaWindowStruct
*) ws
->ws_Node
.mln_Succ
)
153 d1(kprintf("%s/%s/%ld: ws=%08lx ws_Window=%08lx win=%08lx\n", __FILE__
, __FUNC__
, __LINE__
, ws
, ws
->ws_Window
, win
));
155 if (win
== ws
->ws_Window
)
158 struct internalScaWindowTask
*iwtx
= (struct internalScaWindowTask
*) ws
->ws_WindowTask
;
160 myRect
.MinX
= myRect
.MaxX
= win
->LeftEdge
+ iwtx
->iwt_InnerLeft
;
161 myRect
.MaxX
+= iwtx
->iwt_InnerWidth
- 1;
163 myRect
.MinY
= myRect
.MaxY
= win
->TopEdge
+ iwtx
->iwt_InnerTop
;
164 myRect
.MaxY
+= iwtx
->iwt_InnerHeight
- 1;
166 OrRectRegion(Region2
, &myRect
);
168 d1(kprintf("%s/%s/%ld: Region2: xmin=%ld ymin=%ld xmax=%ld ymax=%ld RegionRectangle=%08lx\n", \
169 __FILE__
, __FUNC__
, __LINE__
, Region2
->bounds
.MinX
, Region2
->bounds
.MinY
, Region2
->bounds
.MaxX
, \
170 Region2
->bounds
.MaxY
, Region2
->RegionRectangle
));
172 AndRegionRegion(Region1
, Region2
);
174 d1(kprintf("%s/%s/%ld: Region2: xmin=%ld ymin=%ld xmax=%ld ymax=%ld RegionRectangle=%08lx\n", \
175 __FILE__
, __FUNC__
, __LINE__
, Region2
->bounds
.MinX
, Region2
->bounds
.MinY
, Region2
->bounds
.MaxX
, \
176 Region2
->bounds
.MaxY
, Region2
->RegionRectangle
));
178 d1(kprintf("%s/%s/%ld: \n", __FILE__
, __FUNC__
, __LINE__
));
180 if (!TestRegionNotEmpty(Region2
))
183 ScalosLockIconListShared(iwtx
);
185 IconsInWindow
= FillLassoIconList(iwt
, iwtx
, &myRect
, Region2
, win
);
189 if (NULL
== LassoAddWindow(li
, iwtx
))
191 ScalosUnLockIconList(iwtx
);
196 ScalosUnLockIconList(iwtx
);
201 ClearRegion(Region2
);
202 ClearRectRegion(Region1
, &layer
->bounds
);
205 SCA_UnLockWindowList();
206 DisposeRegion(Region1
);
209 DisposeRegion(Region2
);
213 static void LassoCleanup(struct internalScaWindowTask
*iwt
)
216 struct LassoWindowNode
*lwn
;
217 struct LassoInfo
*li
= &iwt
->iwt_LassoInfo
;
219 d1(kprintf("%s/%s/%ld: START\n", __FILE__
, __FUNC__
, __LINE__
));
221 SelectedCount
= LassoCleanupIconList(iwt
);
223 while ((lwn
= (struct LassoWindowNode
*) RemTail((struct List
*) &li
->linf_WindowList
)))
225 ScalosUnLockIconList(lwn
->lwn_WindowTask
);
229 IconActive
= SelectedCount
!= 0;
233 static ULONG
LassoCleanupIconList(struct internalScaWindowTask
*iwt
)
235 ULONG SelectedCount
= 0;
236 struct LassoIconNode
*lin
;
237 struct LassoInfo
*li
= &iwt
->iwt_LassoInfo
;
239 d1(kprintf("%s/%s/%ld: START\n", __FILE__
, __FUNC__
, __LINE__
));
241 while ((lin
= (struct LassoIconNode
*) RemTail((struct List
*) &li
->linf_IconList
)))
243 struct ExtGadget
*gg
= (struct ExtGadget
*) lin
->lin_IconNode
->in_Icon
;
245 if (gg
->Flags
& GFLG_SELECTED
)
249 DisposeRegion(lin
->lin_Region
);
254 return SelectedCount
;
258 static void AdjustLassoIcons(struct internalScaWindowTask
*iwt
,
259 WORD StartX
, WORD StartY
, WORD StopX
, WORD StopY
)
261 struct LassoInfo
*li
= &iwt
->iwt_LassoInfo
;
262 struct LassoIconNode
*lin
;
264 struct Rectangle LassoRect
;
265 struct Region
*OverlapRegion
= NewRegion();
267 if (NULL
== OverlapRegion
)
283 LassoRect
.MinX
= StartX
;
284 LassoRect
.MaxX
= StopX
;
285 LassoRect
.MinY
= StartY
;
286 LassoRect
.MaxY
= StopY
;
288 d1(kprintf("%s/%s/%ld: Start x1=%ld y1=%ld x2=%ld y2=%ld\n", __FILE__
, __FUNC__
, __LINE__
, StartX
, StartY
, StopX
, StopY
));
290 ScaUnlockLayers(iwt
->iwt_WindowTask
.wt_Window
->WLayer
->LayerInfo
);
292 for (lin
= (struct LassoIconNode
*) li
->linf_IconList
.mlh_Head
;
293 lin
!= (struct LassoIconNode
*) &li
->linf_IconList
.mlh_Tail
;
294 lin
= (struct LassoIconNode
*) lin
->lin_Node
.ln_Succ
)
296 d1(kprintf("%s/%s/%ld:Icon=%08lx <%s> x1=%ld y1=%ld x2=%ld y2=%ld\n", \
297 __FILE__
, __FUNC__
, __LINE__
, lin
->lin_IconNode
, GetIconName(lin
->lin_IconNode
), \
298 lin
->lin_Rect
.MinX
, lin
->lin_Rect
.MinY
, \
299 lin
->lin_Rect
.MaxX
, lin
->lin_Rect
.MaxY
));
301 ClearRegion(OverlapRegion
);
302 OrRectRegion(OverlapRegion
, &LassoRect
);
303 AndRegionRegion(lin
->lin_Region
, OverlapRegion
);
305 if (TestRegionNotEmpty(OverlapRegion
))
307 // Icon is inside lasso area
308 d1(kprintf("%s/%s/%ld: Inside\n", __FILE__
, __FUNC__
, __LINE__
));
310 lin
->lin_Flags
|= LINFLGF_Selected
;
312 ClassSelectIcon(lin
->lin_WindowTask
->iwt_WindowTask
.mt_WindowStruct
, lin
->lin_IconNode
, TRUE
);
316 d1(kprintf("%s/%s/%ld: Outside\n", __FILE__
, __FUNC__
, __LINE__
));
318 // Icon is outside lasso area
319 if (lin
->lin_Flags
& LINFLGF_Selected
)
321 ClassSelectIcon(lin
->lin_WindowTask
->iwt_WindowTask
.mt_WindowStruct
, lin
->lin_IconNode
, FALSE
);
322 lin
->lin_Flags
&= ~LINFLGF_Selected
;
327 DisposeRegion(OverlapRegion
);
329 d1(kprintf("%s/%s/%ld: \n", __FILE__
, __FUNC__
, __LINE__
));
330 ScaLockLayers(iwt
->iwt_WindowTask
.wt_Window
->WLayer
->LayerInfo
);
335 void Lasso(WORD StartX
, WORD StartY
, ULONG Mode
, struct internalScaWindowTask
*iwt
)
337 struct RastPort
*rp
= &iwt
->iwt_WinScreen
->RastPort
;
338 struct LassoInfo
*li
= &iwt
->iwt_LassoInfo
;
345 EndX
= iwt
->iwt_WinScreen
->MouseX
;
346 EndY
= iwt
->iwt_WinScreen
->MouseY
;
348 d1(kprintf("%s/%s/%ld: Start x1=%ld y1=%ld x2=%ld y2=%ld Mode=%08lx\n", __FILE__
, __FUNC__
, __LINE__
, StartX
, StartY
, EndX
, EndY
, Mode
));
350 StartX
+= iwt
->iwt_WindowTask
.wt_Window
->LeftEdge
;
351 StartY
+= iwt
->iwt_WindowTask
.wt_Window
->TopEdge
;
353 // Limit lasso rectangle to iwt_LassoInfo.linf_Limits
354 if (EndX
< li
->linf_Limits
.MinX
)
356 DeltaX
= EndX
- li
->linf_Limits
.MinX
;
357 EndX
= li
->linf_Limits
.MinX
;
359 else if (EndX
> li
->linf_Limits
.MaxX
)
361 DeltaX
= EndX
- li
->linf_Limits
.MaxX
;
362 EndX
= li
->linf_Limits
.MaxX
;
363 d1(kprintf("%s/%s/%ld: EndX=%ld MaxX=%ld\n", __FILE__
, __FUNC__
, __LINE__
, EndX
, li
->linf_Limits
.MaxX
));
365 if (EndY
< li
->linf_Limits
.MinY
)
367 DeltaY
= EndY
- li
->linf_Limits
.MinY
;
368 EndY
= li
->linf_Limits
.MinY
;
370 else if (EndY
> li
->linf_Limits
.MaxY
)
372 DeltaY
= EndY
- li
->linf_Limits
.MaxY
;
373 EndY
= li
->linf_Limits
.MaxY
;
374 d1(kprintf("%s/%s/%ld: EndY=%ld MaxY=%ld\n", __FILE__
, __FUNC__
, __LINE__
, EndY
, li
->linf_Limits
.MaxY
));
378 SetDrMd(rp
, COMPLEMENT
);
380 if (LASSOX_RemoveLasso
!= (UWORD
) li
->linf_OldPos
.X
)
384 x
= li
->linf_OldPos
.X
;
385 y
= li
->linf_OldPos
.Y
;
387 d1(kprintf("%s/%s/%ld: Erase Old x1=%ld y1=%ld x2=%ld y2=%ld\n", __FILE__
, __FUNC__
, __LINE__
, x
, y
, StartX
, StartY
));
389 DrawRect(rp
, x
, y
, StartX
, StartY
);
391 d1(KPrintF("%s/%s/%ld: OldDrag.X=%ld OldDrag.Y=%ld\n", __FILE__
, __FUNC__
, __LINE__
, li
->linf_OldPos
.X
, li
->linf_OldPos
.Y
));
394 if (LASSOX_FollowLasso
== Mode
)
396 if ((0 != DeltaX
|| 0 != DeltaY
) && !iwt
->iwt_BackDrop
)
398 LassoScrollWindow(iwt
, DeltaX
, DeltaY
);
399 LassoUpdateIconList(iwt
);
402 SetDrMd(rp
, COMPLEMENT
);
405 AdjustLassoIcons(iwt
, StartX
, StartY
, EndX
, EndY
);
410 case LASSOX_RemoveLasso
:
411 d1(kprintf("%s/%s/%ld: Remove Lasso\n", __FILE__
, __FUNC__
, __LINE__
));
414 case LASSOX_CrawlLasso
:
415 d1(kprintf("%s/%s/%ld: Crawl Lasso\n", __FILE__
, __FUNC__
, __LINE__
));
419 ul
= rp
->LinePtrn
<< 16;
420 ul
>>= CurrentPrefs
.pref_DefLineSpeed
;
424 d1(KPrintF("%s/%s/%ld: OldDrag.X=%ld OldDrag.Y=%ld\n", __FILE__
, __FUNC__
, __LINE__
, li
->linf_OldPos
.X
, li
->linf_OldPos
.Y
));
426 /* intentionally no break here ! */
427 case LASSOX_FollowLasso
:
428 li
->linf_OldPos
.X
= x
= EndX
;
429 li
->linf_OldPos
.Y
= y
= EndY
;
431 d1(KPrintF("%s/%s/%ld: OldDrag.X=%ld OldDrag.Y=%ld\n", __FILE__
, __FUNC__
, __LINE__
, li
->linf_OldPos
.X
, li
->linf_OldPos
.Y
));
432 d1(kprintf("%s/%s/%ld: Draw New x1=%ld y1=%ld x2=%ld y2=%ld\n", __FILE__
, __FUNC__
, __LINE__
, x
, y
, StartX
, StartY
));
434 DrawRect(rp
, x
, y
, StartX
, StartY
);
440 // start lasso operation
441 void BeginLasso(struct internalScaWindowTask
*iwt
, UWORD Qualifier
)
443 struct LassoInfo
*li
= &iwt
->iwt_LassoInfo
;
445 d1(KPrintF("%s/%s/%ld: iwt=%08lx <%s>\n", __FILE__
, __FUNC__
, __LINE__
, iwt
, iwt
->iwt_WinTitle
));
447 iwt
->iwt_LassoFlag
= TRUE
;
449 LassoInit(iwt
, Qualifier
);
451 ScalosObtainSemaphore(&LayersSema
);
453 iwt
->iwt_LockFlag
= TRUE
;
454 iwt
->iwt_WindowTask
.mt_WindowStruct
->ws_Flags
|= WSV_FlagF_NeedsTimerMsg
;
456 d1(kprintf("%s/%s/%ld: \n", __FILE__
, __FUNC__
, __LINE__
));
457 ScaLockLayers(iwt
->iwt_WindowTask
.wt_Window
->WLayer
->LayerInfo
);
459 li
->linf_OldPos
.X
= LASSOX_RemoveLasso
;
461 iwt
->iwt_WinScreen
->RastPort
.LinePtrn
= CurrentPrefs
.pref_DefaultLinePattern
;
463 Lasso(iwt
->iwt_OldMouse
.X
, iwt
->iwt_OldMouse
.Y
, LASSOX_FollowLasso
, iwt
);
467 // end lasso operation
468 void EndLasso(struct internalScaWindowTask
*iwt
)
470 if (iwt
->iwt_LassoFlag
)
472 d1(KPrintF("%s/%s/%ld: iwt=%08lx <%s>\n", __FILE__
, __FUNC__
, __LINE__
, iwt
, iwt
->iwt_WinTitle
));
474 Lasso(iwt
->iwt_OldMouse
.X
, iwt
->iwt_OldMouse
.Y
, LASSOX_RemoveLasso
, iwt
);
478 iwt
->iwt_LassoFlag
= FALSE
;
480 iwt
->iwt_WinScreen
->RastPort
.LinePtrn
= 0xffff;
482 ScaUnlockLayers(iwt
->iwt_WindowTask
.wt_Window
->WLayer
->LayerInfo
);
484 iwt
->iwt_LockFlag
= FALSE
;
486 // do not turn off WSV_FlagF_NeedsTimerMsg for desktop window (required for screen title update
487 if (WSV_Type_DesktopWindow
!= iwt
->iwt_WindowTask
.mt_WindowStruct
->ws_WindowType
)
488 iwt
->iwt_WindowTask
.mt_WindowStruct
->ws_Flags
&= ~WSV_FlagF_NeedsTimerMsg
;
490 ScalosReleaseSemaphore(&LayersSema
);
495 static void DrawRect(struct RastPort
*rp
, WORD x1
, WORD y1
, WORD x2
, WORD y2
)
497 Move(rp
, x1
, y1
); // Left-Top
498 Draw(rp
, x2
, y1
); // Right-Top
499 Draw(rp
, x2
, y2
); // Right-Bottom
500 Draw(rp
, x1
, y2
); // Left-Bottom
501 Draw(rp
, x1
, y1
); // Left-Top
505 static void LassoScrollWindow(struct internalScaWindowTask
*iwt
, LONG DeltaX
, LONG DeltaY
)
507 UWORD DeltaMoveFlags
= 0;
509 ScaUnlockLayers(iwt
->iwt_WindowTask
.wt_Window
->WLayer
->LayerInfo
);
512 DeltaMoveFlags
|= SETVIRTF_AdjustRightSlider
;
514 DeltaMoveFlags
|= SETVIRTF_AdjustBottomSlider
;
516 DoMethod(iwt
->iwt_WindowTask
.mt_MainObject
,
517 SCCM_IconWin_DeltaMove
, DeltaX
, DeltaY
);
518 DoMethod(iwt
->iwt_WindowTask
.mt_MainObject
,
519 SCCM_IconWin_SetVirtSize
, DeltaMoveFlags
);
521 ScaLockLayers(iwt
->iwt_WindowTask
.wt_Window
->WLayer
->LayerInfo
);
525 static ULONG
FillLassoIconList(struct internalScaWindowTask
*iwt
,
526 struct internalScaWindowTask
*iwtIcon
, struct Rectangle
*myRect
,
527 struct Region
*Region2
, struct Window
*win
)
529 struct LassoInfo
*li
= &iwt
->iwt_LassoInfo
;
530 struct Region
*Region3
;
531 ULONG IconsInWindow
= 0;
533 Region3
= NewRegion();
535 d1(kprintf("%s/%s/%ld: xmin=%ld ymin=%ld xmax=%ld ymax=%ld\n", \
536 __FILE__
, __FUNC__
, __LINE__
, myRect
->MinX
, myRect
->MinY
, myRect
->MaxX
, myRect
->MaxY
));
540 struct ScaIconNode
*in
;
542 for (in
= iwtIcon
->iwt_WindowTask
.wt_IconList
; in
; in
= (struct ScaIconNode
*) in
->in_Node
.mln_Succ
)
544 struct Rectangle IconRect
;
545 struct ExtGadget
*gg
= (struct ExtGadget
*) in
->in_Icon
;
547 d1(KPrintF("%s/%s/%ld: in=%08lx <%s>\n", \
548 __FILE__
, __FUNC__
, __LINE__
, in
, GetIconName(in
)));
549 d1(KPrintF("%s/%s/%ld: Left=%ld BoundsLeft=%ld Width=%ld BoundsWidth=%ld\n", \
550 __FILE__
, __FUNC__
, __LINE__
, gg
->LeftEdge
, gg
->BoundsLeftEdge
, gg
->Width
, gg
->BoundsWidth
));
552 IconRect
.MinX
= IconRect
.MaxX
= win
->LeftEdge
+ gg
->LeftEdge
- iwtIcon
->iwt_WindowTask
.wt_XOffset
+ iwtIcon
->iwt_InnerLeft
;
553 IconRect
.MinY
= IconRect
.MaxY
= win
->TopEdge
+ gg
->TopEdge
- iwtIcon
->iwt_WindowTask
.wt_YOffset
+ iwtIcon
->iwt_InnerTop
;
554 IconRect
.MaxX
+= gg
->Width
- 1;
555 IconRect
.MaxY
+= gg
->Height
- 1;
557 d1(kprintf("%s/%s/%ld: xmin=%ld ymin=%ld xmax=%ld ymax=%ld\n", \
558 __FILE__
, __FUNC__
, __LINE__
, IconRect
.MinX
, IconRect
.MinY
, IconRect
.MaxX
, IconRect
.MaxY
));
560 if (IconRect
.MinX
< myRect
->MaxX
&& IconRect
.MinY
< myRect
->MaxY
&&
561 IconRect
.MaxX
>= myRect
->MinX
&&
562 IconRect
.MaxY
>= myRect
->MinY
)
564 OrRectRegion(Region3
, &IconRect
);
565 AndRegionRegion(Region2
, Region3
);
567 if (TestRegionNotEmpty(Region3
))
569 struct LassoIconNode
*lin
;
571 d1(kprintf("%s/%s/%ld: in=%08lx <%s>\n", \
572 __FILE__
, __FUNC__
, __LINE__
, in
, GetIconName(in
)));
574 lin
= (struct LassoIconNode
*) ScalosAlloc(sizeof(struct LassoIconNode
));
580 lin
->lin_WindowTask
= iwtIcon
;
581 lin
->lin_IconNode
= in
;
583 lin
->lin_Region
= NewRegion();
586 OrRegionRegion(Region3
, lin
->lin_Region
);
588 AddTail((struct List
*) &li
->linf_IconList
,
591 d1(kprintf("%s/%s/%ld: xmin=%ld ymin=%ld xmax=%ld ymax=%ld\n", \
592 __FILE__
, __FUNC__
, __LINE__
, lin
->lin_Rect
.MinX
, lin
->lin_Rect
.MinY
, lin
->lin_Rect
.MaxX
, lin
->lin_Rect
.MaxY
));
597 ClearRegion(Region3
);
599 DisposeRegion(Region3
);
602 return IconsInWindow
;
606 // Update the list of visible icons -- required after scrolling the window
607 static void LassoUpdateIconList(struct internalScaWindowTask
*iwt
)
609 struct LassoInfo
*li
= &iwt
->iwt_LassoInfo
;
610 struct Region
*Region2
;
612 (void) LassoCleanupIconList(iwt
);
614 Region2
= NewRegion();
618 OrRectRegion(Region2
, &li
->linf_Limits
);
620 ScalosLockIconListShared(iwt
);
621 FillLassoIconList(iwt
, iwt
, &li
->linf_Limits
, Region2
,
622 iwt
->iwt_WindowTask
.wt_Window
);
623 ScalosUnLockIconList(iwt
);
625 DisposeRegion(Region2
);
630 static struct LassoWindowNode
*LassoAddWindow(struct LassoInfo
*li
, struct internalScaWindowTask
*iwt
)
632 struct LassoWindowNode
*lwn
;
634 lwn
= (struct LassoWindowNode
*) ScalosAlloc(sizeof(struct LassoWindowNode
));
637 lwn
->lwn_WindowTask
= iwt
;
639 AddTail((struct List
*) &li
->linf_WindowList
,