Fixed binary search: no more infinite loops when vendor is unknown.
[tangerine.git] / workbench / system / Wanderer / Classes / iconlist.h
blob9884c62ab2f4eb0b0d1c5cff70d74c9094364c80
1 #ifndef _MUI_CLASSES_ICONLIST_H
2 #define _MUI_CLASSES_ICONLIST_H
4 /*
5 Copyright 2002-2007, The AROS Development Team. All rights reserved.
6 $Id$
7 */
9 #include <string.h>
10 #include <stdlib.h>
11 #include <stdio.h>
12 #include <time.h>
13 #include <math.h>
14 #include <stdarg.h>
15 #include <exec/types.h>
16 #include <exec/memory.h>
17 #include <dos/dos.h>
18 #include <intuition/intuitionbase.h>
19 #include <intuition/classusr.h>
20 #include <clib/alib_protos.h>
21 #include <utility/utility.h>
22 #include <dos/dosextens.h>
23 #include <libraries/mui.h>
24 #include <clib/alib_protos.h>
25 #include <proto/exec.h>
26 #include <proto/dos.h>
27 #include <proto/muimaster.h>
28 #include <proto/intuition.h>
30 #include "iconlist_attributes.h"
32 /****************************************************************************/
33 /*** Name *******************************************************************/
34 #define MUIC_IconList "IconList.mui"
36 /*** Methods ****************************************************************/
37 #define MUIM_IconList_Clear (MUIB_IconList | 0x00000000)
38 #define MUIM_IconList_Update (MUIB_IconList | 0x00000001)
39 #define MUIM_IconList_RethinkDimensions (MUIB_IconList | 0x00000002)
40 #define MUIM_IconList_CreateEntry (MUIB_IconList | 0x00000010) /* returns 0 For Failure or (struct IconEntry *) */
41 #define MUIM_IconList_UpdateEntry (MUIB_IconList | 0x00000011) /* returns 0 For Failure or (struct IconEntry *) */
42 #define MUIM_IconList_DestroyEntry (MUIB_IconList | 0x00000012)
43 #define MUIM_IconList_DrawEntry (MUIB_IconList | 0x00000020)
44 #define MUIM_IconList_DrawEntryLabel (MUIB_IconList | 0x00000021)
45 #define MUIM_IconList_MakeIconVisible (MUIB_IconList | 0x00000024)
46 #define MUIM_IconList_SelectAll (MUIB_IconList | 0x00000030)
47 #define MUIM_IconList_UnselectAll (MUIB_IconList | 0x00000031)
48 #define MUIM_IconList_NextIcon (MUIB_IconList | 0x00000034)
49 #define MUIM_IconList_Sort (MUIB_IconList | 0x00000040)
50 #define MUIM_IconList_CoordsSort (MUIB_IconList | 0x00000041)
51 #define MUIM_IconList_PositionIcons (MUIB_IconList | 0x00000042)
52 #define MUIM_IconList_GetIconPrivate (MUIB_IconList | 0x000000FF)
54 struct MUIP_IconList_Clear {STACKED ULONG MethodID;};
55 struct MUIP_IconList_Update {STACKED ULONG MethodID;};
56 struct MUIP_IconList_RethinkDimensions {STACKED ULONG MethodID; STACKED struct IconEntry *singleicon;};
57 struct MUIP_IconList_CreateEntry {STACKED ULONG MethodID; STACKED STRPTR filename; STACKED STRPTR label; STACKED struct FileInfoBlock *fib; STACKED struct DiskObject *icon_dob; STACKED ULONG type;};
58 struct MUIP_IconList_UpdateEntry {STACKED ULONG MethodID; STACKED struct IconEntry *icon; STACKED STRPTR filename; STACKED STRPTR label; STACKED struct FileInfoBlock *fib; STACKED struct DiskObject *icon_dob; STACKED ULONG type;};
59 struct MUIP_IconList_DestroyEntry {STACKED ULONG MethodID; STACKED struct IconEntry *icon;};
60 struct MUIP_IconList_DrawEntry {STACKED ULONG MethodID; STACKED struct IconEntry *icon; STACKED IPTR drawmode;};
61 struct MUIP_IconList_DrawEntryLabel {STACKED ULONG MethodID; STACKED struct IconEntry *icon; STACKED IPTR drawmode;};
62 struct MUIP_IconList_NextIcon {STACKED ULONG MethodID; STACKED IPTR nextflag; STACKED struct IconList_Entry **entry;};
63 struct MUIP_IconList_Sort {STACKED ULONG MethodID;};
64 struct MUIP_IconList_PositionIcons {STACKED ULONG MethodID;};
65 struct MUIP_IconList_MakeIconVisible {STACKED ULONG MethodID; STACKED struct IconEntry *icon;};
66 struct MUIP_IconList_GetIconPrivate {STACKED ULONG MethodID; STACKED struct IconList_Entry *entry;}; /* *entry must be a valid Icon */
68 /* used by MUIM_IconList_NextIcon */
69 struct IconList_Entry
71 struct IconEntry *ile_IconEntry;
72 char *label; /* The label which is displayed (often FilePart(filename)) */
73 LONG type;
74 LONG flags; /* If type == ST_ROOT, these flags will set volume attributes */
75 void *udata;
78 struct IconList_Click
80 int shift; /* TRUE for shift click */
81 struct IconList_Entry *entry; /* might be NULL */
84 struct IconList_Drop_SourceEntry
86 struct Node dropse_Node;
89 struct IconList_Drop_Event
91 struct List drop_SourceList; /* iconlist obj */
92 Object *drop_TargetObj; /* iconlist obj */
93 STRPTR drop_TargetPath; /* destination path */
96 struct IconEntry
98 struct Node ie_IconNode;
99 struct Node ie_SelectionNode;
101 struct IconList_Entry ie_IconListEntry;
103 struct DiskObject *ie_DiskObj; /* The icons disk objects */
104 struct FileInfoBlock *ie_FileInfoBlock;
106 LONG ie_IconX, /* Top Left Co-ords of Icons "AREA" */
107 ie_IconY;
109 ULONG ie_IconWidth, /* Width/Height of Icon "Image" */
110 ie_IconHeight,
111 ie_AreaWidth, /* Width/Height of Icon "AREA" .. */
112 ie_AreaHeight; /* if the icons Label Width is larger than
113 ie_IconWidth, AreaWidth = the icons label Width
114 else it will be the same as ie_IconWidth */
116 ULONG ie_Flags;
118 UBYTE *ie_TxtBuf_DisplayedLabel;
119 ULONG ie_SplitParts;
120 ULONG ie_TxtBuf_DisplayedLabelWidth;
121 UBYTE *ie_TxtBuf_DATE;
122 ULONG ie_TxtBuf_DATEWidth;
123 UBYTE *ie_TxtBuf_TIME;
124 ULONG ie_TxtBuf_TIMEWidth;
125 UBYTE *ie_TxtBuf_SIZE;
126 ULONG ie_TxtBuf_SIZEWidth;
127 UBYTE *ie_TxtBuf_PROT;
130 /****************************************************************************/
131 /*** Name *******************************************************************/
132 #define MUIC_IconDrawerList "IconDrawerList.mui"
134 /****************************************************************************/
135 /*** Name *******************************************************************/
136 #define MUIC_IconVolumeList "IconVolumeList.mui"
138 struct VolumeIcon_Private
140 ULONG vip_FLags;
143 extern const struct __MUIBuiltinClass _MUI_IconList_desc; /* PRIV */
144 extern const struct __MUIBuiltinClass _MUI_IconDrawerList_desc; /* PRIV */
145 extern const struct __MUIBuiltinClass _MUI_IconVolumeList_desc; /* PRIV */
147 #ifdef __AROS__
148 #define IconListObject MUIOBJMACRO_START(MUIC_IconList)
149 #define IconVolumeListObject MUIOBJMACRO_START(MUIC_IconVolumeList)
150 #define IconDrawerListObject MUIOBJMACRO_START(MUIC_IconDrawerList)
151 #else
152 #define IconDrawerListObject NewObject(IconDrawerList_Class->mcc_Class, NULL
153 #define IconVolumeListObject NewObject(IconVolumeList_Class->mcc_Class, NULL
154 #define IconListObject NewObject(IconList_Class->mcc_Class, NULL
155 #endif
157 #endif /* _MUI_CLASSES_ICONLIST_H */