4 // PopupMenu Library - Shadows
6 // Copyright (C)2000 Henrik Isaksson <henrik@boing.nu>
7 // All Rights Reserved.
21 #define MAX(a,b) (a>b?a:b)
24 #define MIN(a,b) (a<b?a:b)
27 #define SHADOWFLAG_LEFT (1L << 0)
28 #define SHADOWFLAG_BOTTOM (1L << 1)
29 #define SHADOWFLAG_TOP (1L << 2)
30 #define SHADOWFLAG_RIGHT (1L << 3)
41 typedef struct PMShadowRect PMSR
;
42 typedef struct MinList PMSRList
;
44 #define PM_InitShadowList (PMSRList *)PM_InitList
45 #define PM_FreeShadowList(l) PM_FreeList((PMDList *)l)
46 #define PM_CopyShadowList(l) (PMSRList *)PM_CopyList((PMDList *)l)
47 #define PM_AddShadowToList(l, A) PM_AddToList((PMDList *)l, (PMNode *)A)
48 #define PM_UnlinkShadow(l, A) PM_Unlink((PMDList *)l, (PMNode *)A)
49 #define PM_FreeShadowNode(A) PM_FreeNode((PMNode *)A)
50 //#define PM_CopyShadowNode(A) (PMSR *)PM_CopyNode((PMNode *)A)
52 void PM_AddShadowToList(PMSRList *l, PMSR *A); // Add A to l. *
53 void PM_UnlinkShadow(PMSRList *l, PMSR *A); // Remove A from l. *
54 void PM_FreeShadowNode(PMSR *A); // Free a shadow node. *
56 PMSR
*PM_CopyShadowNode(PMSR
*A
); // Copy a shadow node. *
59 //PMSRList *PM_InitShadowList(void); // Create a new list header *
60 //void PM_FreeShadowList(PMSRList *list); // Free a list of shadow rects *
61 //PMSRList *PM_CopyShadowList(PMSRList *list); // Copy a list of shadow rects *
63 BOOL
PM_AddShadow(PMSRList
*sigma
, // Add shadows in delta to
64 PMSRList
*delta
); // sigma, and modify shadows
65 // in delta so they will not
66 // overlap shadows in sigma. *
68 BOOL
PM_SubMenuRect(PMSRList
*sigma
, // Subract a rectangle from
69 WORD l
, WORD t
, WORD w
, WORD h
); // list. *
76 BOOL
PM_ShadowOverlap(PMSR
*A
, PMSR
*B
); // Does A touch B anywhere? *