nouveau.hidd: disable warnings about not initialized variables
[AROS.git] / workbench / classes / gadgets / aroslistview / aroslistview_intern.h
blob66bea61cf30eadf8260ff41f42ff6dc6a4158acb
1 /*
2 Copyright © 1995-2005, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #ifndef AROSLISTVIEW_INTERN_H
7 #define AROSLISTVIEW_INTERN_H
11 #ifndef EXEC_TYPES_H
12 # include <exec/types.h>
13 #endif
14 #ifndef EXEC_LIBRARIES_H
15 # include <exec/libraries.h>
16 #endif
17 #ifndef UTILITY_HOOKS_H
18 # include <utility/hooks.h>
19 #endif
20 #ifndef DOS_BPTR_H
21 # include <dos/bptr.h>
22 #endif
23 #ifndef GRAPHICS_RASTPORT_H
24 # include <graphics/rastport.h>
25 #endif
26 #ifndef INTUITION_CLASSES_H
27 # include <intuition/classes.h>
28 #endif
29 #ifndef INTUITION_CGHOOKS_H
30 # include <intuition/cghooks.h>
31 #endif
32 #ifndef INTUITION_GADGETCLASS_H
33 # include <intuition/gadgetclass.h>
34 #endif
36 #define TURN_OFF_DEBUG
38 struct LVData
40 struct Hook *lvd_DisplayHook;
41 struct Hook *lvd_RenderHook;
42 Object *lvd_List;
43 STRPTR *lvd_DHArray;
44 struct ColumnAttrs *lvd_ColAttrs;
45 struct TextFont *lvd_Font;
46 LONG lvd_First; /* The nuber of the first item showed in list */
47 UWORD lvd_EntryHeight;
49 /* Damage area */
51 UWORD lvd_DamageOffset;
52 UWORD lvd_NumDamaged;
54 UBYTE lvd_HorSpacing;
55 UBYTE lvd_VertSpacing;
56 UBYTE lvd_Flags;
58 /* Number of columns that the displayhook returns items for */
59 UBYTE lvd_MaxColumns;
60 /* Number of colomns to view. Depends on AROSA_List_Format */
61 UBYTE lvd_ViewedColumns;
63 UBYTE lvd_BackPen;
64 UBYTE lvd_FrontPen;
66 /* To prevent 'echo' OM_UPDATEs (double redraws) */
67 UBYTE lvd_NotifyCount;
69 /* For testting for doubleclicks */
70 ULONG lvd_StartSecs;
71 ULONG lvd_StartMicros;
77 /* The minwitdh of one or more colums is as large as the biggest entry */
78 #define LVFLG_SPECIALCOLWIDTH (1 << 0)
80 #define LVFLG_READONLY (1 << 1)
81 #define LVFLG_MULTISELECT (1 << 2)
82 #define LVFLG_DOUBLECLICK (1 << 3)
84 /* Macros */
85 #undef LVD
86 #define LVD(x) ((struct LVData *)x)
88 #undef UB
89 #define UB(x) ((UBYTE *)x)
91 #undef EG
92 #define EG(o) ((struct ExtGadget *)o)
94 #undef MIN
95 #define MIN(a,b) ((a < b) ? a : b)
97 #define ReCalcEntryHeight(data) \
98 data->lvd_EntryHeight = data->lvd_Font->tf_YSize \
99 + data->lvd_VertSpacing;
101 #undef NumVisible
102 #define NumVisible(ibox, eh) \
103 (((ibox)->Height - LV_BORDERWIDTH_Y * 2) / eh)
108 /* Constants */
109 #define LV_BORDERWIDTH_X 2
110 #define LV_BORDERWIDTH_Y 2
112 #define LV_DEFAULTHORSPACING 2
113 #define LV_DEFAULTVERTSPACING 1
115 struct ColumnAttrs
117 UBYTE ca_Pen; /* Background pen for the entry */
118 UBYTE ca_Flags;
120 UWORD ca_Delta;
121 WORD ca_MinWidth; /* A value of -1 makes minwidth as small as the largest text */
123 /* computed before each render */
125 UWORD ca_Left;
126 UWORD ca_Right;
127 UWORD ca_Width;
129 /* Index into the array filled by displayhook for getting text for this column */
130 UBYTE ca_DHIndex;
134 #define CA_ALIGN_MASK (3)
136 #define CA_ALIGN_LEFT 0
137 #define CA_ALIGN_RIGHT 1
138 #define CA_ALIGN_CENTRE 2
140 #define CAFLG_BAR (1 << 3)
141 #define CAFLG_SPECIALCOLWIDTH (1 << 4)
144 /* Prototypes */
145 BOOL ParseFormatString(STRPTR, struct LVData *);
147 VOID RenderEntries(Class *, Object *, struct gpRender *, LONG, UWORD, BOOL);
149 VOID GetGadgetIBox(Object *, struct GadgetInfo *, struct IBox *);
150 VOID DrawListBorder(struct RastPort *, UWORD *, struct IBox *, BOOL);
151 VOID ComputeColumnWidths(UWORD, struct LVData *);
152 VOID ComputeColLeftRight(UWORD, struct LVData *);
153 UWORD ShownEntries(struct LVData *, struct IBox *);
154 VOID NotifyAttrs(Class *, Object *, struct opSet *, struct TagItem *);
156 #endif /* AROSLISTVIEW_INTERN_H */