Lines Matching refs:app
259 static struct graphic_object * create_graphic_obj(struct application * app, struct window * window,
318 struct application * app = data; in shm_format() local
327 app->shm_format = format; in shm_format()
332 app->shm_format != WL_SHM_FORMAT_ARGB8888) { in shm_format()
335 app->shm_format = format; in shm_format()
340 app->shm_format = format; in shm_format()
353 struct application * app = data; in pointer_handle_enter() local
359 app->pointer_obj = NULL; in pointer_handle_enter()
363 app->pointer_obj = wl_surface_get_user_data(surface); in pointer_handle_enter()
365 app->pointer_obj->input.pointer.x = pos_x; in pointer_handle_enter()
366 app->pointer_obj->input.pointer.y = pos_y; in pointer_handle_enter()
369 if(!app->pointer_obj->window->xdg_toplevel || app->opt_disable_decorations) { in pointer_handle_enter()
373 struct window * window = app->pointer_obj->window; in pointer_handle_enter()
375 switch(app->pointer_obj->type) { in pointer_handle_enter()
437 if(app->cursor_surface) { in pointer_handle_enter()
438 …struct wl_cursor_image * cursor_image = wl_cursor_theme_get_cursor(app->cursor_theme, cursor)->ima… in pointer_handle_enter()
439 …wl_pointer_set_cursor(pointer, serial, app->cursor_surface, cursor_image->hotspot_x, cursor_image-… in pointer_handle_enter()
440 wl_surface_attach(app->cursor_surface, wl_cursor_image_get_buffer(cursor_image), 0, 0); in pointer_handle_enter()
441 wl_surface_damage(app->cursor_surface, 0, 0, cursor_image->width, cursor_image->height); in pointer_handle_enter()
442 wl_surface_commit(app->cursor_surface); in pointer_handle_enter()
443 app->cursor_flush_pending = true; in pointer_handle_enter()
450 struct application * app = data; in pointer_handle_leave() local
455 if(!surface || (app->pointer_obj == wl_surface_get_user_data(surface))) { in pointer_handle_leave()
456 app->pointer_obj = NULL; in pointer_handle_leave()
463 struct application * app = data; in pointer_handle_motion() local
468 if(!app->pointer_obj) { in pointer_handle_motion()
472 …app->pointer_obj->input.pointer.x = LV_MAX(0, LV_MIN(wl_fixed_to_int(sx), app->pointer_obj->width … in pointer_handle_motion()
473 …app->pointer_obj->input.pointer.y = LV_MAX(0, LV_MIN(wl_fixed_to_int(sy), app->pointer_obj->height… in pointer_handle_motion()
480 struct application * app = data; in pointer_handle_button() local
489 if(!app->pointer_obj) { in pointer_handle_button()
496 window = app->pointer_obj->window; in pointer_handle_button()
497 int pos_x = app->pointer_obj->input.pointer.x; in pointer_handle_button()
498 int pos_y = app->pointer_obj->input.pointer.y; in pointer_handle_button()
501 switch(app->pointer_obj->type) { in pointer_handle_button()
505 app->pointer_obj->input.pointer.left_button = lv_state; in pointer_handle_button()
508 app->pointer_obj->input.pointer.right_button = lv_state; in pointer_handle_button()
511 app->pointer_obj->input.pointer.wheel_button = lv_state; in pointer_handle_button()
523 xdg_toplevel_move(window->xdg_toplevel, app->wl_seat, serial); in pointer_handle_button()
529 wl_shell_surface_move(window->wl_shell_surface, app->wl_seat, serial); in pointer_handle_button()
649 struct application * app = data; in pointer_handle_axis() local
655 if(!app->pointer_obj) { in pointer_handle_axis()
661 app->pointer_obj->input.pointer.wheel_diff++; in pointer_handle_axis()
664 app->pointer_obj->input.pointer.wheel_diff--; in pointer_handle_axis()
748 struct application * app = data; in keyboard_handle_keymap() local
768 keymap = xkb_keymap_new_from_string(app->xkb_context, map_str, in keyboard_handle_keymap()
786 xkb_keymap_unref(app->seat.xkb.keymap); in keyboard_handle_keymap()
787 xkb_state_unref(app->seat.xkb.state); in keyboard_handle_keymap()
788 app->seat.xkb.keymap = keymap; in keyboard_handle_keymap()
789 app->seat.xkb.state = state; in keyboard_handle_keymap()
796 struct application * app = data; in keyboard_handle_enter() local
803 app->keyboard_obj = NULL; in keyboard_handle_enter()
806 app->keyboard_obj = wl_surface_get_user_data(surface); in keyboard_handle_enter()
813 struct application * app = data; in keyboard_handle_leave() local
818 if(!surface || (app->keyboard_obj == wl_surface_get_user_data(surface))) { in keyboard_handle_leave()
819 app->keyboard_obj = NULL; in keyboard_handle_leave()
827 struct application * app = data; in keyboard_handle_key() local
836 if(!app->keyboard_obj || !app->seat.xkb.state) { in keyboard_handle_key()
840 if(xkb_state_key_get_syms(app->seat.xkb.state, code, &syms) == 1) { in keyboard_handle_key()
849 app->keyboard_obj->input.keyboard.key = lv_key; in keyboard_handle_key()
850 app->keyboard_obj->input.keyboard.state = lv_state; in keyboard_handle_key()
859 struct application * app = data; in keyboard_handle_modifiers() local
865 if(!app->seat.xkb.keymap) { in keyboard_handle_modifiers()
869 xkb_state_update_mask(app->seat.xkb.state, in keyboard_handle_modifiers()
887 struct application * app = data; in touch_handle_down() local
896 app->touch_obj = NULL; in touch_handle_down()
901 app->touch_obj = wl_surface_get_user_data(surface); in touch_handle_down()
902 i = app->touch_obj->input.touch_event_cnt; in touch_handle_down()
904 app->touch_obj->input.touches[i].point.x = wl_fixed_to_int(x_w); in touch_handle_down()
905 app->touch_obj->input.touches[i].point.y = wl_fixed_to_int(y_w); in touch_handle_down()
906 app->touch_obj->input.touches[i].id = id; in touch_handle_down()
907 app->touch_obj->input.touches[i].timestamp = time; in touch_handle_down()
908 app->touch_obj->input.touches[i].state = LV_INDEV_STATE_PRESSED; in touch_handle_down()
909 app->touch_obj->input.touch_event_cnt++; in touch_handle_down()
912 struct window * window = app->touch_obj->window; in touch_handle_down()
913 switch(app->touch_obj->type) { in touch_handle_down()
917 xdg_toplevel_move(window->xdg_toplevel, app->wl_seat, serial); in touch_handle_down()
923 wl_shell_surface_move(window->wl_shell_surface, app->wl_seat, serial); in touch_handle_down()
937 struct application * app = data; in touch_handle_up() local
947 i = app->touch_obj->input.touch_event_cnt; in touch_handle_up()
949 app->touch_obj->input.touches[i].point.x = 0; in touch_handle_up()
950 app->touch_obj->input.touches[i].point.y = 0; in touch_handle_up()
951 app->touch_obj->input.touches[i].id = id; in touch_handle_up()
952 app->touch_obj->input.touches[i].timestamp = time; in touch_handle_up()
953 app->touch_obj->input.touches[i].state = LV_INDEV_STATE_RELEASED; in touch_handle_up()
955 app->touch_obj->input.touch_event_cnt++; in touch_handle_up()
959 struct window * window = app->touch_obj->window; in touch_handle_up()
960 switch(app->touch_obj->type) { in touch_handle_up()
992 struct application * app = data; in touch_handle_motion() local
1002 touch = &app->touch_obj->input.touches[0]; in touch_handle_motion()
1005 for(i = 0; i < app->touch_obj->input.touch_event_cnt; i++) { in touch_handle_motion()
1014 i = app->touch_obj->input.touch_event_cnt; in touch_handle_motion()
1015 app->touch_obj->input.touches[i].point.x = wl_fixed_to_int(x_w); in touch_handle_motion()
1016 app->touch_obj->input.touches[i].point.y = wl_fixed_to_int(y_w); in touch_handle_motion()
1017 app->touch_obj->input.touches[i].id = id; in touch_handle_motion()
1018 app->touch_obj->input.touches[i].timestamp = time; in touch_handle_motion()
1019 app->touch_obj->input.touches[i].state = LV_INDEV_STATE_PRESSED; in touch_handle_motion()
1020 app->touch_obj->input.touch_event_cnt++; in touch_handle_motion()
1058 struct application * app = data; in seat_handle_capabilities() local
1059 struct seat * seat = &app->seat; in seat_handle_capabilities()
1063 wl_pointer_add_listener(seat->wl_pointer, &pointer_listener, app); in seat_handle_capabilities()
1064 app->cursor_surface = wl_compositor_create_surface(app->compositor); in seat_handle_capabilities()
1065 if(!app->cursor_surface) { in seat_handle_capabilities()
1071 if(app->cursor_surface) { in seat_handle_capabilities()
1072 wl_surface_destroy(app->cursor_surface); in seat_handle_capabilities()
1079 wl_keyboard_add_listener(seat->wl_keyboard, &keyboard_listener, app); in seat_handle_capabilities()
1089 wl_touch_add_listener(seat->wl_touch, &touch_listener, app); in seat_handle_capabilities()
1268 struct application * app = data; in handle_global() local
1274 app->compositor = wl_registry_bind(registry, name, &wl_compositor_interface, 1); in handle_global()
1277 app->subcompositor = wl_registry_bind(registry, name, &wl_subcompositor_interface, 1); in handle_global()
1280 app->shm = wl_registry_bind(registry, name, &wl_shm_interface, 1); in handle_global()
1281 wl_shm_add_listener(app->shm, &shm_listener, app); in handle_global()
1282 app->cursor_theme = wl_cursor_theme_load(NULL, 32, app->shm); in handle_global()
1285 app->wl_seat = wl_registry_bind(app->registry, name, &wl_seat_interface, 1); in handle_global()
1286 wl_seat_add_listener(app->wl_seat, &seat_listener, app); in handle_global()
1290 app->wl_shell = wl_registry_bind(registry, name, &wl_shell_interface, 1); in handle_global()
1296 app->xdg_wm = wl_registry_bind(app->registry, name, &xdg_wm_base_interface, 4); in handle_global()
1297 xdg_wm_base_add_listener(app->xdg_wm, &xdg_wm_base_listener, app); in handle_global()
1436 struct application * app = ctx; in sme_new_pool() local
1441 wl_pool = wl_shm_create_pool(app->shm, in sme_new_pool()
1473 struct application * app = ctx; in sme_new_buffer() local
1485 app->shm_format); in sme_new_buffer()
1579 static struct graphic_object * create_graphic_obj(struct application * app, struct window * window, in create_graphic_obj() argument
1595 obj->surface = wl_compositor_create_surface(app->compositor); in create_graphic_obj()
2030 static struct window * create_window(struct application * app, int width, int height, const char * … in create_window() argument
2034 window = lv_ll_ins_tail(&app->window_ll); in create_window()
2042 window->application = app; in create_window()
2045 window->body = create_graphic_obj(app, window, OBJECT_WINDOW, NULL); in create_window()
2059 else if(app->xdg_wm) { in create_window()
2060 window->xdg_surface = xdg_wm_base_get_xdg_surface(app->xdg_wm, window->body->surface); in create_window()
2085 else if(app->wl_shell) { in create_window()
2086 window->wl_shell_surface = wl_shell_get_shell_surface(app->wl_shell, window->body->surface); in create_window()
2124 lv_ll_remove(&app->window_ll, window); in create_window()
2167 struct application * app; in _lv_wayland_flush() local
2180 app = window->application; in _lv_wayland_flush()
2225 if(app->shm_format == WL_SHM_FORMAT_ARGB8888) { in _lv_wayland_flush()