Initial import of Scalos. To decrease size I have
[AROS-Contrib.git] / scalos / include / scalos / undo.h
bloba3f6b47acf76719d5cccdbeb9fcdc87b7860cbbb
1 #ifndef SCALOS_UNDO_H
2 #define SCALOS_UNDO_H
3 /*
4 ** $VER: undo.h 41.1 (23 Mar 2009 21:05:36)
5 **
6 ** scalosgfx.library include
7 **
8 ** (C) Copyright 2009 The Scalos Team
9 ** All Rights Reserved
12 #ifndef EXEC_TYPES_H
13 #include <exec/types.h>
14 #endif //EXEC_TYPES_H
16 #ifndef UTILITY_TAGITEM_H
17 #include <utility/tagitem.h>
18 #endif //UTILITY_TAGITEM_H
20 //----------------------------------------------------------------------------
22 enum ScalosUndoType
24 UNDO_Snapshot, // UNDOTAG_IconDirLock, UNDOTAG_SaveIcon, UNDOTAG_IconNode
25 UNDO_Unsnapshot, // UNDOTAG_IconDirLock, UNDOTAG_SaveIcon, UNDOTAG_IconNode
26 UNDO_Cleanup, // UNDOTAG_CleanupMode, UNDOTAG_WindowTask, UNDOTAG_IconList
27 UNDO_Copy, // UNDOTAG_CopySrcDirLock, UNDOTAG_CopyDestDirLock, UNDOTAG_CopySrcName, UNDOTAG_CopyDestName
28 UNDO_Move, // UNDOTAG_CopySrcDirLock, UNDOTAG_CopyDestDirLock, UNDOTAG_CopySrcName, UNDOTAG_CopyDestName
29 UNDO_CreateLink, // UNDOTAG_CopySrcDirLock, UNDOTAG_CopyDestDirLock, UNDOTAG_CopySrcName, UNDOTAG_CopyDestName
30 UNDO_ChangeIconPos, // UNDOTAG_IconDirLock, UNDOTAG_IconNode,
31 UNDO_Rename, // UNDOTAG_CopySrcDirLock, UNDOTAG_CopySrcName, UNDOTAG_CopyDestName
32 UNDO_Relabel, // UNDOTAG_CopySrcName, UNDOTAG_CopyDestName
33 UNDO_Delete, // UNDOTAG_CopySrcDirLock, UNDOTAG_CopySrcName, UNDOTAG_CopyDestName
34 UNDO_Leaveout, // UNDOTAG_IconDirLock, UNDOTAG_IconName
35 UNDO_PutAway, // UNDOTAG_IconDirLock, UNDOTAG_IconName
36 UNDO_NewDrawer, // UNDOTAG_IconDirLock, UNDOTAG_IconName, UNDOTAG_CreateIcon
37 UNDO_SizeWindow, // UNDOTAG_WindowTask, UNDOTAG_OldWindowLeft, UNDOTAG_OldWindowTop, UNDOTAG_OldWindowWidth, UNDOTAG_OldWindowHeight, UNDOTAG_OldWindowVirtX, UNDOTAG_OldWindowVirtY,UNDOTAG_NewWindowLeft,UNDOTAG_NewWindowTop,UNDOTAG_NewWindowWidth,UNDOTAG_NewWindowHeight,UNDOTAG_NewWindowVirtX,UNDOTAG_NewWindowVirtY
38 UNDO_SetProtection, // UNDOTAG_IconDirLock, UNDOTAG_IconName, UNDOTAG_OldProtection, UNDOTAG_NewProtection
39 UNDO_SetComment, // UNDOTAG_IconDirLock, UNDOTAG_IconName, UNDOTAG_OldComment, UNDOTAG_NewComment
40 UNDO_SetToolTypes, // UNDOTAG_IconDirLock, UNDOTAG_IconName, UNDOTAG_OldToolTypes, UNDOTAG_NewToolTypes
41 UNDO_ChangeIconObject, // UNDOTAG_IconDirLock, UNDOTAG_IconName, UNDOTAG_OldIconObject, UNDOTAG_NewIconObject
42 UNDO_CloseWindow, // UNDOTAG_WindowTask
45 enum ScalosUndoTags
47 UNDOTAG_UndoMultiStep = (int) (TAG_USER + 1287),
48 UNDOTAG_IconNode, // struct ScaIconNode *
49 UNDOTAG_IconList, // struct ScaIconNode *
50 UNDOTAG_IconDirLock, // BPTR
51 UNDOTAG_CopySrcDirLock, // BPTR
52 UNDOTAG_CopyDestDirLock, // BPTR
53 UNDOTAG_CopySrcName, // CONST_STRPTR
54 UNDOTAG_CopyDestName, // CONST_STRPTR
55 UNDOTAG_IconPosX, // LONG
56 UNDOTAG_IconPosY, // LONG
57 UNDOTAG_OldIconPosX, // LONG
58 UNDOTAG_OldIconPosY, // LONG
59 UNDOTAG_WindowTask, // struct internalScaWindowTask *
60 UNDOTAG_CleanupMode, // ULONG
61 UNDOTAG_UndoHook, // struct Hook *
62 UNDOTAG_RedoHook, // struct Hook *
63 UNDOTAG_DisposeHook, // struct Hook *
64 UNDOTAG_SaveIcon, // ULONG
65 UNDOTAG_CustomAddHook, // struct Hook *
66 UNDOTAG_WbArg, // struct WBArg *
67 UNDOTAG_OldWindowLeft, // LONG
68 UNDOTAG_OldWindowTop, // LONG
69 UNDOTAG_OldWindowWidth, // ULONG
70 UNDOTAG_OldWindowHeight, // ULONG
71 UNDOTAG_NewWindowLeft, // LONG
72 UNDOTAG_NewWindowTop, // LONG
73 UNDOTAG_NewWindowWidth, // ULONG
74 UNDOTAG_NewWindowHeight, // ULONG
75 UNDOTAG_OldWindowVirtX, // LONG
76 UNDOTAG_OldWindowVirtY, // LONG
77 UNDOTAG_NewWindowVirtX, // LONG
78 UNDOTAG_NewWindowVirtY, // LONG
79 UNDOTAG_CreateIcon, // LONG
80 UNDOTAG_IconName, // CONST_STRPTR
81 UNDOTAG_OldProtection, // ULONG
82 UNDOTAG_NewProtection, // ULONG
83 UNDOTAG_OldComment, // CONST_STRPTR
84 UNDOTAG_NewComment, // CONST_STRPTR
85 UNDOTAG_OldToolTypes, // const STRPTR *
86 UNDOTAG_NewToolTypes, // const STRPTR *
87 UNDOTAG_OldIconObject, // Object *
88 UNDOTAG_NewIconObject, // Object *
91 enum ScalosUndoCleanupMode
93 CLEANUP_Default,
94 CLEANUP_ByName,
95 CLEANUP_ByDate,
96 CLEANUP_BySize,
97 CLEANUP_ByType,
100 struct UndoCleanupIconEntry
102 const struct ScaIconNode *ucin_IconNode;
103 LONG ucin_Left; // original x position of icon
104 LONG ucin_Top; // original y position of icon
107 struct UndoEvent
109 struct Node uev_Node;
110 enum ScalosUndoType uev_Type;
112 struct Hook *uev_UndoHook;
113 struct Hook *uev_RedoHook;
114 struct Hook *uev_DisposeHook;
115 struct Hook *uev_CustomAddHook;
117 LONG uev_OldPosX;
118 LONG uev_OldPosY;
119 LONG uev_NewPosX;
120 LONG uev_NewPosY;
122 union UndoEventData
124 APTR uev_PrivateData;
125 struct UndoCopyMoveEventData
127 // we do not keep Locks to src/dest directories here since it wouldn't be nice to block rename/delete of referenced objects!
128 STRPTR ucmed_srcDirName;
129 STRPTR ucmed_destDirName;
130 STRPTR ucmed_srcName;
131 STRPTR ucmed_destName;
132 } uev_CopyMoveData;
133 struct UndoNewDrawerData
135 // we do not keep Locks to src directory here since it wouldn't be nice to block rename/delete of referenced objects!
136 STRPTR und_DirName;
137 STRPTR und_srcName;
138 BOOL und_CreateIcon;
139 } uev_NewDrawerData;
140 struct UndoIconEventData
142 // we do not keep Locks to icon directory here since it wouldn't be nice to block rename/delete of referenced objects!
143 STRPTR uid_DirName;
144 STRPTR uid_IconName;
145 } uev_IconData;
146 struct UndoCleanupData
148 enum ScalosUndoCleanupMode ucd_CleanupMode;
149 struct UndoCleanupIconEntry *ucd_Icons;
150 ULONG ucd_IconCount; // number of entries in ucd_Icons
151 struct ScaWindowTask *ucd_WindowTask;
152 STRPTR ucd_WindowTitle; // a copy of the window title of ucd_WindowTask
153 } uev_CleanupData;
154 struct UndoSnaphotIconData
156 STRPTR usid_DirName;
157 STRPTR usid_IconName;
158 Object *usid_IconObj; // Iconobject BEFORE snapshot/unsnaphot
159 ULONG usid_SaveIcon;
160 } uev_SnapshotData;
161 struct UndoSizeWindowData
163 struct ScaWindowTask *uswd_WindowTask;
164 STRPTR uswd_WindowTitle; // a copy of the window title of ucd_WindowTask
165 LONG uswd_OldLeft;
166 LONG uswd_OldTop;
167 ULONG uswd_OldWidth;
168 ULONG uswd_OldHeight;
169 LONG uswd_NewLeft;
170 LONG uswd_NewTop;
171 ULONG uswd_NewWidth;
172 ULONG uswd_NewHeight;
173 LONG uswd_OldVirtX;
174 LONG uswd_OldVirtY;
175 LONG uswd_NewVirtX;
176 LONG uswd_NewVirtY;
177 } uev_SizeWindowData;
178 struct UndoSetProtectionData
180 STRPTR uspd_DirName;
181 STRPTR uspd_IconName;
182 ULONG uspd_OldProtection;
183 ULONG uspd_NewProtection;
184 } uev_SetProtectionData;
185 struct UndoSetCommentData
187 STRPTR uscd_DirName;
188 STRPTR uscd_IconName;
189 STRPTR uscd_OldComment;
190 STRPTR uscd_NewComment;
191 } uev_SetCommentData;
192 struct UndoSetToolTypesData
194 STRPTR ustd_DirName;
195 STRPTR ustd_IconName;
196 STRPTR *ustd_OldToolTypes;
197 STRPTR *ustd_NewToolTypes;
198 } uev_SetToolTypesData;
199 struct UndoChangeIconObjectData
201 STRPTR uciod_DirName;
202 STRPTR uciod_IconName;
203 Object *uciod_OldIconObject;
204 Object *uciod_NewIconObject;
205 } uev_ChangeIconObjectData;
206 struct UndoCloseWindowData
208 STRPTR ucwd_DirName;
209 STRPTR ucwd_WindowTitle;
210 LONG ucwd_Left;
211 LONG ucwd_Top;
212 ULONG ucwd_Width;
213 ULONG ucwd_Height;
214 LONG ucwd_VirtX;
215 LONG ucwd_VirtY;
216 UWORD ucwd_ViewAll;
217 UBYTE ucwd_Viewmodes;
218 } uev_CloseWindowData;
219 } uev_Data;
221 struct UndoStep *uev_UndoStep;
223 ULONG uev_DescrMsgIDSingle;
224 ULONG uev_DescrMsgIDMultiple;
225 STRPTR *uev_DescrObjName;
228 /*----------------------------------------------------------------------------------*/
230 #endif /* SCALOS_UNDO_H */