64-bit fix. Changed the user-supplied IDs used with
[AROS.git] / workbench / libs / workbench / workbench_intern.h
blob20bbc83d35a9177ed710dc161ab5377b42c915dc
1 #ifndef __WORKBENCH_INTERN_H__
2 #define __WORKBENCH_INTERN_H__
4 /*
5 Copyright 1995-2012, The AROS Development Team. All rights reserved.
6 $Id$
8 Internal header file for workbench.library.
9 */
11 #include <exec/types.h>
12 #include <exec/nodes.h>
13 #include <exec/lists.h>
14 #include <exec/semaphores.h>
15 #include <exec/memory.h>
16 #include <exec/libraries.h>
17 #include <exec/execbase.h>
18 #include <dos/dos.h>
19 #include <dos/dostags.h>
20 #include <utility/utility.h>
21 #include <intuition/intuition.h>
23 #include <workbench/icon.h>
24 #include <workbench/workbench.h>
25 #include <workbench/startup.h>
26 #include <workbench/handler.h>
28 #include <proto/intuition.h>
29 #include <proto/exec.h>
30 #include <proto/dos.h>
31 #include <proto/icon.h>
34 This is the WorkbenchBase structure. It is defined here because it is
35 completely private. Applications should treat it as a struct Library, and
36 use the workbench.library functions to get information.
39 struct WorkbenchBase
41 struct Library LibNode;
43 struct MsgPort wb_HandlerPort; /* The handler's message port */
44 struct MsgPort *wb_WorkbenchPort; /* The workbench application's message port */
45 struct SignalSemaphore wb_WorkbenchPortSemaphore; /* Arbitrates initializetion access to the port above */
47 struct List wb_AppWindows;
48 struct List wb_AppIcons;
49 struct List wb_AppMenuItems;
51 BPTR wb_SearchPath;
52 struct List wb_HiddenDevices; /* List of devices that Workbench will not show */
53 ULONG wb_DefaultStackSize;
54 ULONG wb_TypeRestartTime;
56 struct SignalSemaphore wb_InitializationSemaphore; /* Arbitrates library initialization */
57 struct SignalSemaphore wb_BaseSemaphore; /* Arbitrates library base access */
59 BOOL wb_Initialized; /* Has the library been intialized in libOpen? */
60 BOOL wb_WBStarted; /* StartWorkbench() started WB? */
62 /* TO BE REMOVED AFTER ABIv1 STABILIZATION */
63 struct Library *wb_UtilityBase;
64 struct Library *wb_DOSBase;
65 struct Library *wb_IntuitionBase;
66 struct Library *wb_IconBase;
69 #define LB(lb) ((struct WorkbenchBase *) (lb))
71 #define LockWorkbench() ObtainSemaphore(&(LB(WorkbenchBase)->wb_BaseSemaphore))
72 #define LockWorkbenchShared() ObtainSemaphoreShared(&(LB(WorkbenchBase)->wb_BaseSemaphore))
73 #define UnlockWorkbench() ReleaseSemaphore(&(LB(WorkbenchBase)->wb_BaseSemaphore))
75 /* TO BE REMOVED AFTER ABIv1 STABILIZATION */
76 #define UtilityBase (LB(WorkbenchBase)->wb_UtilityBase)
77 #define DOSBase (LB(WorkbenchBase)->wb_DOSBase)
78 #define IntuitionBase (LB(WorkbenchBase)->wb_IntuitionBase)
79 #define IconBase (LB(WorkbenchBase)->wb_IconBase)
82 * Definition of internal structures.
85 struct AppIcon
87 struct MinNode ai_Node;
88 UWORD ai_AppID;
89 UWORD ai_Type;
91 IPTR ai_ID;
92 IPTR ai_UserData;
94 struct MsgPort *ai_MsgPort;
96 struct DiskObject *ai_DiskObject;
98 APTR ai_Dummy[3]; // Scalos has some private fields after the object
100 // don't change above elements to keep compatibility with Scalos
102 ULONG ai_Flags;
103 CONST_STRPTR ai_Text;
105 struct Hook *ai_RenderHook;
108 /* Valid values for ai_Flags. These correspond to the tag items
109 * in <workbench/workbench.h>. */
111 #define WBAPPICONF_SupportsOpen (1<<1)
112 #define WBAPPICONF_SupportsCopy (1<<2)
113 #define WBAPPICONF_SupportsRename (1<<3)
114 #define WBAPPICONF_SupportsInformation (1<<4)
115 #define WBAPPICONF_SupportsSnapshot (1<<5)
116 #define WBAPPICONF_SupportsUnSnapshot (1<<6)
117 #define WBAPPICONF_SupportsLeaveOut (1<<7)
118 #define WBAPPICONF_SupportsPutAway (1<<8)
119 #define WBAPPICONF_SupportsDelete (1<<9)
120 #define WBAPPICONF_SupportsFormatDisk (1<<10)
121 #define WBAPPICONF_SupportsEmptyTrash (1<<11)
122 #define WBAPPICONF_PropagatePosition (1<<12)
123 #define WBAPPICONF_NotifySelectState (1<<13)
125 struct AppWindow
127 struct MinNode aw_Node;
128 UWORD aw_AppID;
129 UWORD aw_Type;
131 IPTR aw_ID;
132 IPTR aw_UserData;
134 struct MsgPort *aw_MsgPort;
136 struct Window *aw_Window;
138 APTR aw_Dummy[3]; // Scalos has some private fields after the object
140 // don't change above elements to keep compatibility with Scalos
142 struct List aw_DropZones; // List of AppWindowDropZones for this AppWindow.
145 #define AWDZFlag_fix 0 /* IBox value is actual coordinate */
146 #define AWDZFlag_relLeft 1
147 #define AWDZFlag_relRight 2
148 #define AWDZFlag_relTop 3
149 #define AWDZFlag_relBottom 4
150 #define AWDZFlag_relWidth 5
151 #define AWDZFlag_relHeight 6
154 struct AppWindowDropZone
156 struct Node awdz_Node;
158 IPTR awdz_ID;
159 IPTR awdz_UserData;
161 struct IBox awdz_Box;
163 /* These four tells how to compute the drop zone size and position */
164 UWORD awdz_leftSpecifier;
165 UWORD awdz_topSpecifier;
166 UWORD awdz_widthSpecifier;
167 UWORD awdz_heightSpecifier;
168 struct Hook *awdz_Hook;
171 struct AppMenuItem
173 struct MinNode aw_Node;
174 UWORD aw_AppID;
175 UWORD aw_Type;
177 IPTR ami_ID;
178 IPTR ami_UserData;
180 struct MsgPort *ami_MsgPort;
182 STRPTR ami_Text;
184 APTR ami_Dummy[3]; // Scalos has some private fields after the object
186 // don't change above elements to keep compatibility with Scalos
188 STRPTR ami_CommandKey;
191 /* Internal WBHM structure, used to hold data which the user doesn't
192 have to know about. */
193 struct IntWBHandlerMessage
195 struct WBHandlerMessage iwbhm_wbhm;
196 union
198 struct
200 struct IntuiMessage *imsg;
201 } Hide;
202 } iwbhm_Data;
204 #endif /* __WORKBENCH_INTERN_H__ */