VirtualBox

source: vbox/trunk/src/VBox/Additions/x11/x11include/xorg-server-1.14.0/xace.h

最後變更 在這個檔案是 45134,由 vboxsync 提交於 12 年 前

Additions/X11: build vboxvideo_drv.so for X.Org Server 1.14.

  • 屬性 svn:eol-style 設為 native
檔案大小: 4.2 KB
 
1/************************************************************
2
3Author: Eamon Walsh <[email protected]>
4
5Permission to use, copy, modify, distribute, and sell this software and its
6documentation for any purpose is hereby granted without fee, provided that
7this permission notice appear in supporting documentation. This permission
8notice shall be included in all copies or substantial portions of the
9Software.
10
11THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
14AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
15AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
16CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
17
18********************************************************/
19
20#ifndef _XACE_H
21#define _XACE_H
22
23#ifdef XACE
24
25#define XACE_MAJOR_VERSION 2
26#define XACE_MINOR_VERSION 0
27
28#include "pixmap.h"
29#include "region.h"
30#include "window.h"
31#include "property.h"
32#include "selection.h"
33
34/* Default window background */
35#define XaceBackgroundNoneState(w) ((w)->forcedBG ? BackgroundPixel : None)
36
37/* security hooks */
38/* Constants used to identify the available security hooks
39 */
40#define XACE_CORE_DISPATCH 0
41#define XACE_EXT_DISPATCH 1
42#define XACE_RESOURCE_ACCESS 2
43#define XACE_DEVICE_ACCESS 3
44#define XACE_PROPERTY_ACCESS 4
45#define XACE_SEND_ACCESS 5
46#define XACE_RECEIVE_ACCESS 6
47#define XACE_CLIENT_ACCESS 7
48#define XACE_EXT_ACCESS 8
49#define XACE_SERVER_ACCESS 9
50#define XACE_SELECTION_ACCESS 10
51#define XACE_SCREEN_ACCESS 11
52#define XACE_SCREENSAVER_ACCESS 12
53#define XACE_AUTH_AVAIL 13
54#define XACE_KEY_AVAIL 14
55#define XACE_AUDIT_BEGIN 15
56#define XACE_AUDIT_END 16
57#define XACE_NUM_HOOKS 17
58
59extern _X_EXPORT CallbackListPtr XaceHooks[XACE_NUM_HOOKS];
60
61/* Entry point for hook functions. Called by Xserver.
62 * Required by libdbe and libextmod
63 */
64extern _X_EXPORT int XaceHook(int /*hook */ ,
65 ... /*appropriate args for hook */
66 );
67
68/* Special-cased hook functions
69 */
70extern _X_EXPORT int XaceHookDispatch(ClientPtr ptr, int major);
71extern _X_EXPORT int XaceHookPropertyAccess(ClientPtr ptr, WindowPtr pWin,
72 PropertyPtr *ppProp,
73 Mask access_mode);
74extern _X_EXPORT int XaceHookSelectionAccess(ClientPtr ptr, Selection ** ppSel,
75 Mask access_mode);
76extern _X_EXPORT void XaceHookAuditEnd(ClientPtr ptr, int result);
77
78/* Register a callback for a given hook.
79 */
80#define XaceRegisterCallback(hook,callback,data) \
81 AddCallback(XaceHooks+(hook), callback, data)
82
83/* Unregister an existing callback for a given hook.
84 */
85#define XaceDeleteCallback(hook,callback,data) \
86 DeleteCallback(XaceHooks+(hook), callback, data)
87
88/* XTrans wrappers for use by security modules
89 */
90extern _X_EXPORT int XaceGetConnectionNumber(ClientPtr ptr);
91extern _X_EXPORT int XaceIsLocal(ClientPtr ptr);
92
93/* From the original Security extension...
94 */
95
96extern _X_EXPORT void XaceCensorImage(ClientPtr client,
97 RegionPtr pVisibleRegion,
98 long widthBytesLine,
99 DrawablePtr pDraw,
100 int x, int y, int w, int h,
101 unsigned int format, char *pBuf);
102
103#else /* XACE */
104
105/* Default window background */
106#define XaceBackgroundNoneState(w) None
107
108/* Define calls away when XACE is not being built. */
109
110#ifdef __GNUC__
111#define XaceHook(args...) Success
112#define XaceHookDispatch(args...) Success
113#define XaceHookPropertyAccess(args...) Success
114#define XaceHookSelectionAccess(args...) Success
115#define XaceHookAuditEnd(args...) { ; }
116#define XaceCensorImage(args...) { ; }
117#else
118#define XaceHook(...) Success
119#define XaceHookDispatch(...) Success
120#define XaceHookPropertyAccess(...) Success
121#define XaceHookSelectionAccess(...) Success
122#define XaceHookAuditEnd(...) { ; }
123#define XaceCensorImage(...) { ; }
124#endif
125
126#endif /* XACE */
127
128#endif /* _XACE_H */
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette