2014-06-10 19:07:15 -07:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include "elementary_config.h"
|
|
|
|
#endif
|
|
|
|
|
2018-04-03 04:27:30 -07:00
|
|
|
#define EFL_ACCESS_OBJECT_BETA
|
2014-06-10 19:07:15 -07:00
|
|
|
#include <Elementary.h>
|
|
|
|
#include "elm_suite.h"
|
|
|
|
|
2019-01-28 10:42:56 -08:00
|
|
|
EFL_START_TEST(elm_bubble_legacy_type_check)
|
2018-02-14 12:04:24 -08:00
|
|
|
{
|
|
|
|
Evas_Object *win, *bubble;
|
|
|
|
const char *type;
|
|
|
|
|
2018-04-27 05:59:04 -07:00
|
|
|
win = win_add(NULL, "bubble", ELM_WIN_BASIC);
|
2018-02-14 12:04:24 -08:00
|
|
|
|
|
|
|
bubble = elm_bubble_add(win);
|
|
|
|
|
|
|
|
type = elm_object_widget_type_get(bubble);
|
|
|
|
ck_assert(type != NULL);
|
|
|
|
ck_assert(!strcmp(type, "Elm_Bubble"));
|
|
|
|
|
|
|
|
type = evas_object_type_get(bubble);
|
|
|
|
ck_assert(type != NULL);
|
|
|
|
ck_assert(!strcmp(type, "elm_bubble"));
|
|
|
|
|
|
|
|
}
|
2018-03-26 11:19:28 -07:00
|
|
|
EFL_END_TEST
|
2018-02-14 12:04:24 -08:00
|
|
|
|
2019-01-28 10:42:56 -08:00
|
|
|
EFL_START_TEST(elm_atspi_role_get)
|
2014-06-10 19:07:15 -07:00
|
|
|
{
|
|
|
|
Evas_Object *win, *bubble;
|
2017-10-18 18:13:54 -07:00
|
|
|
Efl_Access_Role role;
|
2014-06-10 19:07:15 -07:00
|
|
|
|
2018-04-27 05:59:04 -07:00
|
|
|
win = win_add(NULL, "bubble", ELM_WIN_BASIC);
|
2014-06-10 19:07:15 -07:00
|
|
|
|
|
|
|
bubble = elm_bubble_add(win);
|
2018-04-03 04:27:30 -07:00
|
|
|
role = efl_access_object_role_get(bubble);
|
2014-06-10 19:07:15 -07:00
|
|
|
|
2017-10-18 18:13:54 -07:00
|
|
|
ck_assert(role == EFL_ACCESS_ROLE_FILLER);
|
2014-06-10 19:07:15 -07:00
|
|
|
|
|
|
|
}
|
2018-03-26 11:19:28 -07:00
|
|
|
EFL_END_TEST
|
2014-06-10 19:07:15 -07:00
|
|
|
|
2019-07-16 10:38:33 -07:00
|
|
|
EFL_START_TEST(elm_bubble_test_callbacks)
|
|
|
|
{
|
|
|
|
Evas_Object *win, *bb, *ic, *ct;
|
|
|
|
int called = 0;
|
|
|
|
|
|
|
|
win = win_add(NULL, "bubble", ELM_WIN_BASIC);
|
|
|
|
|
|
|
|
ic = elm_icon_add(win);
|
|
|
|
ck_assert(elm_image_file_set(ic, ELM_IMAGE_DATA_DIR "/images/logo_small.png", NULL));
|
|
|
|
elm_image_resizable_set(ic, EINA_FALSE, EINA_FALSE);
|
|
|
|
evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_HORIZONTAL, 1, 1);
|
|
|
|
|
|
|
|
bb = elm_bubble_add(win);
|
|
|
|
elm_object_text_set(bb, "Message 1");
|
|
|
|
elm_object_part_text_set(bb, "info", "Corner: bottom_right");
|
|
|
|
elm_object_part_content_set(bb, "icon", ic);
|
|
|
|
elm_bubble_pos_set(bb, ELM_BUBBLE_POS_BOTTOM_RIGHT);
|
2019-08-20 08:32:15 -07:00
|
|
|
evas_object_smart_callback_add(bb, "clicked", event_callback_single_call_int_data, &called);
|
2019-07-16 10:38:33 -07:00
|
|
|
evas_object_show(ic);
|
|
|
|
evas_object_size_hint_weight_set(bb, EVAS_HINT_EXPAND, 0.0);
|
|
|
|
evas_object_size_hint_align_set(bb, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
|
|
|
|
|
|
|
ct = elm_label_add(win);
|
|
|
|
elm_object_text_set(ct,
|
|
|
|
"\"The future of the art: R or G or B?\", by Rusty");
|
|
|
|
elm_object_content_set(bb, ct);
|
|
|
|
|
|
|
|
evas_object_resize(bb, 240, 100);
|
|
|
|
evas_object_resize(win, 240, 100);
|
|
|
|
evas_object_show(bb);
|
|
|
|
evas_object_show(win);
|
|
|
|
|
|
|
|
get_me_to_those_events(bb);
|
|
|
|
click_object(ct);
|
|
|
|
ck_assert_int_eq(called, 1);
|
|
|
|
called = 0;
|
|
|
|
click_part(bb, "elm.info");
|
|
|
|
ck_assert_int_eq(called, 1);
|
|
|
|
}
|
|
|
|
EFL_END_TEST
|
|
|
|
|
2014-06-10 19:07:15 -07:00
|
|
|
void elm_test_bubble(TCase *tc)
|
|
|
|
{
|
2018-02-14 12:04:24 -08:00
|
|
|
tcase_add_test(tc, elm_bubble_legacy_type_check);
|
|
|
|
tcase_add_test(tc, elm_atspi_role_get);
|
2019-07-16 10:38:33 -07:00
|
|
|
tcase_add_test(tc, elm_bubble_test_callbacks);
|
2014-06-10 19:07:15 -07:00
|
|
|
}
|
|
|
|
|