+static gint __comp_by_state(gconstpointer a, gconstpointer b)
+{
+ widget_context_s *wc = (widget_context_s *)a;
+
+ if (wc->state == (widget_obj_state_e)GPOINTER_TO_INT(b))
+ return 0;
+
+ return -1;
+}
+
+static widget_context_s *__find_context_by_state(widget_obj_state_e state)
+{
+ GList *ret;
+ GList *contexts = _widget_app_get_contexts();
+
+ ret = g_list_find_custom(contexts, GINT_TO_POINTER((int)state), __comp_by_state);
+ if (ret == NULL)
+ return NULL;
+
+ return ret->data;
+}
+