2 Copyright © 1995-2011, The AROS Development Team. All rights reserved.
15 # include <exec/types.h>
18 #ifndef EXEC_LIBRARIES_H
19 # include <exec/libraries.h>
22 #ifndef INTUITION_INTUITIONBASE_H
23 # include <intuition/intuitionbase.h>
26 #ifndef INTUITION_CLASSES_H
27 # include <intuition/classes.h>
30 #ifndef INTUITION_SGHOOKS_H
31 # include <intuition/sghooks.h>
34 #ifndef LIBRARIES_ASL_H
35 # include <libraries/asl.h>
38 #ifndef LIBRARIES_LOCALE_H
39 # include <libraries/locale.h>
42 #ifndef UTILITY_HOOKS_H
43 # include <utility/hooks.h>
52 #ifndef AROS_ASMCALL_H
53 # include <aros/asmcall.h>
55 #include <aros/libcall.h>
57 /*****************************************************************************************/
60 #define USE_SHARED_COOLIMAGES 0
62 #define USE_SHARED_COOLIMAGES 1
65 #define AVOID_FLICKER 1
67 /*****************************************************************************************/
69 // #define TURN_OFF_DEBUG
72 struct AslBase_intern
;
75 /* Internal requester structure */
79 struct Window
*ir_Window
;
80 struct Screen
*ir_Screen
;
81 STRPTR ir_PubScreenName
;
82 struct Hook
*ir_IntuiMsgFunc
;
83 struct TextAttr
*ir_TextAttr
;
84 struct Locale
*ir_Locale
;
85 struct Catalog
*ir_Catalog
;
87 ULONG ir_MemPoolPuddle
; /* if 0, no pool is created */
88 ULONG ir_MemPoolThresh
;
91 STRPTR ir_PositiveText
;
92 STRPTR ir_NegativeText
;
99 APTR ir_BasePtr
; /* Compatability: Saved copy of REG_A4 */
102 /* Nodes in the ReqList */
105 struct MinNode rn_Node
;
107 struct IntReq
*rn_IntReq
;
108 struct Window
*rn_ReqWindow
;
111 /*****************************************************************************************/
113 /* Internal filerequester struct */
117 struct IntReq ifr_IntReq
;
122 STRPTR ifr_AcceptPattern
;
123 STRPTR ifr_RejectPattern
;
126 struct Hook
*ifr_FilterFunc
;
131 ULONG (*ifr_HookFunc
)(ULONG mask
, APTR object
, struct FileRequester
*fr
);
133 /* ASLFR_HookFunc = Combined callback function */
135 ULONG
*ifr_GetSortBy
;
136 ULONG
*ifr_GetSortOrder
;
137 ULONG
*ifr_GetSortDrawers
;
140 UWORD ifr_SortDrawers
;
141 BOOL ifr_InitialShowVolumes
;
144 /*****************************************************************************************/
148 struct IntReq ifo_IntReq
;
149 struct TextAttr ifo_TextAttr
;
157 struct Hook
*ifo_FilterFunc
;
162 ULONG (*ifo_HookFunc
)(ULONG
, APTR
, struct FontRequester
*);
165 UWORD ifo_MaxFrontPen
;
166 UWORD ifo_MaxBackPen
;
168 STRPTR
*ifo_ModeList
;
169 STRPTR ifo_SampleText
;
170 UBYTE
*ifo_FrontPens
;
173 STRPTR ifo_DrawModeJAM1Text
;
174 STRPTR ifo_DrawModeJAM2Text
;
175 STRPTR ifo_DrawModeCOMPText
;
176 STRPTR ifo_DrawMode0Text
;
179 /*****************************************************************************************/
181 #define ISMF_DOAUTOSCROLL 1
182 #define ISMF_DODEPTH 2
183 #define ISMF_DOHEIGHT 4
184 #define ISMF_DOWIDTH 8
185 #define ISMF_DOOVERSCAN 16
187 /*****************************************************************************************/
191 struct IntReq ism_IntReq
;
192 struct List
*ism_CustomSMList
;
193 struct Hook
*ism_FilterFunc
;
196 ULONG ism_DisplayWidth
;
197 ULONG ism_DisplayHeight
;
198 ULONG ism_BitMapWidth
;
199 ULONG ism_BitMapHeight
;
200 UWORD ism_DisplayDepth
;
201 UWORD ism_OverscanType
;
203 ULONG ism_PropertyFlags
;
204 ULONG ism_PropertyMask
;
211 LONG ism_InfoLeftEdge
;
212 LONG ism_InfoTopEdge
;
215 STRPTR ism_Overscan1Text
;
216 STRPTR ism_Overscan2Text
;
217 STRPTR ism_Overscan3Text
;
218 STRPTR ism_Overscan4Text
;
219 STRPTR ism_OverscanNullText
;
220 STRPTR ism_AutoScrollOFFText
;
221 STRPTR ism_AutoScrollONText
;
222 STRPTR ism_AutoScroll0Text
;
224 STRPTR ism_PropertyList_Title
;
225 STRPTR ism_PropertyList_NotWB
;
226 STRPTR ism_PropertyList_NotGenlock
;
227 STRPTR ism_PropertyList_NotDraggable
;
228 STRPTR ism_PropertyList_HAM
;
229 STRPTR ism_PropertyList_EHB
;
230 STRPTR ism_PropertyList_Interlace
;
231 STRPTR ism_PropertyList_ECS
;
232 STRPTR ism_PropertyList_WB
;
233 STRPTR ism_PropertyList_Genlock
;
234 STRPTR ism_PropertyList_Draggable
;
235 STRPTR ism_PropertyList_DPFPri2
;
236 STRPTR ism_PropertyList_RefreshRate
;
239 #define SREQ_FIRST_PROPERTY_ITEM(x) ((x)->ism_PropertyList_NotWB)
240 #define SREQ_LAST_PROPERTY_ITEM(x) ((x)->ism_PropertyList_RefreshRate)
242 /*****************************************************************************************/
244 /* structure for passing arguments to tag parsing hooks */
247 struct IntReq
*pta_IntReq
;
249 struct TagItem
*pta_Tags
;
257 /* Size of userdata for GadgetryHook and EventHook */
259 struct Hook ParseTagsHook
;
260 struct Hook GadgetryHook
;
263 /*****************************************************************************************/
267 #define IF_PRIVATEIDCMP (1 << 0)
268 #define IF_SLEEPWINDOW (1 << 1)
269 #define IF_USER_POSTEXT (1 << 2)
270 #define IF_USER_NEGTEXT (1 << 3)
271 #define IF_POPTOFRONT (1 << 4)
272 #define IF_POPPEDTOFRONT (1 << 5)
273 #define IF_OPENINACTIVE (1 << 6)
275 #define GetIR(ir) ((struct IntReq *)ir)
277 struct AslBase_intern
280 struct MinList ReqList
;
281 struct SignalSemaphore ReqListSem
;
282 struct AslReqInfo ReqInfo
[3];
284 Class
*aslarrowclass
;
285 Class
*asllistviewclass
;
286 Class
*aslbuttonclass
;
287 Class
*aslstringclass
;
288 Class
*aslcycleclass
;
289 Class
*aslfontpreviewclass
;
290 Class
*aslfontstyleclass
;
291 Class
*aslcolorpickerclass
;
292 Class
*asleraserclass
;
295 /*****************************************************************************************/
301 struct ReqNode
*FindReqNode(APTR
, struct AslBase_intern
*);
302 VOID
ParseCommonTags(struct IntReq
*, struct TagItem
*, struct AslBase_intern
*);
303 UWORD
BiggestTextLength(STRPTR
*, UWORD
, struct RastPort
*, struct AslBase_intern
*);
304 VOID
StripRequester(APTR
, UWORD
, struct AslBase_intern
*AslBase
);
306 WORD
CountNodes(struct List
*list
, WORD flag
);
307 struct Node
*FindListNode(struct List
*list
, WORD which
);
308 void SortInNode(APTR req
, struct List
*list
, struct Node
*node
,
309 WORD (*compare
)(APTR
, APTR
, APTR
, struct AslBase_intern
*),
310 struct AslBase_intern
*AslBase
);
312 APTR
MyAllocVecPooled(APTR pool
, IPTR size
, struct AslBase_intern
*AslBase
);
313 void MyFreeVecPooled(APTR mem
, struct AslBase_intern
*AslBase
);
314 char *PooledCloneString(const char *name1
, const char *name2
, APTR pool
,
315 struct AslBase_intern
*AslBase
);
316 char *PooledCloneStringLen(const char *name1
, ULONG len1
, const char *name2
, ULONG len2
, APTR pool
,
317 struct AslBase_intern
*AslBase
);
318 char *VecCloneString(const char *name1
, const char *name2
, struct AslBase_intern
*AslBase
);
319 char *VecPooledCloneString(const char *name1
, const char *name2
, APTR pool
,
320 struct AslBase_intern
*AslBase
);
321 char *PooledUIntegerToString(IPTR value
, APTR pool
, struct AslBase_intern
*AslBase
);
322 void CloseWindowSafely(struct Window
*window
, struct AslBase_intern
*AslBase
);
324 AROS_UFP3(ULONG
, StringEditFunc
,
325 AROS_UFPA(struct Hook
*, hook
, A0
),
326 AROS_UFPA(struct SGWork
*, sgw
, A2
),
327 AROS_UFPA(ULONG
*, command
, A1
));
329 void PaintInnerFrame(struct RastPort
*rp
, struct DrawInfo
*dri
, Object
*frameobj
,
330 struct IBox
*framebox
, struct IBox
*innerbox
, ULONG pen
,
331 struct AslBase_intern
*AslBase
);
332 void PaintBoxFrame(struct RastPort
*rp
, struct IBox
*outerbox
, struct IBox
*innerbox
,
333 ULONG pen
, struct AslBase_intern
*AslBase
);
337 BOOL
makescrollergadget(struct ScrollerGadget
*scrollergad
, struct LayoutData
*ld
,
338 struct TagItem
*tags
, struct AslBase_intern
*AslBase
);
339 void killscrollergadget(struct ScrollerGadget
*scrollergad
, struct AslBase_intern
*AslBase
);
340 void getgadgetcoords(struct Gadget
*gad
, struct GadgetInfo
*gi
, WORD
*x
, WORD
*y
, WORD
*w
, WORD
*h
);
341 void getgadgetbounds(struct Gadget
*gad
, struct GadgetInfo
*gi
, WORD
*x
, WORD
*y
, WORD
*w
, WORD
*h
);
343 void connectscrollerandlistview(struct ScrollerGadget
*scrollergad
, Object
*listview
,
344 struct AslBase_intern
*AslBase
);
345 void FreeObjects(Object
**first
, Object
**last
, struct AslBase_intern
*AslBase
);
349 STRPTR
GetString(LONG id
, struct Catalog
*catalog
, struct AslBase_intern
*AslBase
);
350 void LocalizeMenus(struct NewMenu
*nm
, struct Catalog
*catalog
, struct AslBase_intern
*AslBase
);
352 /*****************************************************************************************/
355 AROS_UFP3(VOID
, FRTagHook
,
356 AROS_UFPA(struct Hook
*, hook
, A0
),
357 AROS_UFPA(struct ParseTagArgs
*, pta
, A2
),
358 AROS_UFPA(struct AslBase_intern
*, AslBase
, A1
)
361 AROS_UFP3(ULONG
, FRGadgetryHook
,
362 AROS_UFPA(struct Hook
*, hook
, A0
),
363 AROS_UFPA(struct LayoutData
*, ld
, A2
),
364 AROS_UFPA(struct AslBase_intern
*, AslBase
, A1
)
367 AROS_UFP3(VOID
, FOTagHook
,
368 AROS_UFPA(struct Hook
*, hook
, A0
),
369 AROS_UFPA(struct ParseTagArgs
*, pta
, A2
),
370 AROS_UFPA(struct AslBase_intern
*, AslBase
, A1
)
373 AROS_UFP3(ULONG
, FOGadgetryHook
,
374 AROS_UFPA(struct Hook
*, hook
, A0
),
375 AROS_UFPA(struct LayoutData
*, ld
, A2
),
376 AROS_UFPA(struct AslBase_intern
*, AslBase
, A1
)
379 AROS_UFP3(VOID
, SMTagHook
,
380 AROS_UFPA(struct Hook
*, hook
, A0
),
381 AROS_UFPA(struct ParseTagArgs
*, pta
, A2
),
382 AROS_UFPA(struct AslBase_intern
*, AslBase
, A1
)
385 AROS_UFP3(ULONG
, SMGadgetryHook
,
386 AROS_UFPA(struct Hook
*, hook
, A0
),
387 AROS_UFPA(struct LayoutData
*, ld
, A2
),
388 AROS_UFPA(struct AslBase_intern
*, AslBase
, A1
)
391 /*****************************************************************************************/
393 /* Return values for the gadgetry hooks */
394 #define GHRET_FINISHED_OK 2
399 #define SETFLAG(flagvar, boolvar, flag) \
406 /*****************************************************************************************/
409 #define ASLB(b) ((struct AslBase_intern *)b)
411 /*****************************************************************************************/
413 /* Private for asl internal classes */
428 /* AslListView class */
429 struct AslListViewData
432 struct LayoutData
*ld
;
434 struct Node
**nodetable
;
435 struct List emptylist
;
436 struct Hook default_renderhook
;
437 struct Hook
*renderhook
;
438 struct TextFont
*font
;
439 struct Rectangle
*renderrect
;
458 WORD rendersingleitem
;
468 /* AslButton class */
472 struct LayoutData
*ld
;
473 struct CoolImage
*coolimage
;
477 #define BUTTON_OWN_INPUT_HANDLING 1
478 #if BUTTON_OWN_INPUT_HANDLING
479 #define BUTTONSUPERCLASS GADGETCLASS
481 #define BUTTONSUPERCLASS BUTTONGCLASS
484 /* AslString class */
501 struct CycleItem
*itemmemory
;
503 struct RastPort clonerp
;
504 struct DrawInfo
*dri
;
505 struct TextFont
*font
;
506 struct Window
*popupwindow
;
533 BYTE popupwindowtype
;
540 /* AslFontPreview class */
541 struct AslFontPreviewData
544 struct TextFont
*font
;
546 UBYTE apen
, bpen
, drawstyle
;
549 /* ASlFontStyle class */
550 struct AslFontStyleData
557 /* AslColorPicker class */
558 struct AslColorPickerData
561 struct Window
*popupwindow
;
591 #endif /* ASL_INTERN_H */