64-bit fix. Changed the user-supplied IDs used with
[AROS.git] / workbench / libs / workbench / updateworkbenchobjecta.c
blob815815b1efdd00c4fc804ecb5af8602d9ceb938e
1 /*
2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
3 $Id$
5 Inform the file manager that an object has changed.
6 */
8 #define DEBUG 1
9 #include <aros/debug.h>
11 #include <exec/types.h>
12 #include <exec/ports.h>
13 #include <utility/tagitem.h>
14 #include <intuition/intuition.h>
15 #include <workbench/workbench.h>
16 #include <proto/utility.h>
18 #include <string.h>
20 #include "workbench_intern.h"
21 #include "support.h"
22 #include "support_messages.h"
23 #include "handler.h"
24 #include "handler_support.h"
26 /*****************************************************************************
28 NAME */
30 #include <proto/workbench.h>
32 AROS_LH3(BOOL, UpdateWorkbenchObjectA,
34 /* SYNOPSIS */
35 AROS_LHA(STRPTR, name, A0),
36 AROS_LHA(LONG, type, D1),
37 AROS_LHA(struct TagItem *, tags, A1),
39 /* LOCATION */
40 struct WorkbenchBase *, WorkbenchBase, 25, Workbench)
42 /* FUNCTION
43 Informs the workbench application that an object has changed, and that
44 it should update it's visual representation.
46 INPUTS
47 name - Name of object that has changed.
48 type - Type of object (WBDISK, WBTOOL, ...).
49 tags - Additional options.
51 TAGS
52 No tags are defined at this time.
54 NOTES
55 This function is TEMPORARY! It will hopefully go away before AROS 1.0,
56 and it might change it's API several times before that!
58 EXAMPLE
60 BUGS
61 The existance of this function is a bug itself. It should be removed
62 once there is a adequate notification API in dos.library that works.
64 SEE ALSO
66 INTERNALS
68 ******************************************************************************/
70 AROS_LIBFUNC_INIT
72 BOOL success = FALSE;
73 struct WBCommandMessage *wbcm = NULL;
74 struct WBHandlerMessage *wbhm = NULL;
78 (wbcm = CreateWBCM(WBCM_TYPE_RELAY)) != NULL
79 && (wbhm = CreateWBHM(WBHM_TYPE_UPDATE)) != NULL
82 if ((wbhm->wbhm_Data.Update.Name = StrDup(name)) != NULL)
84 wbhm->wbhm_Data.Update.Type = type;
85 wbcm->wbcm_Data.Relay.Message = wbhm;
87 PutMsg(&WorkbenchBase->wb_HandlerPort, (struct Message *) wbcm);
89 success = TRUE;
93 if (!success)
95 if (wbcm != NULL) DestroyWBCM(wbcm);
96 if (wbhm != NULL) DestroyWBHM(wbhm);
99 return success;
101 AROS_LIBFUNC_EXIT
102 } /* UpdateWorkbenchObjectA() */