4 // PopupMenu Library - Shadows
6 // Copyright (C)2000 Henrik Isaksson <henrik@boing.nu>
7 // All Rights Reserved.
17 #define MAX(a,b) (a>b?a:b)
18 #define MIN(a,b) (a<b?a:b)
28 typedef struct PMShadowRect PMSR
;
29 typedef struct MinList PMSRList
;
31 #define PM_InitShadowList (PMSRList *)PM_InitList
32 #define PM_FreeShadowList(l) PM_FreeList((PMDList *)l)
33 #define PM_CopyShadowList(l) (PMSRList *)PM_CopyList((PMDList *)l)
34 #define PM_AddShadowToList(l, A) PM_AddToList((PMDList *)l, (PMNode *)A)
35 #define PM_UnlinkShadow(l, A) PM_Unlink((PMDList *)l, (PMNode *)A)
36 #define PM_FreeShadowNode(A) PM_FreeNode((PMNode *)A)
37 //#define PM_CopyShadowNode(A) (PMSR *)PM_CopyNode((PMNode *)A)
39 void PM_AddShadowToList(PMSRList *l, PMSR *A); // Add A to l. *
40 void PM_UnlinkShadow(PMSRList *l, PMSR *A); // Remove A from l. *
41 void PM_FreeShadowNode(PMSR *A); // Free a shadow node. *
43 PMSR
*PM_CopyShadowNode(PMSR
*A
); // Copy a shadow node. *
46 //PMSRList *PM_InitShadowList(void); // Create a new list header *
47 //void PM_FreeShadowList(PMSRList *list); // Free a list of shadow rects *
48 //PMSRList *PM_CopyShadowList(PMSRList *list); // Copy a list of shadow rects *
50 BOOL
PM_AddRect(PMSRList
*list
, // Add a rectangle to a
51 WORD l
, WORD t
, WORD r
, WORD b
); // list of shadows. *
53 BOOL
PM_AddShadow(PMSRList
*sigma
, // Add shadows in delta to
54 PMSRList
*delta
); // sigma, and modify shadows
55 // in delta so they will not
56 // overlap shadows in sigma. *
58 BOOL
PM_SubMenuRect(PMSRList
*sigma
, // Subract a rectangle from
59 WORD l
, WORD t
, WORD w
, WORD h
); // list. *
66 BOOL
PM_ShadowOverlap(PMSR
*A
, PMSR
*B
); // Does A touch B anywhere? *
67 BOOL
PM_SubRects(PMSRList
*dest
, // Remove parts of worknode
68 PMSR
*worknode
, PMSR
*rect
); // that are overlapped by rect. *