Subject: [E-devel] [Patch] Add ecore_x API for error handling
I added ecore_x_error_resource_id_get() api. It returns the resource
id that caused the last X error. I think it will be useful for handling
X error.
git-svn-id: http://svn.enlightenment.org/svn/e/trunk/ecore@66136
7cbeb6ba-43b4-40fd-8cce-
4c39aea84d33
Kim Yunhan <spbear@gmail.com>
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
Bluezery <ohpowel@gmail.com>
+Doyoun Kang <wayofmine@gmail.com> <doyoun.kang@samsung.com>
the same as timers and mark them as "just added" to skip in
this run of animators
+2011-12-13 Doyun Kang
+
+ * Add ability to get resource id of last x error in ecore_x.
+
ecore_x_error_request_get(void);
EAPI int
ecore_x_error_code_get(void);
+EAPI Ecore_X_ID
+ecore_x_error_resource_id_get(void);
EAPI void
ecore_x_event_mask_set(Ecore_X_Window w,
static void *_io_error_data = NULL;
static int _error_request_code = 0;
static int _error_code = 0;
+static Ecore_X_ID _error_resource_id = 0;
/**
* Set the error handler.
return _error_code;
}
+/**
+ * Get the resource id that caused the error.
+ * @return The resource id causing the X error
+ *
+ * Return the X resource id that caused the last X error
+ */
+EAPI Ecore_X_ID
+ecore_x_error_resource_id_get(void)
+{
+ return _error_resource_id;
+}
+
int
_ecore_xcb_error_handle(xcb_generic_error_t *err)
{
_error_request_code = err->sequence;
_error_code = err->error_code;
+ _error_resource_id = err->resource_id;
if (_error_func)
_error_func(_error_data);
static void *_io_error_data = NULL;
static int _error_request_code = 0;
static int _error_code = 0;
+static Ecore_X_ID _error_resource_id = 0;
/**
* Set the error handler.
return _error_code;
}
+/**
+ * Get the resource id that caused the error.
+ * @return The resource id causing the X error
+ *
+ * Return the X resource id that caused the last X error
+ */
+EAPI Ecore_X_ID
+ecore_x_error_resource_id_get(void)
+{
+ return _error_resource_id;
+}
+
void
_ecore_x_error_handler_init(void)
{
{
_error_request_code = ev->request_code;
_error_code = ev->error_code;
+ _error_resource_id = ev->resourceid;
if (_error_func)
_error_func(_error_data);
}