revert between 56095 -> 55830 in arch
[AROS.git] / rom / graphics / setdisplaydrivercallback.c
blob6d7f75488f6979dfedc23c0bb1ffd00e3d2c4df0
1 /*
2 Copyright © 2010, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Set display driver notification callback
6 Lang: english
7 */
9 #include <aros/debug.h>
10 #include <graphics/driver.h>
11 #include <oop/oop.h>
12 #include <proto/utility.h>
14 #include "graphics_intern.h"
16 /*****************************************************************************
18 NAME */
19 #include <proto/graphics.h>
21 AROS_LH2(void, SetDisplayDriverCallback,
23 /* SYNOPSIS */
24 AROS_LHA(APTR, callback, A0),
25 AROS_LHA(APTR, userdata, A1),
27 /* LOCATION */
28 struct GfxBase *, GfxBase, 108, Graphics)
30 /* FUNCTION
31 Specify a display driver notification callback.
33 The callback function is called using "C" calling convention and its
34 declaration should have a form:
36 APTR DriverNotify(APTR object, BOOL add, APTR userdata);
38 The function will be called upon display driver insertion and removal.
39 Upon insertion the parameters will be the following:
40 object - A pointer to a struct MonitorHandle for the new driver
41 add - TRUE, indicates driver insertion
42 userdata - User data originally passed to SetDisplayDriverCallback()
43 The function should return a pointer to opaque data object which will
44 be stored in the display driver handle structure.
46 Upon driver removal the parameters mean:
47 object - A pointer to opaque object returned by the callback when
48 the driver was added.
49 add - FALSE, indicates driver removal.
50 userdata - User data originally passed to SetDisplayDriverCallback()
51 Callback return value is ignored in removal mode.
53 INPUTS
54 callback - A pointer to a function to call.
55 userdata - User-defined data, will be passed to the callback function
57 RESULT
58 None.
60 NOTES
61 This function is private to AROS. Do not use it in any end-user software,
62 the specification may change at any moment.
64 EXAMPLE
66 BUGS
68 SEE ALSO
69 AddDisplayDriverA()
71 INTERNALS
73 HISTORY
75 *****************************************************************************/
77 AROS_LIBFUNC_INIT
79 CDD(GfxBase)->DriverNotify = callback;
80 CDD(GfxBase)->notify_data = userdata;
82 AROS_LIBFUNC_EXIT