2004-06-01 23:09:25 +02:00
|
|
|
/************************************************************
|
|
|
|
|
|
|
|
Author: Eamon Walsh <ewalsh@epoch.ncsc.mil>
|
|
|
|
|
|
|
|
Permission to use, copy, modify, distribute, and sell this software and its
|
|
|
|
documentation for any purpose is hereby granted without fee, provided that
|
|
|
|
this permission notice appear in supporting documentation. This permission
|
|
|
|
notice shall be included in all copies or substantial portions of the
|
|
|
|
Software.
|
|
|
|
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
|
|
|
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
|
|
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
|
|
|
|
|
********************************************************/
|
|
|
|
|
|
|
|
#ifndef _XACE_H
|
|
|
|
#define _XACE_H
|
|
|
|
|
2006-12-02 02:48:15 +01:00
|
|
|
#ifdef XACE
|
|
|
|
|
2007-03-21 19:49:56 +01:00
|
|
|
#define XACE_MAJOR_VERSION 2
|
2004-06-01 23:09:25 +02:00
|
|
|
#define XACE_MINOR_VERSION 0
|
|
|
|
|
|
|
|
#include "pixmap.h" /* for DrawablePtr */
|
|
|
|
#include "regionstr.h" /* for RegionPtr */
|
|
|
|
|
2007-12-18 05:11:29 +01:00
|
|
|
/* Default window background */
|
|
|
|
#define XaceBackgroundNoneState None
|
|
|
|
|
2004-06-01 23:09:25 +02:00
|
|
|
/* security hooks */
|
|
|
|
/* Constants used to identify the available security hooks
|
|
|
|
*/
|
|
|
|
#define XACE_CORE_DISPATCH 0
|
|
|
|
#define XACE_EXT_DISPATCH 1
|
|
|
|
#define XACE_RESOURCE_ACCESS 2
|
|
|
|
#define XACE_DEVICE_ACCESS 3
|
|
|
|
#define XACE_PROPERTY_ACCESS 4
|
2007-09-28 21:04:33 +02:00
|
|
|
#define XACE_SEND_ACCESS 5
|
|
|
|
#define XACE_RECEIVE_ACCESS 6
|
|
|
|
#define XACE_CLIENT_ACCESS 7
|
|
|
|
#define XACE_EXT_ACCESS 8
|
|
|
|
#define XACE_SERVER_ACCESS 9
|
|
|
|
#define XACE_SELECTION_ACCESS 10
|
|
|
|
#define XACE_SCREEN_ACCESS 11
|
|
|
|
#define XACE_SCREENSAVER_ACCESS 12
|
|
|
|
#define XACE_AUTH_AVAIL 13
|
|
|
|
#define XACE_KEY_AVAIL 14
|
|
|
|
#define XACE_AUDIT_BEGIN 15
|
|
|
|
#define XACE_AUDIT_END 16
|
|
|
|
#define XACE_NUM_HOOKS 17
|
2004-06-01 23:09:25 +02:00
|
|
|
|
|
|
|
extern CallbackListPtr XaceHooks[XACE_NUM_HOOKS];
|
|
|
|
|
|
|
|
/* Entry point for hook functions. Called by Xserver.
|
|
|
|
*/
|
|
|
|
extern int XaceHook(
|
|
|
|
int /*hook*/,
|
|
|
|
... /*appropriate args for hook*/
|
|
|
|
);
|
|
|
|
|
2007-11-06 22:26:09 +01:00
|
|
|
/* Special-cased hook functions
|
|
|
|
*/
|
2008-01-25 23:28:17 +01:00
|
|
|
extern int XaceHookDispatch(ClientPtr ptr, int major);
|
2007-11-06 22:26:09 +01:00
|
|
|
extern void XaceHookAuditEnd(ClientPtr ptr, int result);
|
|
|
|
|
2006-08-03 20:26:06 +02:00
|
|
|
/* Register a callback for a given hook.
|
2004-06-01 23:09:25 +02:00
|
|
|
*/
|
|
|
|
#define XaceRegisterCallback(hook,callback,data) \
|
|
|
|
AddCallback(XaceHooks+(hook), callback, data)
|
|
|
|
|
|
|
|
/* Unregister an existing callback for a given hook.
|
|
|
|
*/
|
|
|
|
#define XaceDeleteCallback(hook,callback,data) \
|
|
|
|
DeleteCallback(XaceHooks+(hook), callback, data)
|
|
|
|
|
|
|
|
|
|
|
|
/* From the original Security extension...
|
|
|
|
*/
|
|
|
|
|
|
|
|
extern void XaceCensorImage(
|
|
|
|
ClientPtr client,
|
|
|
|
RegionPtr pVisibleRegion,
|
|
|
|
long widthBytesLine,
|
|
|
|
DrawablePtr pDraw,
|
|
|
|
int x, int y, int w, int h,
|
|
|
|
unsigned int format,
|
|
|
|
char * pBuf
|
|
|
|
);
|
|
|
|
|
2006-12-02 02:48:15 +01:00
|
|
|
#else /* XACE */
|
|
|
|
|
2007-12-18 05:11:29 +01:00
|
|
|
/* Default window background */
|
|
|
|
#define XaceBackgroundNoneState None
|
|
|
|
|
2006-12-02 02:48:15 +01:00
|
|
|
/* Define calls away when XACE is not being built. */
|
|
|
|
|
|
|
|
#ifdef __GNUC__
|
2007-04-17 22:01:56 +02:00
|
|
|
#define XaceHook(args...) Success
|
2008-01-25 23:28:17 +01:00
|
|
|
#define XaceHookDispatch(args...) Success
|
2007-11-06 22:26:09 +01:00
|
|
|
#define XaceHookAuditEnd(args...) { ; }
|
2006-12-02 02:48:15 +01:00
|
|
|
#define XaceCensorImage(args...) { ; }
|
|
|
|
#else
|
2007-04-17 22:01:56 +02:00
|
|
|
#define XaceHook(...) Success
|
2008-01-25 23:28:17 +01:00
|
|
|
#define XaceHookDispatch(...) Success
|
2007-11-06 22:26:09 +01:00
|
|
|
#define XaceHookAuditEnd(...) { ; }
|
2006-12-02 02:48:15 +01:00
|
|
|
#define XaceCensorImage(...) { ; }
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* XACE */
|
|
|
|
|
2004-06-01 23:09:25 +02:00
|
|
|
#endif /* _XACE_H */
|