Include <X11/Xlib.h> even if USE_VIDMODE is
[tangerine.git] / rom / hyperlayers / installlayerhook.c
blob3c399290a09f656fb406a4b474cf90a0e357ef32
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc:
6 Lang: english
7 */
8 #include <aros/libcall.h>
9 #include <utility/hooks.h>
10 #include <proto/graphics.h>
12 #define DEBUG 0
13 #include <aros/debug.h>
14 #undef kprintf
16 /*****************************************************************************
18 NAME */
19 #include <proto/layers.h>
20 #include "layers_intern.h"
22 AROS_LH2(struct Hook *, InstallLayerHook,
24 /* SYNOPSIS */
25 AROS_LHA(struct Layer *, layer, A0),
26 AROS_LHA(struct Hook *, hook, A1),
28 /* LOCATION */
29 struct LayersBase *, LayersBase, 33, Layers)
31 /* FUNCTION
32 Safely install a new backfill hook. Return the old hook.
33 If hook is NULL, then the default backfill hook will be installed.
35 INPUTS
36 layer - layer that will get the new backfill hook
37 hook - pointer to backfill hook to be installed
39 RESULT
41 NOTES
43 EXAMPLE
45 BUGS
47 SEE ALSO
49 INTERNALS
51 HISTORY
52 27-11-96 digulla automatically created from
53 layers_lib.fd and clib/layers_protos.h
55 *****************************************************************************/
57 AROS_LIBFUNC_INIT
58 AROS_LIBBASE_EXT_DECL(struct LayersBase *,LayersBase)
60 struct Hook *OldHook;
62 D(bug("InstallLayerHook(layer @ $%lx, hook @ $%lx)\n", layer, hook));
64 if(layer == NULL)
65 return NULL;
67 LockLayer(0, layer);
69 OldHook = layer->BackFill;
71 layer->BackFill = hook;
73 UnlockLayer(layer);
75 return OldHook;
77 AROS_LIBFUNC_EXIT
78 } /* InstallLayerHook */