diff options
author | David Walter Seikel | 2012-01-23 23:30:42 +1000 |
---|---|---|
committer | David Walter Seikel | 2012-01-23 23:30:42 +1000 |
commit | 825a3d837a33f226c879cd02ad15c3fba57e8b2c (patch) | |
tree | 75f57bd9c4253508d338dc79ba8e57a7abc42255 /libraries/ecore/src/lib/ecore_x/xlib/ecore_x_error.c | |
parent | Add ability to disable the test harness, or the Lua compile test. (diff) | |
download | SledjHamr-825a3d837a33f226c879cd02ad15c3fba57e8b2c.zip SledjHamr-825a3d837a33f226c879cd02ad15c3fba57e8b2c.tar.gz SledjHamr-825a3d837a33f226c879cd02ad15c3fba57e8b2c.tar.bz2 SledjHamr-825a3d837a33f226c879cd02ad15c3fba57e8b2c.tar.xz |
Update the EFL to what I'm actually using, coz I'm using some stuff not yet released.
Diffstat (limited to 'libraries/ecore/src/lib/ecore_x/xlib/ecore_x_error.c')
-rw-r--r-- | libraries/ecore/src/lib/ecore_x/xlib/ecore_x_error.c | 36 |
1 files changed, 25 insertions, 11 deletions
diff --git a/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_error.c b/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_error.c index 837ff53..11e9f20 100644 --- a/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_error.c +++ b/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_error.c | |||
@@ -9,7 +9,7 @@ | |||
9 | #include "ecore_x_private.h" | 9 | #include "ecore_x_private.h" |
10 | #include "Ecore_X.h" | 10 | #include "Ecore_X.h" |
11 | 11 | ||
12 | static int _ecore_x_error_handle(Display *d, | 12 | static int _ecore_x_error_handle(Display *d, |
13 | XErrorEvent *ev); | 13 | XErrorEvent *ev); |
14 | static int _ecore_x_io_error_handle(Display *d); | 14 | static int _ecore_x_io_error_handle(Display *d); |
15 | 15 | ||
@@ -19,6 +19,7 @@ static void (*_io_error_func)(void *data) = NULL; | |||
19 | static void *_io_error_data = NULL; | 19 | static void *_io_error_data = NULL; |
20 | static int _error_request_code = 0; | 20 | static int _error_request_code = 0; |
21 | static int _error_code = 0; | 21 | static int _error_code = 0; |
22 | static Ecore_X_ID _error_resource_id = 0; | ||
22 | 23 | ||
23 | /** | 24 | /** |
24 | * Set the error handler. | 25 | * Set the error handler. |
@@ -28,12 +29,12 @@ static int _error_code = 0; | |||
28 | * Set the X error handler function | 29 | * Set the X error handler function |
29 | */ | 30 | */ |
30 | EAPI void | 31 | EAPI void |
31 | ecore_x_error_handler_set(void (*func)(void *data), | 32 | ecore_x_error_handler_set(void (*func)(void *data), |
32 | const void *data) | 33 | const void *data) |
33 | { | 34 | { |
34 | _error_func = func; | 35 | _error_func = func; |
35 | _error_data = (void *)data; | 36 | _error_data = (void *)data; |
36 | } /* ecore_x_error_handler_set */ | 37 | } |
37 | 38 | ||
38 | /** | 39 | /** |
39 | * Set the I/O error handler. | 40 | * Set the I/O error handler. |
@@ -43,12 +44,12 @@ ecore_x_error_handler_set(void (*func)(void *data), | |||
43 | * Set the X I/O error handler function | 44 | * Set the X I/O error handler function |
44 | */ | 45 | */ |
45 | EAPI void | 46 | EAPI void |
46 | ecore_x_io_error_handler_set(void (*func)(void *data), | 47 | ecore_x_io_error_handler_set(void (*func)(void *data), |
47 | const void *data) | 48 | const void *data) |
48 | { | 49 | { |
49 | _io_error_func = func; | 50 | _io_error_func = func; |
50 | _io_error_data = (void *)data; | 51 | _io_error_data = (void *)data; |
51 | } /* ecore_x_io_error_handler_set */ | 52 | } |
52 | 53 | ||
53 | /** | 54 | /** |
54 | * Get the request code that caused the error. | 55 | * Get the request code that caused the error. |
@@ -60,7 +61,7 @@ EAPI int | |||
60 | ecore_x_error_request_get(void) | 61 | ecore_x_error_request_get(void) |
61 | { | 62 | { |
62 | return _error_request_code; | 63 | return _error_request_code; |
63 | } /* ecore_x_error_request_get */ | 64 | } |
64 | 65 | ||
65 | /** | 66 | /** |
66 | * Get the error code from the error. | 67 | * Get the error code from the error. |
@@ -72,28 +73,41 @@ EAPI int | |||
72 | ecore_x_error_code_get(void) | 73 | ecore_x_error_code_get(void) |
73 | { | 74 | { |
74 | return _error_code; | 75 | return _error_code; |
75 | } /* ecore_x_error_code_get */ | 76 | } |
77 | |||
78 | /** | ||
79 | * Get the resource id that caused the error. | ||
80 | * @return The resource id causing the X error | ||
81 | * | ||
82 | * Return the X resource id that caused the last X error | ||
83 | */ | ||
84 | EAPI Ecore_X_ID | ||
85 | ecore_x_error_resource_id_get(void) | ||
86 | { | ||
87 | return _error_resource_id; | ||
88 | } | ||
76 | 89 | ||
77 | void | 90 | void |
78 | _ecore_x_error_handler_init(void) | 91 | _ecore_x_error_handler_init(void) |
79 | { | 92 | { |
80 | XSetErrorHandler((XErrorHandler)_ecore_x_error_handle); | 93 | XSetErrorHandler((XErrorHandler)_ecore_x_error_handle); |
81 | XSetIOErrorHandler((XIOErrorHandler)_ecore_x_io_error_handle); | 94 | XSetIOErrorHandler((XIOErrorHandler)_ecore_x_io_error_handle); |
82 | } /* _ecore_x_error_handler_init */ | 95 | } |
83 | 96 | ||
84 | static int | 97 | static int |
85 | _ecore_x_error_handle(Display *d, | 98 | _ecore_x_error_handle(Display *d, |
86 | XErrorEvent *ev) | 99 | XErrorEvent *ev) |
87 | { | 100 | { |
88 | if (d == _ecore_x_disp) | 101 | if (d == _ecore_x_disp) |
89 | { | 102 | { |
90 | _error_request_code = ev->request_code; | 103 | _error_request_code = ev->request_code; |
91 | _error_code = ev->error_code; | 104 | _error_code = ev->error_code; |
105 | _error_resource_id = ev->resourceid; | ||
92 | if (_error_func) | 106 | if (_error_func) |
93 | _error_func(_error_data); | 107 | _error_func(_error_data); |
94 | } | 108 | } |
95 | return 0; | 109 | return 0; |
96 | } /* _ecore_x_error_handle */ | 110 | } |
97 | 111 | ||
98 | static int | 112 | static int |
99 | _ecore_x_io_error_handle(Display *d) | 113 | _ecore_x_io_error_handle(Display *d) |
@@ -107,5 +121,5 @@ _ecore_x_io_error_handle(Display *d) | |||
107 | } | 121 | } |
108 | 122 | ||
109 | return 0; | 123 | return 0; |
110 | } /* _ecore_x_io_error_handle */ | 124 | } |
111 | 125 | ||