revert between 56095 -> 55830 in arch
[AROS.git] / workbench / classes / zune / nlist / nlisttree_mcc / private.h
blobb4d2cfeaa3fd4e0d72b7136f7d567f638dc39cec
1 #ifndef NLISTTREE_MCC_PRIVATE_H
2 #define NLISTTREE_MCC_PRIVATE_H
4 /***************************************************************************
6 NListtree.mcc - New Listtree MUI Custom Class
7 Copyright (C) 1999-2001 by Carsten Scholling
8 Copyright (C) 2001-2014 NList Open Source Team
10 This library is free software; you can redistribute it and/or
11 modify it under the terms of the GNU Lesser General Public
12 License as published by the Free Software Foundation; either
13 version 2.1 of the License, or (at your option) any later version.
15 This library is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 Lesser General Public License for more details.
20 NList classes Support Site: http://www.sf.net/projects/nlist-classes
22 $Id$
24 ***************************************************************************/
26 /*** Include stuff ***/
28 #ifndef LIBRARIES_MUI_H
29 #include <libraries/mui.h>
30 #endif
32 #include <mcc_common.h>
33 #include "mui/NList_mcc.h"
35 //#include "NListtree.h"
36 #include "Debug.h"
38 #include "amiga-align.h"
40 /*** MUI Defines ***/
42 #define MUIC_NListtree "NListtree.mcc"
43 #define NListtreeObject MUI_NewObject(MUIC_NListtree
45 #define MUIC_NListtreeP "NListtree.mcp" /*i*/
46 #define NListtreePObject MUI_NewObject(MUIC_NListtreeP /*i*/
48 #define SERNR_CASI 0x7ec8 // *** My serial number. *ic*
49 #define CLASS_TAGBASE ( TAG_USER | (SERNR_CASI<<16) | 0x1000 ) // *** Start of class tags. *ic*
50 #define MUIM_TB ( CLASS_TAGBASE + 0x0100 ) // *** Start of method tags. *ic*
51 #define MUIA_TB ( CLASS_TAGBASE + 0x0200 ) // *** Start of attribute tags. *ic*
52 #define MUICFG_TB ( CLASS_TAGBASE + 0x0000 ) // *** Start of config value tags. *ic*
54 /*** Attributes ***/
56 #define MUIA_NListtree_Active ( MUIA_TB | 0x0001 ) // *** [.SGN]
57 #define MUIA_NListtree_ActiveList ( MUIA_TB | 0x0002 ) // *** [..GN]
58 #define MUIA_NListtree_CloseHook ( MUIA_TB | 0x0003 ) // *** [IS..]
59 #define MUIA_NListtree_ConstructHook ( MUIA_TB | 0x0004 ) // *** [IS..]
60 #define MUIA_NListtree_DestructHook ( MUIA_TB | 0x0005 ) // *** [IS..]
61 #define MUIA_NListtree_DisplayHook ( MUIA_TB | 0x0006 ) // *** [IS..]
62 #define MUIA_NListtree_DoubleClick ( MUIA_TB | 0x0007 ) // *** [ISGN]
63 #define MUIA_NListtree_DragDropSort ( MUIA_TB | 0x0008 ) // *** [IS..]
64 #define MUIA_NListtree_DupNodeName ( MUIA_TB | 0x0009 ) // *** [IS..]
65 #define MUIA_NListtree_EmptyNodes ( MUIA_TB | 0x000a ) // *** [IS..]
66 #define MUIA_NListtree_Format ( MUIA_TB | 0x000b ) // *** [IS..]
67 #define MUIA_NListtree_OpenHook ( MUIA_TB | 0x000c ) // *** [IS..]
68 #define MUIA_NListtree_Quiet ( MUIA_TB | 0x000d ) // *** [.S..]
69 #define MUIA_NListtree_CompareHook ( MUIA_TB | 0x000e ) // *** [IS..]
70 #define MUIA_NListtree_Title ( MUIA_TB | 0x000f ) // *** [IS..]
71 #define MUIA_NListtree_TreeColumn ( MUIA_TB | 0x0010 ) // *** [ISG.]
72 #define MUIA_NListtree_AutoVisible ( MUIA_TB | 0x0011 ) // *** [ISG.]
73 #define MUIA_NListtree_FindNameHook ( MUIA_TB | 0x0012 ) // *** [IS..]
74 #define MUIA_NListtree_MultiSelect ( MUIA_TB | 0x0013 ) // *** [I...]
75 #define MUIA_NListtree_MultiTestHook ( MUIA_TB | 0x0014 ) // *** [IS..]
76 #define MUIA_NListtree_CopyToClipHook ( MUIA_TB | 0x0017 ) // *** [IS..]
77 #define MUIA_NListtree_DropType ( MUIA_TB | 0x0018 ) // *** [..G.]
78 #define MUIA_NListtree_DropTarget ( MUIA_TB | 0x0019 ) // *** [..G.]
79 #define MUIA_NListtree_DropTargetPos ( MUIA_TB | 0x001a ) // *** [..G.]
80 #define MUIA_NListtree_FindUserDataHook ( MUIA_TB | 0x001b ) // *** [IS..]
81 #define MUIA_NListtree_ShowTree ( MUIA_TB | 0x001c ) // *** [ISG.]
82 #define MUIA_NListtree_SelectChange ( MUIA_TB | 0x001d ) // *** [ISGN]
83 #define MUIA_NListtree_NoRootTree ( MUIA_TB | 0x001e ) // *** [I...]
85 /*i* Private attributes & configs ***/
87 #define MUIA_NListtree_OnlyTrigger ( MUIA_TB | 0x0015 ) // *** $$$ Was ListtreeCompatibility before!
88 #define MUIA_NListtree_IsMCP ( MUIA_TB | 0x0016 )
90 #define MUICFG_NListtree_ImageSpecClosed ( MUICFG_TB | 0x0001 )
91 #define MUICFG_NListtree_ImageSpecOpen ( MUICFG_TB | 0x0002 )
92 #define MUICFG_NListtree_ImageSpecFolder ( MUICFG_TB | 0x0003 )
94 #define MUICFG_NListtree_PenSpecLines ( MUICFG_TB | 0x0004 )
95 #define MUICFG_NListtree_PenSpecShadow ( MUICFG_TB | 0x0005 )
96 #define MUICFG_NListtree_PenSpecGlow ( MUICFG_TB | 0x0006 )
98 #define MUICFG_NListtree_RememberStatus ( MUICFG_TB | 0x0007 )
99 #define MUICFG_NListtree_IndentWidth ( MUICFG_TB | 0x0008 )
100 #define MUICFG_NListtree_OpenAutoScroll ( MUICFG_TB | 0x000a )
101 #define MUICFG_NListtree_LineType ( MUICFG_TB | 0x000b )
102 #define MUICFG_NListtree_UseFolderImage ( MUICFG_TB | 0x000c )
104 /*i* Private attribute & config values ***/
106 #define MUICFGV_NListtree_LineType_Disabled 0
107 #define MUICFGV_NListtree_LineType_Normal 1
108 #define MUICFGV_NListtree_LineType_Dotted 2
109 #define MUICFGV_NListtree_LineType_Shadow 3
110 #define MUICFGV_NListtree_LineType_Glow 4
112 #define MUICFGV_NListtree_ImageSpecClosed_Default "6:30" // MUII_TapePlay
113 #define MUICFGV_NListtree_ImageSpecOpen_Default "6:39" // MUII_TapeDown
114 #define MUICFGV_NListtree_ImageSpecFolder_Default "6:22" // MUII_Drawer
115 #define MUICFGV_NListtree_PenSpecLines_Default MPEN_SHINE
116 #define MUICFGV_NListtree_PenSpecShadow_Default MPEN_SHADOW
117 #define MUICFGV_NListtree_PenSpecGlow_Default MPEN_HALFSHADOW
118 #define MUICFGV_NListtree_RememberStatus_Default TRUE
119 #define MUICFGV_NListtree_IndentWidth_Default 0
120 #define MUICFGV_NListtree_OpenAutoScroll_Default TRUE
121 #define MUICFGV_NListtree_LineType_Default MUICFGV_NListtree_LineType_Disabled
122 #define MUICFGV_NListtree_UseFolderImage_Default FALSE
124 /*** Special attribute values ***/
126 #define MUIV_NListtree_Active_Off 0
127 #define MUIV_NListtree_Active_Parent -2
128 #define MUIV_NListtree_Active_First -3
129 #define MUIV_NListtree_Active_FirstVisible -4
130 #define MUIV_NListtree_Active_LastVisible -5
132 #define MUIV_NListtree_ActiveList_Off 0
134 #define MUIV_NListtree_AutoVisible_Off 0
135 #define MUIV_NListtree_AutoVisible_Normal 1
136 #define MUIV_NListtree_AutoVisible_FirstOpen 2
137 #define MUIV_NListtree_AutoVisible_Expand 3
139 #define MUIV_NListtree_CompareHook_Head 0
140 #define MUIV_NListtree_CompareHook_Tail -1
141 #define MUIV_NListtree_CompareHook_LeavesTop -2
142 #define MUIV_NListtree_CompareHook_LeavesMixed -3
143 #define MUIV_NListtree_CompareHook_LeavesBottom -4
145 #define MUIV_NListtree_ConstructHook_String -1
146 #define MUIV_NListtree_ConstructHook_Flag_AutoCreate (1<<15)
148 #define MUIV_NListtree_CopyToClipHook_Default 0
150 #define MUIV_NListtree_DestructHook_String -1
152 #define MUIV_NListtree_DisplayHook_Default -1
154 #define MUIV_NListtree_DoubleClick_Off -1
155 #define MUIV_NListtree_DoubleClick_All -2
156 #define MUIV_NListtree_DoubleClick_Tree -3
157 #define MUIV_NListtree_DoubleClick_NoTrigger -4
159 #define MUIV_NListtree_DropType_None 0
160 #define MUIV_NListtree_DropType_Above 1
161 #define MUIV_NListtree_DropType_Below 2
162 #define MUIV_NListtree_DropType_Onto 3
163 #define MUIV_NListtree_DropType_Sorted 4
165 #define MUIV_NListtree_FindNameHook_CaseSensitive 0
166 #define MUIV_NListtree_FindNameHook_CaseInsensitive -1
167 #define MUIV_NListtree_FindNameHook_PartCaseSensitive -2
168 #define MUIV_NListtree_FindNameHook_PartCaseInsensitive -3
169 #define MUIV_NListtree_FindNameHook_PointerCompare -4
170 #define MUIV_NListtree_FindNameHook_Part MUIV_NListtree_FindNameHook_PartCaseSensitive /* obsolete */
172 #define MUIV_NListtree_FindUserDataHook_CaseSensitive 0
173 #define MUIV_NListtree_FindUserDataHook_CaseInsensitive -1
174 #define MUIV_NListtree_FindUserDataHook_Part -2
175 #define MUIV_NListtree_FindUserDataHook_PartCaseInsensitive -3
176 #define MUIV_NListtree_FindUserDataHook_PointerCompare -4
178 #define MUIV_NListtree_MultiSelect_None 0
179 #define MUIV_NListtree_MultiSelect_Default 1
180 #define MUIV_NListtree_MultiSelect_Shifted 2
181 #define MUIV_NListtree_MultiSelect_Always 3
183 #define MUIV_NListtree_MultiSelect_Flag_AutoSelectChilds (1<<31) /*i*/
185 #define MUIV_NListtree_ShowTree_Toggle -1
190 /*** Structures & Flags ***/
192 struct MUI_NListtree_TreeNode {
193 struct MinNode tn_Node; // *** To make it a node.
194 STRPTR tn_Name; // *** Simple name field.
195 UWORD tn_Flags; // *** Used for the flags below.
196 APTR tn_User; // *** Free for user data.
197 UWORD tn_Space; // *** For counting pixel and saving string space in InsertTreeImages(). *i*
198 UWORD tn_IFlags; // *** Internal flags *i*
199 UWORD tn_ImagePos; // *** Internal: Open/closed image position *i*
200 struct MUI_NListtree_TreeNode *tn_Parent; // *** Parent node *i*
201 struct NListEntry *tn_NListEntry; // *** NList TypeEntry *i*
205 #define TNF_OPEN (1<<0)
206 #define TNF_LIST (1<<1)
207 #define TNF_FROZEN (1<<2)
208 #define TNF_NOSIGN (1<<3)
209 #define TNF_SELECTED (1<<4)
213 struct MUI_NListtree_TestPos_Result {
214 struct MUI_NListtree_TreeNode *tpr_TreeNode;
215 UWORD tpr_Type;
216 LONG tpr_ListEntry;
217 UWORD tpr_ListFlags;
218 WORD tpr_Column;
222 #define tpr_Flags tpr_Type /* OBSOLETE */
225 /*i* Private Structures & Flags ***/
228 ** NList TypeEntry for entry position
230 struct NListEntry {
231 APTR Entry;
232 BYTE Select;
233 UBYTE Wrap;
234 WORD PixLen;
235 WORD pos;
236 WORD len;
237 WORD style;
238 UWORD dnum;
239 ULONG entpos;
243 struct Table {
244 struct MUI_NListtree_TreeNode **tb_Table; // *** Table of entries.
245 LONG tb_Entries, // *** Number of entries in this list.
246 tb_Size, // *** Size of the list.
247 tb_Current; // *** Current entry (not used everytime)
250 struct MUI_NListtree_ListNode {
251 struct MinNode ln_Node; // *** To make it a node.
252 STRPTR ln_Name; // *** Simple name field.
253 UWORD ln_Flags; // *** Used for some flags.
254 APTR ln_User; // *** Free for user data.
255 UWORD tn_Space; // *** For saving string space in InertTreeImages().
256 UWORD ln_IFlags; // *** Internal flags.
257 UWORD ln_ImagePos; // *** Internal: Open/closed image position.
258 struct MUI_NListtree_TreeNode *ln_Parent; // *** Parent node.
259 struct NListEntry *tn_NListEntry; // *** NList TypeEntry
260 struct MinList ln_List; // *** List which holds all the child entries.
261 struct Table ln_Table; // *** Table of entries.
265 #define TNIF_COLLAPSED (1<<0) /* Entry is collapsed. */
266 #define TNIF_VISIBLE (1<<1) /* Entry is currently visible. */
267 #define TNIF_TEMPFLAG (1<<2) /* Multi purpose flag for signalling we have to do something with this node */
268 #define TNIF_ALLOCATED (1<<3) /* Indicates, that memory was previsously allocated for tn_Name field. */
269 #define TNIF_xxx (1<<4) /* */
270 #define TNIF_FREE3 (1<<5)
271 #define TNIF_ROOT (1<<6) /* This entry is the root list. */
275 /*** Methods ***/
277 #define MUIM_NListtree_Open ( MUIM_TB | 0x0001 )
278 #define MUIM_NListtree_Close ( MUIM_TB | 0x0002 )
279 #define MUIM_NListtree_Insert ( MUIM_TB | 0x0003 )
280 #define MUIM_NListtree_Remove ( MUIM_TB | 0x0004 )
281 #define MUIM_NListtree_Exchange ( MUIM_TB | 0x0005 )
282 #define MUIM_NListtree_Move ( MUIM_TB | 0x0006 )
283 #define MUIM_NListtree_Rename ( MUIM_TB | 0x0007 )
284 #define MUIM_NListtree_FindName ( MUIM_TB | 0x0008 )
285 #define MUIM_NListtree_GetEntry ( MUIM_TB | 0x0009 )
286 #define MUIM_NListtree_GetNr ( MUIM_TB | 0x000a )
287 #define MUIM_NListtree_Sort ( MUIM_TB | 0x000b )
288 #define MUIM_NListtree_TestPos ( MUIM_TB | 0x000c )
289 #define MUIM_NListtree_Redraw ( MUIM_TB | 0x000d )
290 #define MUIM_NListtree_NextSelected ( MUIM_TB | 0x0010 )
291 #define MUIM_NListtree_MultiTest ( MUIM_TB | 0x0011 )
292 #define MUIM_NListtree_Select ( MUIM_TB | 0x0012 )
293 #define MUIM_NListtree_Copy ( MUIM_TB | 0x0013 )
294 #define MUIM_NListtree_InsertStruct ( MUIM_TB | 0x0014 ) // *** Insert a struct (like a path) into the list.
295 #define MUIM_NListtree_Active ( MUIM_TB | 0x0015 ) // *** Method which gives the active node/number.
296 #define MUIM_NListtree_DoubleClick ( MUIM_TB | 0x0016 ) // *** Occurs on every double click.
297 #define MUIM_NListtree_PrevSelected ( MUIM_TB | 0x0018 ) // *** Like reverse NextSelected.
298 #define MUIM_NListtree_CopyToClip ( MUIM_TB | 0x0019 ) // *** Copy an entry or part to the clipboard.
299 #define MUIM_NListtree_FindUserData ( MUIM_TB | 0x001a ) // *** Find a node upon user data.
300 #define MUIM_NListtree_Clear ( MUIM_TB | 0x001b ) // *** Clear complete tree.
301 #define MUIM_NListtree_DropType ( MUIM_TB | 0x001e ) // ***
302 #define MUIM_NListtree_DropDraw ( MUIM_TB | 0x001f ) // ***
303 #define MUIM_NListtree_Construct ( MUIM_TB | 0x0020 ) // *** Construct a treenode
304 #define MUIM_NListtree_Destruct ( MUIM_TB | 0x0021 ) // *** Destruct a treenode
305 #define MUIM_NListtree_Display ( MUIM_TB | 0x0022 ) // *** Display a treenode
306 #define MUIM_NListtree_Compare ( MUIM_TB | 0x0023 ) // *** Compare two treenodes
309 /*i* Private Methods ***/
311 #define MUIM_NListtree_GetListActive ( MUIM_TB | 0x000e ) // *** NEW: Internal! Get MUIA_NList_Active
312 #define MUIM_NListtree_Data ( MUIM_TB | 0x000f ) // *** Get or set some internal data.
313 #define MUIM_NListtree_GetDoubleClick ( MUIM_TB | 0x0017 ) // *** NEW: Internal! Get MUIA_NList_DoubleClick
316 /*** Method structs ***/
318 struct MUIP_NListtree_Open {
319 STACKED ULONG MethodID;
320 STACKED struct MUI_NListtree_TreeNode *ListNode;
321 STACKED struct MUI_NListtree_TreeNode *TreeNode;
322 STACKED ULONG Flags;
326 struct MUIP_NListtree_Close {
327 STACKED ULONG MethodID;
328 STACKED struct MUI_NListtree_TreeNode *ListNode;
329 STACKED struct MUI_NListtree_TreeNode *TreeNode;
330 STACKED ULONG Flags;
334 struct MUIP_NListtree_Insert {
335 STACKED ULONG MethodID;
336 STACKED STRPTR Name;
337 STACKED APTR User;
338 STACKED struct MUI_NListtree_TreeNode *ListNode;
339 STACKED struct MUI_NListtree_TreeNode *PrevNode;
340 STACKED ULONG Flags;
344 struct MUIP_NListtree_Remove {
345 STACKED ULONG MethodID;
346 STACKED struct MUI_NListtree_TreeNode *ListNode;
347 STACKED struct MUI_NListtree_TreeNode *TreeNode;
348 STACKED ULONG Flags;
352 struct MUIP_NListtree_Clear {
353 STACKED ULONG MethodID;
354 STACKED struct MUI_NListtree_TreeNode *ListNode;
355 STACKED ULONG Flags;
359 struct MUIP_NListtree_FindName {
360 STACKED ULONG MethodID;
361 STACKED struct MUI_NListtree_TreeNode *ListNode;
362 STACKED STRPTR Name;
363 STACKED ULONG Flags;
367 struct MUIP_NListtree_FindUserData {
368 STACKED ULONG MethodID;
369 STACKED struct MUI_NListtree_TreeNode *ListNode;
370 STACKED APTR User;
371 STACKED ULONG Flags;
375 struct MUIP_NListtree_GetEntry {
376 STACKED ULONG MethodID;
377 STACKED struct MUI_NListtree_TreeNode *Node;
378 STACKED LONG Position;
379 STACKED ULONG Flags;
383 struct MUIP_NListtree_GetNr {
384 STACKED ULONG MethodID;
385 STACKED struct MUI_NListtree_TreeNode *TreeNode;
386 STACKED ULONG Flags;
390 struct MUIP_NListtree_Move {
391 STACKED ULONG MethodID;
392 STACKED struct MUI_NListtree_TreeNode *OldListNode;
393 STACKED struct MUI_NListtree_TreeNode *OldTreeNode;
394 STACKED struct MUI_NListtree_TreeNode *NewListNode;
395 STACKED struct MUI_NListtree_TreeNode *NewTreeNode;
396 STACKED ULONG Flags;
400 struct MUIP_NListtree_Exchange {
401 STACKED ULONG MethodID;
402 STACKED struct MUI_NListtree_TreeNode *ListNode1;
403 STACKED struct MUI_NListtree_TreeNode *TreeNode1;
404 STACKED struct MUI_NListtree_TreeNode *ListNode2;
405 STACKED struct MUI_NListtree_TreeNode *TreeNode2;
406 STACKED ULONG Flags;
410 struct MUIP_NListtree_Rename {
411 STACKED ULONG MethodID;
412 STACKED struct MUI_NListtree_TreeNode *TreeNode;
413 STACKED STRPTR NewName;
414 STACKED ULONG Flags;
418 struct MUIP_NListtree_Sort {
419 STACKED ULONG MethodID;
420 STACKED struct MUI_NListtree_TreeNode *ListNode;
421 STACKED ULONG Flags;
425 struct MUIP_NListtree_TestPos {
426 STACKED ULONG MethodID;
427 STACKED LONG X;
428 STACKED LONG Y;
429 STACKED APTR Result;
433 struct MUIP_NListtree_Redraw {
434 STACKED ULONG MethodID;
435 STACKED struct MUI_NListtree_TreeNode *TreeNode;
436 STACKED ULONG Flags;
440 struct MUIP_NListtree_Select {
441 STACKED ULONG MethodID;
442 STACKED struct MUI_NListtree_TreeNode *TreeNode;
443 STACKED LONG SelType;
444 STACKED LONG SelFlags;
445 STACKED LONG *State;
449 struct MUIP_NListtree_NextSelected {
450 STACKED ULONG MethodID;
451 STACKED struct MUI_NListtree_TreeNode **TreeNode;
455 struct MUIP_NListtree_MultiTest {
456 STACKED ULONG MethodID;
457 STACKED struct MUI_NListtree_TreeNode *TreeNode;
458 STACKED LONG SelType;
459 STACKED LONG SelFlags;
460 STACKED LONG CurrType;
464 struct MUIP_NListtree_Copy {
465 STACKED ULONG MethodID;
466 STACKED struct MUI_NListtree_TreeNode *SourceListNode;
467 STACKED struct MUI_NListtree_TreeNode *SourceTreeNode;
468 STACKED struct MUI_NListtree_TreeNode *DestListNode;
469 STACKED struct MUI_NListtree_TreeNode *DestTreeNode;
470 STACKED ULONG Flags;
474 struct MUIP_NListtree_InsertStruct {
475 STACKED ULONG MethodID;
476 STACKED STRPTR Name;
477 STACKED APTR User;
478 STACKED STRPTR Delimiter;
479 STACKED ULONG Flags;
483 struct MUIP_NListtree_Active {
484 STACKED ULONG MethodID;
485 STACKED LONG Pos;
486 STACKED struct MUI_NListtree_TreeNode *ActiveNode;
490 struct MUIP_NListtree_DoubleClick {
491 STACKED ULONG MethodID;
492 STACKED struct MUI_NListtree_TreeNode *TreeNode;
493 STACKED LONG Entry;
494 STACKED LONG Column;
498 struct MUIP_NListtree_PrevSelected {
499 STACKED ULONG MethodID;
500 STACKED struct MUI_NListtree_TreeNode **TreeNode;
504 struct MUIP_NListtree_CopyToClip {
505 STACKED ULONG MethodID;
506 STACKED struct MUI_NListtree_TreeNode *TreeNode;
507 STACKED LONG Pos;
508 STACKED LONG Unit;
512 struct MUIP_NListtree_DropType {
513 STACKED ULONG MethodID;
514 STACKED LONG *Pos;
515 STACKED LONG *Type;
516 STACKED LONG MinX, MaxX, MinY, MaxY;
517 STACKED LONG MouseX, MouseY;
521 struct MUIP_NListtree_DropDraw {
522 STACKED ULONG MethodID;
523 STACKED LONG Pos;
524 STACKED LONG Type;
525 STACKED LONG MinX, MaxX, MinY, MaxY;
529 struct MUIP_NListtree_Construct
531 STACKED ULONG MethodID;
532 STACKED STRPTR Name;
533 STACKED APTR UserData;
534 STACKED APTR MemPool;
535 STACKED ULONG Flags;
539 struct MUIP_NListtree_Destruct
541 STACKED ULONG MethodID;
542 STACKED STRPTR Name;
543 STACKED APTR UserData;
544 STACKED APTR MemPool;
545 STACKED ULONG Flags;
549 struct MUIP_NListtree_Display
551 STACKED ULONG MethodID;
552 STACKED struct MUI_NListtree_TreeNode *TreeNode;
553 STACKED LONG EntryPos;
554 STACKED STRPTR *Array;
555 STACKED STRPTR *Preparse;
559 struct MUIP_NListtree_Compare
561 STACKED ULONG MethodID;
562 STACKED struct MUI_NListtree_TreeNode *TreeNode1;
563 STACKED struct MUI_NListtree_TreeNode *TreeNode2;
564 STACKED LONG SortType;
568 /*i* Private method structs ***/
570 struct MUIP_NListtree_GetListActive {
571 STACKED ULONG MethodID;
575 struct MUIP_NListtree_Data {
576 STACKED ULONG MethodID;
577 STACKED LONG ID;
578 STACKED LONG Set;
583 /*** Special method values ***/
585 #define MUIV_NListtree_Close_ListNode_Root ((IPTR)0)
586 #define MUIV_NListtree_Close_ListNode_Parent ((IPTR)-1)
587 #define MUIV_NListtree_Close_ListNode_Active ((IPTR)-2)
589 #define MUIV_NListtree_Close_TreeNode_Head ((IPTR)0)
590 #define MUIV_NListtree_Close_TreeNode_Tail ((IPTR)-1)
591 #define MUIV_NListtree_Close_TreeNode_Active ((IPTR)-2)
592 #define MUIV_NListtree_Close_TreeNode_All ((IPTR)-3)
594 #define MUIV_NListtree_Close_Flag_Nr (1<<15) /*i*/
595 #define MUIV_NListtree_Close_Flag_Visible (1<<14) /*i*/
598 #define MUIV_NListtree_Exchange_ListNode1_Root ((IPTR)0)
599 #define MUIV_NListtree_Exchange_ListNode1_Active ((IPTR)-2)
601 #define MUIV_NListtree_Exchange_TreeNode1_Head ((IPTR)0)
602 #define MUIV_NListtree_Exchange_TreeNode1_Tail ((IPTR)-1)
603 #define MUIV_NListtree_Exchange_TreeNode1_Active ((IPTR)-2)
605 #define MUIV_NListtree_Exchange_ListNode2_Root ((IPTR)0)
606 #define MUIV_NListtree_Exchange_ListNode2_Active ((IPTR)-2)
608 #define MUIV_NListtree_Exchange_TreeNode2_Head ((IPTR)0)
609 #define MUIV_NListtree_Exchange_TreeNode2_Tail ((IPTR)-1)
610 #define MUIV_NListtree_Exchange_TreeNode2_Active ((IPTR)-2)
611 #define MUIV_NListtree_Exchange_TreeNode2_Up ((IPTR)-5)
612 #define MUIV_NListtree_Exchange_TreeNode2_Down ((IPTR)-6)
615 #define MUIV_NListtree_FindName_ListNode_Root ((IPTR)0)
616 #define MUIV_NListtree_FindName_ListNode_Active ((IPTR)-2)
618 #define MUIV_NListtree_FindName_Flag_SameLevel (1<<15)
619 #define MUIV_NListtree_FindName_Flag_Visible (1<<14)
620 #define MUIV_NListtree_FindName_Flag_Activate (1<<13)
621 #define MUIV_NListtree_FindName_Flag_FindPart (1<<12) /*i*/
622 #define MUIV_NListtree_FindName_Flag_Selected (1<<11)
623 #define MUIV_NListtree_FindName_Flag_StartNode (1<<10)
624 #define MUIV_NListtree_FindName_Flag_Reverse (1<<9)
627 #define MUIV_NListtree_FindUserData_ListNode_Root ((IPTR)0)
628 #define MUIV_NListtree_FindUserData_ListNode_Active ((IPTR)-2)
630 #define MUIV_NListtree_FindUserData_Flag_SameLevel (1<<15)
631 #define MUIV_NListtree_FindUserData_Flag_Visible (1<<14)
632 #define MUIV_NListtree_FindUserData_Flag_Activate (1<<13)
633 #define MUIV_NListtree_FindUserData_Flag_FindPart (1<<12) /*i*/
634 #define MUIV_NListtree_FindUserData_Flag_Selected (1<<11)
635 #define MUIV_NListtree_FindUserData_Flag_StartNode (1<<10)
636 #define MUIV_NListtree_FindUserData_Flag_Reverse (1<<9)
639 #define MUIV_NListtree_GetEntry_ListNode_Root ((IPTR)0)
640 #define MUIV_NListtree_GetEntry_ListNode_Active ((IPTR)-2)
641 #define MUIV_NListtree_GetEntry_TreeNode_Active ((IPTR)-3)
643 #define MUIV_NListtree_GetEntry_Position_Head 0
644 #define MUIV_NListtree_GetEntry_Position_Tail -1
645 #define MUIV_NListtree_GetEntry_Position_Active -2
646 #define MUIV_NListtree_GetEntry_Position_Next -3
647 #define MUIV_NListtree_GetEntry_Position_Previous -4
648 #define MUIV_NListtree_GetEntry_Position_Parent -5
649 #define MUIV_NListtree_GetEntry_Position_Root -15 /*i*/
651 #define MUIV_NListtree_GetEntry_Flag_SameLevel (1<<15)
652 #define MUIV_NListtree_GetEntry_Flag_Visible (1<<14)
655 #define MUIV_NListtree_GetNr_TreeNode_Root ((IPTR)0)
656 #define MUIV_NListtree_GetNr_TreeNode_Active ((IPTR)-2)
658 #define MUIV_NListtree_GetNr_Flag_CountAll (1<<15)
659 #define MUIV_NListtree_GetNr_Flag_CountLevel (1<<14)
660 #define MUIV_NListtree_GetNr_Flag_CountList (1<<13)
661 #define MUIV_NListtree_GetNr_Flag_ListEmpty (1<<12)
662 #define MUIV_NListtree_GetNr_Flag_Visible (1<<11)
665 #define MUIV_NListtree_Insert_ListNode_Root ((IPTR)0)
666 #define MUIV_NListtree_Insert_ListNode_Active ((IPTR)-2)
667 #define MUIV_NListtree_Insert_ListNode_LastInserted ((IPTR)-3)
668 #define MUIV_NListtree_Insert_ListNode_ActiveFallback ((IPTR)-4)
670 #define MUIV_NListtree_Insert_PrevNode_Head ((IPTR)0)
671 #define MUIV_NListtree_Insert_PrevNode_Tail ((IPTR)-1)
672 #define MUIV_NListtree_Insert_PrevNode_Active ((IPTR)-2)
673 #define MUIV_NListtree_Insert_PrevNode_Sorted ((IPTR)-4)
675 #define MUIV_NListtree_Insert_Flag_Nr (1<<15) /*i*/
676 #define MUIV_NListtree_Insert_Flag_Visible (1<<14) /*i*/
677 #define MUIV_NListtree_Insert_Flag_Active (1<<13)
678 #define MUIV_NListtree_Insert_Flag_NextNode (1<<12)
681 #define MUIV_NListtree_Move_OldListNode_Root ((IPTR)0)
682 #define MUIV_NListtree_Move_OldListNode_Active ((IPTR)-2)
684 #define MUIV_NListtree_Move_OldTreeNode_Head ((IPTR)0)
685 #define MUIV_NListtree_Move_OldTreeNode_Tail ((IPTR)-1)
686 #define MUIV_NListtree_Move_OldTreeNode_Active ((IPTR)-2)
688 #define MUIV_NListtree_Move_NewListNode_Root ((IPTR)0)
689 #define MUIV_NListtree_Move_NewListNode_Active ((IPTR)-2)
691 #define MUIV_NListtree_Move_NewTreeNode_Head ((IPTR)0)
692 #define MUIV_NListtree_Move_NewTreeNode_Tail ((IPTR)-1)
693 #define MUIV_NListtree_Move_NewTreeNode_Active ((IPTR)-2)
694 #define MUIV_NListtree_Move_NewTreeNode_Sorted ((IPTR)-4)
696 #define MUIV_NListtree_Move_Flag_Nr (1<<15) /*i*/
697 #define MUIV_NListtree_Move_Flag_Visible (1<<14) /*i*/
698 #define MUIV_NListtree_Move_Flag_KeepStructure (1<<13)
701 #define MUIV_NListtree_Open_ListNode_Root ((IPTR)0)
702 #define MUIV_NListtree_Open_ListNode_Parent ((IPTR)-1)
703 #define MUIV_NListtree_Open_ListNode_Active ((IPTR)-2)
704 #define MUIV_NListtree_Open_TreeNode_Head ((IPTR)0)
705 #define MUIV_NListtree_Open_TreeNode_Tail ((IPTR)-1)
706 #define MUIV_NListtree_Open_TreeNode_Active ((IPTR)-2)
707 #define MUIV_NListtree_Open_TreeNode_All ((IPTR)-3)
709 #define MUIV_NListtree_Open_Flag_Nr (1<<15) /*i*/
710 #define MUIV_NListtree_Open_Flag_Visible (1<<14) /*i*/
713 #define MUIV_NListtree_Remove_ListNode_Root ((IPTR)0)
714 #define MUIV_NListtree_Remove_ListNode_Active ((IPTR)-2)
715 #define MUIV_NListtree_Remove_TreeNode_Head ((IPTR)0)
716 #define MUIV_NListtree_Remove_TreeNode_Tail ((IPTR)-1)
717 #define MUIV_NListtree_Remove_TreeNode_Active ((IPTR)-2)
718 #define MUIV_NListtree_Remove_TreeNode_All ((IPTR)-3)
719 #define MUIV_NListtree_Remove_TreeNode_Selected ((IPTR)-4)
721 #define MUIV_NListtree_Remove_Flag_Nr (1<<15) /*i*/
722 #define MUIV_NListtree_Remove_Flag_Visible (1<<14) /*i*/
723 #define MUIV_NListtree_Remove_Flag_NoActive (1<<13)
726 #define MUIV_NListtree_Clear_TreeNode_Root 0 /*i*/
727 #define MUIV_NListtree_Clear_TreeNode_Active -2 /*i*/
730 #define MUIV_NListtree_Rename_TreeNode_Active ((IPTR)-2)
732 #define MUIV_NListtree_Rename_Flag_User (1<<8)
733 #define MUIV_NListtree_Rename_Flag_NoRefresh (1<<9)
736 #define MUIV_NListtree_Sort_ListNode_Root ((IPTR)0)
737 #define MUIV_NListtree_Sort_ListNode_Active ((IPTR)-2)
738 #define MUIV_NListtree_Sort_TreeNode_Active ((IPTR)-3)
740 #define MUIV_NListtree_Sort_Flag_Nr (1<<15) /*i*/
741 #define MUIV_NListtree_Sort_Flag_Visible (1<<14) /*i*/
742 #define MUIV_NListtree_Sort_Flag_RecursiveOpen (1<<13)
743 #define MUIV_NListtree_Sort_Flag_RecursiveAll (1<<12)
746 #define MUIV_NListtree_TestPos_Result_None 0
747 #define MUIV_NListtree_TestPos_Result_Above 1
748 #define MUIV_NListtree_TestPos_Result_Below 2
749 #define MUIV_NListtree_TestPos_Result_Onto 3
750 #define MUIV_NListtree_TestPos_Result_Sorted 4
752 #define MUIV_NListtree_Redraw_Active ((IPTR)-1)
753 #define MUIV_NListtree_Redraw_All ((IPTR)-2)
755 #define MUIV_NListtree_Redraw_Flag_Nr (1<<15)
757 #define MUIV_NListtree_Select_Active -1
758 #define MUIV_NListtree_Select_All -2
759 #define MUIV_NListtree_Select_Visible -3
761 #define MUIV_NListtree_Select_Off 0
762 #define MUIV_NListtree_Select_On 1
763 #define MUIV_NListtree_Select_Toggle 2
764 #define MUIV_NListtree_Select_Ask 3
766 #define MUIV_NListtree_Select_Flag_Force (1<<15)
769 #define MUIV_NListtree_NextSelected_Start ((IPTR)-1)
770 #define MUIV_NListtree_NextSelected_End ((IPTR)-1)
773 #define MUIV_NListtree_Copy_SourceListNode_Root ((IPTR)0)
774 #define MUIV_NListtree_Copy_SourceListNode_Active ((IPTR)-2)
776 #define MUIV_NListtree_Copy_SourceTreeNode_Head ((IPTR)0)
777 #define MUIV_NListtree_Copy_SourceTreeNode_Tail ((IPTR)-1)
778 #define MUIV_NListtree_Copy_SourceTreeNode_Active ((IPTR)-2)
780 #define MUIV_NListtree_Copy_DestListNode_Root ((IPTR)0)
781 #define MUIV_NListtree_Copy_DestListNode_Active ((IPTR)-2)
783 #define MUIV_NListtree_Copy_DestTreeNode_Head ((IPTR)0)
784 #define MUIV_NListtree_Copy_DestTreeNode_Tail ((IPTR)-1)
785 #define MUIV_NListtree_Copy_DestTreeNode_Active ((IPTR)-2)
786 #define MUIV_NListtree_Copy_DestTreeNode_Sorted ((IPTR)-4)
788 #define MUIV_NListtree_Copy_Flag_Nr (1<<15) /*i*/
789 #define MUIV_NListtree_Copy_Flag_Visible (1<<14) /*i*/
790 #define MUIV_NListtree_Copy_Flag_KeepStructure (1<<13)
793 #define MUIV_NListtree_InsertStruct_Flag_AllowDuplicates (1<<11)
796 #define MUIV_NListtree_PrevSelected_Start ((IPTR)-1)
797 #define MUIV_NListtree_PrevSelected_End ((IPTR)-1)
800 #define MUIV_NListtree_CopyToClip_Active ((IPTR)-1)
803 /*i* Private method values ***/
805 #define MUIV_NListtree_Data_MemPool 1
806 #define MUIV_NListtree_Data_VersInfo 2
807 #define MUIV_NListtree_Data_Sample 3
811 /*** Hook message structs ***/
813 struct MUIP_NListtree_CloseMessage
815 STACKED ULONG HookID;
816 STACKED struct MUI_NListtree_TreeNode *TreeNode;
820 struct MUIP_NListtree_CompareMessage
822 STACKED ULONG HookID;
823 STACKED struct MUI_NListtree_TreeNode *TreeNode1;
824 STACKED struct MUI_NListtree_TreeNode *TreeNode2;
825 STACKED LONG SortType;
829 struct MUIP_NListtree_ConstructMessage
831 STACKED ULONG HookID;
832 STACKED STRPTR Name;
833 STACKED APTR UserData;
834 STACKED APTR MemPool;
835 STACKED ULONG Flags;
839 struct MUIP_NListtree_DestructMessage
841 STACKED ULONG HookID;
842 STACKED STRPTR Name;
843 STACKED APTR UserData;
844 STACKED APTR MemPool;
845 STACKED ULONG Flags;
849 struct MUIP_NListtree_DisplayMessage
851 STACKED ULONG HookID;
852 STACKED struct MUI_NListtree_TreeNode *TreeNode;
853 STACKED LONG EntryPos;
854 STACKED STRPTR *Array;
855 STACKED STRPTR *Preparse;
859 struct MUIP_NListtree_CopyToClipMessage
861 STACKED ULONG HookID;
862 STACKED struct MUI_NListtree_TreeNode *TreeNode;
863 STACKED LONG Pos;
864 STACKED LONG Unit;
868 struct MUIP_NListtree_FindNameMessage
870 STACKED ULONG HookID;
871 STACKED STRPTR Name;
872 STACKED STRPTR NodeName;
873 STACKED APTR UserData;
874 STACKED ULONG Flags;
878 struct MUIP_NListtree_FindUserDataMessage
880 STACKED ULONG HookID;
881 STACKED APTR User;
882 STACKED APTR UserData;
883 STACKED STRPTR NodeName;
884 STACKED ULONG Flags;
888 struct MUIP_NListtree_OpenMessage
890 STACKED ULONG HookID;
891 STACKED struct MUI_NListtree_TreeNode *TreeNode;
895 struct MUIP_NListtree_MultiTestMessage
897 STACKED ULONG HookID;
898 STACKED struct MUI_NListtree_TreeNode *TreeNode;
899 STACKED LONG SelType;
900 STACKED LONG SelFlag;
901 STACKED LONG CurrType;
904 // ClipboardServer.c
905 BOOL StartClipboardServer(void);
906 void ShutdownClipboardServer(void);
907 LONG StringToClipboard(ULONG unit, STRPTR str);
909 #include "default-align.h"
911 // special flagging macros
912 #define isFlagSet(v,f) (((v) & (f)) == (f)) // return TRUE if the flag is set
913 #define hasFlag(v,f) (((v) & (f)) != 0) // return TRUE if one of the flags in f is set in v
914 #define isFlagClear(v,f) (((v) & (f)) == 0) // return TRUE if flag f is not set in v
915 #define SET_FLAG(v,f) ((v) |= (f)) // set the flag f in v
916 #define CLEAR_FLAG(v,f) ((v) &= ~(f)) // clear the flag f in v
917 #define MASK_FLAG(v,f) ((v) &= (f)) // mask the variable v with flag f bitwise
919 #if defined(__amigaos4__)
920 #define AllocVecShared(size, flags) AllocVecTags((size), AVT_Type, MEMF_SHARED, AVT_Lock, FALSE, ((flags)&MEMF_CLEAR) ? AVT_ClearWithValue : TAG_IGNORE, 0, TAG_DONE)
921 #else
922 #define AllocVecShared(size, flags) AllocVec((size), (flags))
923 #endif
925 #define LIBVER(lib) ((struct Library *)lib)->lib_Version
926 #define LIBREV(lib) ((struct Library *)lib)->lib_Revision
927 #define VERSION_IS_AT_LEAST(ver, rev, minver, minrev) (((ver) > (minver)) || ((ver) == (minver) && (rev) == (minrev)) || ((ver) == (minver) && (rev) > (minrev)))
928 #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)
930 #endif /* NLISTTREE_MCC_PRIVATE_H */