EAPI void ecore_x_killall(Ecore_X_Window root);
EAPI void ecore_x_kill(Ecore_X_Window win);
EAPI int ecore_x_dpi_get(void);
+EAPI Eina_Bool ecore_x_bell(int percent);
EAPI Ecore_X_Time ecore_x_current_time_get(void);
}
/**
+ * TODO: Invoke the standard system beep to alert users
+ */
+EAPI Eina_Bool
+ecore_x_bell(int percent)
+{
+ return 0;
+}
+
+/**
* Return the last event time
*/
EAPI Ecore_X_Time
return (((s->width * 254) / s->mwidth) + 5) / 10;
}
+/**
+ * Invoke the standard system beep to alert users
+ *
+ * @param percent The volume at which the bell rings. Must be in the range
+ * [-100,+100]. If percent >= 0, the final volume will be:
+ * base - [(base * percent) / 100] + percent
+ * Otherwise, it's calculated as:
+ * base + [(base * percent) / 100]
+ * where @c base is the bell's base volume as set by XChangeKeyboardControl(3).
+ *
+ * @returns EINA_TRUE on success, EINA_FALSE otherwise.
+ */
+EAPI Eina_Bool
+ecore_x_bell(int percent)
+{
+ int ret;
+
+ ret = XBell(_ecore_x_disp, percent);
+ if (ret == BadValue)
+ return EINA_FALSE;
+
+ return EINA_TRUE;
+}
+
static Eina_Bool
_ecore_x_fd_handler(void *data, Ecore_Fd_Handler *fd_handler __UNUSED__)
{
$(top_builddir)/src/lib/ecore/libecore.la \
$(top_builddir)/src/lib/ecore_con/libecore_con.la
+if BUILD_ECORE_X
+ecore_suite_LDADD += \
+$(top_builddir)/src/lib/ecore_x/libecore_x.la
+endif
+
endif
EXTRA_DIST = ecore_suite.h
# include <config.h>
#endif
+#include "ecore_suite.h"
+
#include <Ecore.h>
#include <Eina.h>
#include <unistd.h>
-
-#include "ecore_suite.h"
-
+#include <stdio.h>
static int _log_dom;
#define INF(...) EINA_LOG_DOM_INFO(_log_dom, __VA_ARGS__)
}
END_TEST
+/* TODO: change to HAVE_ECORE_X when xcb implementation is done */
+#ifdef HAVE_ECORE_X_XLIB
+
+START_TEST(ecore_test_ecore_x_bell)
+{
+ int ret = 0, i;
+ ecore_x_init(NULL);
+
+ printf("You should hear 3 beeps now.\n");
+ for (i=0; i < 3; i++)
+ {
+ ret = ecore_x_bell(0);
+ fail_if(ret != EINA_TRUE);
+ ecore_x_sync();
+ sleep(1);
+ }
+ ecore_x_shutdown();
+}
+END_TEST
+
+#endif
+
void ecore_test_ecore(TCase *tc)
{
tcase_add_test(tc, ecore_test_ecore_init);
tcase_add_test(tc, ecore_test_ecore_main_loop_event);
tcase_add_test(tc, ecore_test_ecore_main_loop_timer_inner);
tcase_add_test(tc, ecore_test_ecore_main_loop_event_recursive);
+
+/* TODO: change to HAVE_ECORE_X when xcb implementation is done */
+#ifdef HAVE_ECORE_X_XLIB
+ tcase_add_test(tc, ecore_test_ecore_x_bell);
+#endif
}