static void server_schedule_idle_task(headless_server_t *server);
static void server_set_focus_view(headless_server_t *server,
headless_view_t *view);
-static void server_set_top_view(headless_server_t *server,
+static void server_set_top_visible_view(headless_server_t *server,
headless_view_t *view);
static int
wl_list_init(&server.views);
- wl_signal_init(&server.events.focus_change);
- wl_signal_init(&server.events.top_change);
+ wl_signal_init(&server.events.focus_view_change);
+ wl_signal_init(&server.events.top_visible_view_change);
server.compositor = ds_compositor_create(server.display);
HS_CHECK(server.compositor, goto end, "Failed to create ds_compositor");
view = wl_container_of(listener, view, shell_surface_destroy);
server = view->server;
- if (server->top_view == view) {
- server->top_view = NULL;
- wl_signal_emit(&server->events.top_change, NULL);
+ if (server->top_visible_view == view) {
+ server->top_visible_view = NULL;
+ wl_signal_emit(&server->events.top_visible_view_change, NULL);
}
server_schedule_idle_task(server);
server->focus_view = view;
- wl_signal_emit(&server->events.focus_change, view);
+ wl_signal_emit(&server->events.focus_view_change, view);
}
static void
-server_set_top_view(headless_server_t *server, headless_view_t *view)
+server_set_top_visible_view(headless_server_t *server, headless_view_t *view)
{
- if (server->top_view == view)
+ if (server->top_visible_view == view)
return;
// TODO handle input and debug
- if (server->top_view) {
- headless_shell_send_visibility(server->top_view->shell_surface,
+ if (server->top_visible_view) {
+ headless_shell_send_visibility(server->top_visible_view->shell_surface,
TIZEN_VISIBILITY_VISIBILITY_FULLY_OBSCURED);
}
TIZEN_VISIBILITY_VISIBILITY_UNOBSCURED);
}
- server->top_view = view;
+ server->top_visible_view = view;
- wl_signal_emit(&server->events.top_change, view);
+ wl_signal_emit(&server->events.top_visible_view_change, view);
}
static void
size_t stride;
bool access = false;
- if (server->top_view) {
- surface = server->top_view->surface;
- buffer = server->top_view->buffer;
+ if (server->top_visible_view) {
+ surface = server->top_visible_view->surface;
+ buffer = server->top_visible_view->buffer;
}
if (buffer) {
idle_task(void *data)
{
headless_server_t *server = data;
- headless_view_t *view, *focus_view = NULL, *top_view = NULL;
+ headless_view_t *view, *focus_view = NULL, *top_visible_view = NULL;
server->idle_source = NULL;
if (!view->mapped)
continue;
- if (!top_view)
- top_view = view;
+ if (!top_visible_view)
+ top_visible_view = view;
if (!focus_view && !view->skip_focus)
focus_view = view;
- if (focus_view && top_view)
+ if (focus_view && top_visible_view)
break;
}
server_set_focus_view(server, focus_view);
- server_set_top_view(server, top_view);
+ server_set_top_visible_view(server, top_visible_view);
server_repaint(server);
}
{
headless_server_t *server;
headless_keyboard_t *keyboard;
- headless_view_t *top_view;
+ headless_view_t *top_visible_view;
struct ds_backend *backend;
struct ds_seat *seat;
struct ds_tizen_input_devicemgr *devicemgr;
struct wl_listener new_input;
- struct wl_listener focus_change;
- struct wl_listener top_change;
- struct wl_listener top_view_destroy;
+ struct wl_listener focus_view_change;
+ struct wl_listener top_visible_view_change;
+ struct wl_listener top_visible_view_destroy;
};
struct headless_keyboard
};
static void handle_new_input(struct wl_listener *listener, void *data);
-static void handle_focus_change(struct wl_listener *listener, void *data);
-static void handle_top_change(struct wl_listener *listener, void *data);
+static void handle_focus_view_change(struct wl_listener *listener, void *data);
+static void handle_top_visible_view_change(struct wl_listener *listener, void *data);
static void handle_top_view_destroy(struct wl_listener *listener, void *data);
static headless_keyboard_t *create_keyboard(headless_input_t *input,
struct ds_input_device *dev);
input->new_input.notify = handle_new_input;
ds_backend_add_new_input_listener(input->backend, &input->new_input);
- input->focus_change.notify = handle_focus_change;
- wl_signal_add(&server->events.focus_change, &input->focus_change);
+ input->focus_view_change.notify = handle_focus_view_change;
+ wl_signal_add(&server->events.focus_view_change,
+ &input->focus_view_change);
- input->top_change.notify = handle_top_change;
- wl_signal_add(&server->events.top_change, &input->top_change);
+ input->top_visible_view_change.notify = handle_top_visible_view_change;
+ wl_signal_add(&server->events.top_visible_view_change,
+ &input->top_visible_view_change);
ds_backend_start(input->backend);
if (input->keyboard)
keyboard_destroy(input->keyboard);
- if (input->top_view_destroy.notify)
- wl_list_remove(&input->top_view_destroy.link);
+ if (input->top_visible_view_destroy.notify)
+ wl_list_remove(&input->top_visible_view_destroy.link);
- wl_list_remove(&input->top_change.link);
- wl_list_remove(&input->focus_change.link);
+ wl_list_remove(&input->top_visible_view_change.link);
+ wl_list_remove(&input->focus_view_change.link);
wl_list_remove(&input->new_input.link);
ds_backend_destroy(input->backend);
}
static void
-handle_focus_change(struct wl_listener *listener, void *data)
+handle_focus_view_change(struct wl_listener *listener, void *data)
{
headless_input_t *input;
headless_view_t *view = data;
- input = wl_container_of(listener, input, focus_change);
+ input = wl_container_of(listener, input, focus_view_change);
if (view) {
ds_seat_keyboard_notify_enter(input->seat, view->surface,
}
static void
-handle_top_change(struct wl_listener *listener, void *data)
+handle_top_visible_view_change(struct wl_listener *listener, void *data)
{
headless_input_t *input;
headless_view_t *view = data;
- input = wl_container_of(listener, input, top_change);
+ input = wl_container_of(listener, input, top_visible_view_change);
- if (input->top_view_destroy.notify) {
- wl_list_remove(&input->top_view_destroy.link);
- input->top_view_destroy.notify = NULL;
+ if (input->top_visible_view_destroy.notify) {
+ wl_list_remove(&input->top_visible_view_destroy.link);
+ input->top_visible_view_destroy.notify = NULL;
}
if (view) {
- input->top_view_destroy.notify = handle_top_view_destroy;
- wl_signal_add(&view->events.destroy, &input->top_view_destroy);
+ input->top_visible_view_destroy.notify = handle_top_view_destroy;
+ wl_signal_add(&view->events.destroy, &input->top_visible_view_destroy);
}
- input->top_view = view;
+ input->top_visible_view = view;
}
static void
{
headless_input_t *input;
- input = wl_container_of(listener, input, top_view_destroy);
+ input = wl_container_of(listener, input, top_visible_view_destroy);
- wl_list_remove(&input->top_view_destroy.link);
+ wl_list_remove(&input->top_visible_view_destroy.link);
- input->top_view_destroy.notify = NULL;
- input->top_view = NULL;
+ input->top_visible_view_destroy.notify = NULL;
+ input->top_visible_view = NULL;
}
static void
ev->time_msec, ev->update_state);
ds_tizen_keyrouter_notify_key(input->keyrouter, input->seat,
- input->top_view ? input->top_view->surface : NULL,
+ input->top_visible_view ? input->top_visible_view->surface : NULL,
ev->time_msec, ev->keycode, ev->state);
}