1 #ifndef MUI_NList_priv_MCC_H
2 #define MUI_NList_priv_MCC_H
4 /***************************************************************************
6 NList.mcc - New List MUI Custom Class
7 Registered MUI class, Serial Number: 1d51 0x9d510030 to 0x9d5100A0
8 0x9d5100C0 to 0x9d5100FF
10 Copyright (C) 1996-2001 by Gilles Masson
11 Copyright (C) 2001-2014 NList Open Source Team
13 This library is free software; you can redistribute it and/or
14 modify it under the terms of the GNU Lesser General Public
15 License as published by the Free Software Foundation; either
16 version 2.1 of the License, or (at your option) any later version.
18 This library is distributed in the hope that it will be useful,
19 but WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 Lesser General Public License for more details.
23 NList classes Support Site: http://www.sf.net/projects/nlist-classes
27 ***************************************************************************/
29 #include <libraries/mui.h>
31 #include <mui/NList_mcc.h>
35 #include "mcc_common.h"
39 #define LONG_MAX 0x7fffffff /* max value for a long */
42 #define LONG_MIN 0x80000000 /* min value for a long */
45 #define ULONG_MAX 0xffffffffU /* max value for an unsigned long */
48 #define MUIM_NList_Trigger 0x9d510090 /* GM */
50 #ifndef MUIA_Prop_DoSmooth
51 #define MUIA_Prop_DoSmooth 0x804236ce /* V4 i.. LONG */
54 #define MUIV_NList_CursorType_None 0
55 #define MUIV_NList_CursorType_Bar 1
56 #define MUIV_NList_CursorType_Rect 2
59 #define MUIV_NList_TypeSelect_Line 0
60 #define MUIV_NList_TypeSelect_Char 1
62 #define MUIV_NList_TypeSelect_CWord 2
63 #define MUIV_NList_TypeSelect_CLine 3
64 #define MUIV_NList_TypeSelect_None 4
66 #define MUIV_NList_Active_UntilPageUp -8
67 #define MUIV_NList_Active_UntilPageDown -9
68 #define MUIV_NList_Active_UntilTop -10
69 #define MUIV_NList_Active_UntilBottom -11
73 #define IEQUALIFIER_SHIFT (IEQUALIFIER_LSHIFT|IEQUALIFIER_RSHIFT)
74 #define IEQUALIFIER_ALT (IEQUALIFIER_LALT|IEQUALIFIER_RALT)
75 #define IEQUALIFIER_COMMAND (IEQUALIFIER_LCOMMAND|IEQUALIFIER_RCOMMAND)
76 #define IEQUALIFIER_CTRL_SHIFT (IEQUALIFIER_CONTROL|IEQUALIFIER_LSHIFT|IEQUALIFIER_RSHIFT)
77 #define IEQUALIFIER_CTRL_LSHIFT (IEQUALIFIER_CONTROL|IEQUALIFIER_LSHIFT)
78 #define IEQUALIFIER_CTRL_RSHIFT (IEQUALIFIER_CONTROL|IEQUALIFIER_RSHIFT)
79 #define IEQUALIFIER_CTRL_ALT (IEQUALIFIER_CONTROL|IEQUALIFIER_LALT|IEQUALIFIER_RALT)
80 #define IEQUALIFIER_CTRL_LALT (IEQUALIFIER_CONTROL|IEQUALIFIER_LALT)
81 #define IEQUALIFIER_CTRL_RALT (IEQUALIFIER_CONTROL|IEQUALIFIER_RALT)
83 #define IEQUALIFIER_MASK (IEQUALIFIER_CONTROL|IEQUALIFIER_SHIFT|IEQUALIFIER_ALT|IEQUALIFIER_COMMAND)
86 #define RAWKEY_PAGEUP 0x48
88 #ifndef RAWKEY_PAGEDOWN
89 #define RAWKEY_PAGEDOWN 0x49
92 #define RAWKEY_HOME 0x70
95 #define RAWKEY_END 0x71
98 #define SCROLLBARSTIME 10
100 #define DATA_STRING_MAX 120
106 // defines for the different particalcol substitution types
107 #define PCS_DISABLED 0
117 SIPTR colwidthbiggestptr
;
118 SIPTR colwidthbiggestptr2
;
119 WORD colwidthbiggest
;
120 WORD colwidthbiggest2
;
150 #define AFFINFOS_START_MAX 40
155 ULONG tag
,tagval
,button
,imgnum
; // RHP: Changed for Special ShortHelp
166 #define TE_Select_None -1
167 #define TE_Select_Line -2
170 #define TE_Wrap_None 0
171 #define TE_Wrap_TmpLine 0x80
172 #define TE_Wrap_TmpMask 0x7F
174 #include "amiga-align.h"
176 /* The Type entry is exported to NListtree (sigh), so this have to be amiga
191 #include "default-align.h"
195 struct BitMapImage
*bmimg
;
201 #define MUIV_NList_Select_None -10
202 #define MUIV_NList_Select_List -11
212 #define PREPARSE_OFFSET_COL 2000
213 #define PREPARSE_OFFSET_ENTRY 1000
217 { struct NImgList
*next
;
228 Object
*this; // pointer to the own object
229 Object
*nlistviewobj
; // pointer to the parent/listview
230 Object
*listviewobj
; // pointer to the parent/listview if listview is Listview.mui
231 Object
*scrollersobj
; // pointer to the scrollers object
238 struct MUI_InputHandlerNode ihnode
;
244 struct MUI_EventHandlerNode ehnode
;
251 char *NList_SkipChars
;
252 char *NList_WordSelectChars
;
254 const char *NList_IgnoreSpecialChars
;
255 LONG NList_TitleSeparator
;
256 LONG NList_TitleMark
;
257 LONG NList_TitleMark2
;
258 LONG NList_LastInserted
;
260 LONG NList_AffActive
;
264 LONG NList_AffFirst_Incr
;
266 LONG NList_First_Incr
;
269 LONG NList_Prop_First
;
270 LONG NList_Prop_First_Real
;
271 LONG NList_Prop_First_Prec
;
273 LONG NList_Prop_Wait
;
274 LONG NList_Prop_Visible
;
275 LONG NList_Prop_Entries
;
276 LONG NList_Horiz_AffFirst
;
277 LONG NList_Horiz_First
;
278 LONG NList_Horiz_Visible
;
279 LONG NList_Horiz_Entries
;
280 LONG NList_MultiSelect
;
281 BOOL NList_DefaultObjectOnClick
;
282 BOOL NList_ActiveObjectOnClick
;
283 LONG NList_MinLineHeight
;
285 LONG NList_TypeSelect
;
286 LONG NList_SelectChange
;
289 IPTR NList_SelectPen
;
290 IPTR NList_CursorPen
;
291 IPTR NList_UnselCurPen
;
292 IPTR NList_InactivePen
;
293 IPTR NList_TitleBackGround
;
294 IPTR NList_ListBackGround
;
295 IPTR NList_SelectBackground
;
296 IPTR NList_CursorBackground
;
297 IPTR NList_UnselCurBackground
;
298 IPTR NList_InactiveBackground
;
301 LONG NList_DragColOnly
;
302 LONG NList_DragSortable
;
304 LONG NList_ShowDropMarks
;
305 LONG NList_ColWidthDrag
;
306 LONG NList_AdjustHeight
;
307 LONG NList_AdjustWidth
;
308 LONG NList_SourceArray
;
309 IPTR NList_KeepActive
;
310 IPTR NList_MakeActive
;
311 LONG NList_DefClickColumn
;
312 LONG NList_AutoCopyToClip
;
313 LONG NList_AutoVisible
;
315 LONG NList_EntryValueDependent
;
316 APTR NList_PrivateData
;
318 LONG NList_PartialCol
;
319 LONG NList_List_Select
;
320 LONG NList_PartialChar
;
321 LONG NList_ContextMenu
;
323 LONG NList_SortType2
;
324 LONG NList_ButtonClick
;
325 LONG NList_MinColSortable
;
329 LONG NList_SerMouseFix
;
330 LONG NList_DragLines
;
331 LONG NList_WheelStep
;
332 LONG NList_WheelFast
;
334 LONG NList_VerticalCenteredText
;
336 BOOL NList_SelectPointer
;
338 // object pointers for forwarding the
339 // key focus to other objects.
340 Object
*NList_KeyUpFocus
;
341 Object
*NList_KeyDownFocus
;
342 Object
*NList_KeyLeftFocus
;
343 Object
*NList_KeyRightFocus
;
345 STRPTR NList_ShortHelp
;
347 LONG ListCompatibility
;
348 struct KeyBinding
*NList_Keys
;
349 struct KeyBinding
*Wheel_Keys
;
350 UBYTE
*NList_Columns
;
351 ULONG HLINE_thick_pen
;
354 struct TypeEntry
**EntriesArray
;
355 struct Hook
*NList_CompareHook
;
356 struct Hook
*NList_ConstructHook
;
357 struct Hook
*NList_DestructHook
;
358 struct Hook
*NList_DisplayHook
;
359 struct Hook
*NList_MultiTestHook
;
360 struct Hook
*NList_CopyEntryToClipHook
;
361 struct Hook
*NList_CopyColumnToClipHook
;
362 LONG NList_CompareHook2
;
363 LONG NList_ConstructHook2
;
364 LONG NList_DestructHook2
;
365 LONG NList_DisplayHook2
;
366 LONG NList_CopyEntryToClipHook2
;
367 LONG NList_CopyColumnToClipHook2
;
368 APTR Pool
; /* Custom or internal pool pointer. */
369 APTR PoolInternal
; /* Internal pool pointer. */
381 struct IClass
*VirtClass
;
384 // for our own mouse pointer management
385 Object
*SizePointerObj
;
386 Object
*MovePointerObj
;
387 Object
*SelectPointerObj
;
388 enum PointerType activeCustomPointer
;
390 struct TextFont
*InUseFont
;
392 struct NImgList
*NImage2
;
393 struct NImgList NImage
;
395 struct UseImage
*NList_UseImages
;
398 APTR dispentry
; char *DisplayArray
[DISPLAY_ARRAY_MAX
*2 +2];
417 BOOL isActiveObject
; // TRUE in case object is active object of window
430 LONG multisel_qualifier
;
432 LONG multiclickalone
;
440 LONG minx_change_offset
;
441 LONG minx_change_entry
;
442 LONG maxx_change_offset
;
443 LONG maxx_change_entry
;
452 struct RastPort
*DragRPort
;
460 IPTR Pen_Select_init
;
461 IPTR Pen_Cursor_init
;
462 IPTR Pen_UnselCur_init
;
463 IPTR Pen_Inactive_init
;
468 IPTR BG_UnselCur_init
;
469 IPTR BG_Inactive_init
;
472 LONG old_prop_visible
;
473 LONG old_prop_entries
;
475 LONG old_horiz_first
;
476 LONG old_horiz_visible
;
477 LONG old_horiz_entries
;
478 LONG old_horiz_delta
;
482 struct TextFont
*font
;
494 struct SelPoint sel_pt
[4];
495 LONG last_sel_click_x
;
496 LONG last_sel_click_y
;
498 LONG affover
; // RHP: Added for Special Shorthelp
499 LONG affimage
; // RHP: Added for Special Shorthelp
505 struct IBox affbuttonpos
;
507 struct affinfo
*aff_infos
;
508 struct colinfo
*cols
;
528 WORD UpdateScrollersRedrawn
;
529 WORD UpdatingScrollbars
;
536 WORD adjustbar_last2
;
582 BYTE column
[DISPLAY_ARRAY_MAX
+2];
586 struct InputEvent ievent
;
587 char rawtext
[MAXRAWBUF
];
589 char NList_TitlePenBuffer
[128];
590 char NList_ListPenBuffer
[128];
591 char NList_SelectPenBuffer
[128];
592 char NList_CursorPenBuffer
[128];
593 char NList_UnselCurPenBuffer
[128];
594 char NList_InactivePenBuffer
[128];
595 char NList_TitleBackGroundBuffer
[128];
596 char NList_ListBackGroundBuffer
[128];
597 char NList_SelectBackgroundBuffer
[128];
598 char NList_CursorBackgroundBuffer
[128];
599 char NList_UnselCurBackgroundBuffer
[128];
600 char NList_InactiveBackgroundBuffer
[128];
604 #define MUII_myListInactive (data->NList_InactiveBackground)
605 #define MUII_myListUnselCur (data->NList_UnselCurBackground)
606 #define MUII_myListCursor (data->NList_CursorBackground)
607 #define MUII_myListSelCur (data->NList_CursorBackground)
608 #define MUII_myListSelect (data->NList_SelectBackground)
612 extern struct TextFont *Topaz_8;
615 #define LIBVER(lib) ((struct Library *)lib)->lib_Version
622 #define MUIV_NList_PoolPuddleSize_Default 2048
623 #define MUIV_NList_PoolThreshSize_Default 1024
626 // Gets an attribute value from a MUI object
627 IPTR
xget(Object
*obj
, const IPTR attr
);
628 #if defined(__GNUC__)
629 // please note that we do not evaluate the return value of GetAttr()
630 // as some attributes (e.g. MUIA_Selected) always return FALSE, even
631 // when they are supported by the object. But setting b=0 right before
632 // the GetAttr() should catch the case when attr doesn't exist at all
633 #define xget(OBJ, ATTR) ({IPTR b=0; GetAttr(ATTR, OBJ, &b); b;})
638 #define MIN(a,b) (((a) < (b)) ? (a) : (b))
641 #define MAX(a,b) (((a) > (b)) ? (a) : (b))
644 // special flagging macros
645 #define isFlagSet(v,f) (((v) & (f)) == (f)) // return TRUE if the flag is set
646 #define hasFlag(v,f) (((v) & (f)) != 0) // return TRUE if one of the flags in f is set in v
647 #define isFlagClear(v,f) (((v) & (f)) == 0) // return TRUE if flag f is not set in v
648 #define SET_FLAG(v,f) ((v) |= (f)) // set the flag f in v
649 #define CLEAR_FLAG(v,f) ((v) &= ~(f)) // clear the flag f in v
650 #define MASK_FLAG(v,f) ((v) &= (f)) // mask the variable v with flag f bitwise
652 #define VERSION_IS_AT_LEAST(ver, rev, minver, minrev) (((ver) > (minver)) || ((ver) == (minver) && (rev) == (minrev)) || ((ver) == (minver) && (rev) > (minrev)))
653 #define LIB_VERSION_IS_AT_LEAST(lib, minver, minrev) VERSION_IS_AT_LEAST(((struct Library *)(lib))->lib_Version, ((struct Library *)(lib))->lib_Revision, minver, minrev)
655 #if defined(__amigaos4__)
656 #define AllocVecShared(size, flags) AllocVecTags((size), AVT_Type, MEMF_SHARED, AVT_Lock, FALSE, ((flags)&MEMF_CLEAR) ? AVT_ClearWithValue : TAG_IGNORE, 0, TAG_DONE)
658 #define AllocVecShared(size, flags) AllocVec((size), (flags))
661 #endif /* MUI_NList_priv_MCC_H */