Tizen 2.1 base
[adaptation/xorg/driver/xserver-xorg-video-emulfb.git] / src / debug / fbdev_event_trace.c
1 /**************************************************************************
2
3 xserver-xorg-video-emulfb
4
5 Copyright 2010 - 2011 Samsung Electronics co., Ltd. All Rights Reserved.
6
7 Contact: SooChan Lim <sc1.lim@samsung.com>
8
9 Permission is hereby granted, free of charge, to any person obtaining a
10 copy of this software and associated documentation files (the
11 "Software"), to deal in the Software without restriction, including
12 without limitation the rights to use, copy, modify, merge, publish,
13 distribute, sub license, and/or sell copies of the Software, and to
14 permit persons to whom the Software is furnished to do so, subject to
15 the following conditions:
16
17 The above copyright notice and this permission notice (including the
18 next paragraph) shall be included in all copies or substantial portions
19 of the Software.
20
21 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
22 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
23 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
24 IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
25 ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
26 TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
27 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28
29 **************************************************************************/
30
31 #include "fbdev.h"
32 #include "xace.h"
33 #include "xacestr.h"
34
35 #if 0
36 #include <stdio.h>
37 #include <string.h>
38 #include <strings.h>
39
40 #include <sys/types.h>
41 #include <sys/fcntl.h>
42 #include <unistd.h>
43 #include <stdarg.h>
44 #include <fcntl.h>
45 #include <unistd.h>
46
47 #include <X11/Xatom.h>
48 #include <X11/extensions/XI2proto.h>
49
50 #include "windowstr.h"
51
52 #define XREGISTRY
53 #include "registry.h"
54
55 #define __USE_GNU
56 #include <sys/socket.h>
57 #include <linux/socket.h>
58
59 #ifdef HAS_GETPEERUCRED
60 # include <ucred.h>
61 #endif
62 #endif
63
64 static void
65 _traceReceive (CallbackListPtr *pcbl, pointer unused, pointer calldata)
66 {
67     XaceReceiveAccessRec *rec = calldata;
68
69     if (rec->events->u.u.type != VisibilityNotify)
70         return;
71
72     rec->status = BadAccess;
73 }
74
75 Bool
76 fbdevTraceInstallHooks (void)
77 {
78     int ret = TRUE;
79
80     /*Disable Visibility Event*/
81     ret &= XaceRegisterCallback (XACE_RECEIVE_ACCESS, _traceReceive, NULL);
82
83     if (!ret)
84     {
85         ErrorF ("fbdevInstallHooks: Failed to register one or more callbacks\n");
86         return BadAlloc;
87     }
88
89     return Success;
90 }
91
92
93 Bool
94 fbdevTraceUninstallHooks (void)
95 {
96     XaceDeleteCallback (XACE_RECEIVE_ACCESS, _traceReceive, NULL);
97
98     return Success;
99 }
100