zcr_remote_shell_event_mapping.h 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. // Copyright 2021 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef COMPONENTS_EXO_WAYLAND_ZCR_REMOTE_SHELL_EVENT_MAPPING_H_
  5. #define COMPONENTS_EXO_WAYLAND_ZCR_REMOTE_SHELL_EVENT_MAPPING_H_
  6. #include <stdint.h>
  7. #include <wayland-server-core.h>
  8. #include <wayland-server-protocol-core.h>
  9. #include "base/callback.h"
  10. // These structs are populated with function pointers and values from the v1 and
  11. // v2 remote shell protocol.
  12. struct WaylandRemoteOutputEventMapping {
  13. void (*send_identification_data)(struct wl_resource* resource_,
  14. struct wl_array* identification_data);
  15. void (*send_display_id)(struct wl_resource* resource_,
  16. uint32_t display_id_hi,
  17. uint32_t display_id_lo);
  18. void (*send_port)(struct wl_resource* resource_, uint32_t port);
  19. void (*send_insets)(struct wl_resource* resource_,
  20. int32_t inset_left,
  21. int32_t inset_top,
  22. int32_t inset_right,
  23. int32_t inset_bottom);
  24. void (*send_stable_insets)(struct wl_resource* resource_,
  25. int32_t stable_inset_left,
  26. int32_t stable_inset_top,
  27. int32_t stable_inset_right,
  28. int32_t stable_inset_bottom);
  29. void (*send_systemui_behavior)(struct wl_resource* resource_,
  30. int32_t systemui_behavior);
  31. int system_ui_behavior_since_version;
  32. int stable_insets_since_version;
  33. };
  34. struct WaylandRemoteShellEventMapping {
  35. void (*send_window_geometry_changed)(struct wl_resource* resource_,
  36. int32_t x,
  37. int32_t y,
  38. int32_t width,
  39. int32_t height);
  40. void (*send_change_zoom_level)(struct wl_resource* resource_, int32_t change);
  41. void (*send_state_type_changed)(struct wl_resource* resource_,
  42. uint32_t state_type);
  43. void (*send_bounds_changed_in_output)(struct wl_resource* resource_,
  44. struct wl_resource* output,
  45. int32_t x,
  46. int32_t y,
  47. int32_t width,
  48. int32_t height,
  49. uint32_t bounds_change_reason);
  50. void (*send_bounds_changed)(struct wl_resource* resource_,
  51. uint32_t display_id_hi,
  52. uint32_t display_id_lo,
  53. int32_t x,
  54. int32_t y,
  55. int32_t width,
  56. int32_t height,
  57. uint32_t bounds_change_reason);
  58. void (*send_activated)(struct wl_resource* resource_,
  59. struct wl_resource* gained_active,
  60. struct wl_resource* lost_active);
  61. void (*send_desktop_focus_state_changed)(struct wl_resource* resource_,
  62. uint32_t focus_state);
  63. void (*send_workspace_info)(struct wl_resource* resource_,
  64. uint32_t display_id_hi,
  65. uint32_t display_id_lo,
  66. int32_t x,
  67. int32_t y,
  68. int32_t width,
  69. int32_t height,
  70. int32_t inset_left,
  71. int32_t inset_top,
  72. int32_t inset_right,
  73. int32_t inset_bottom,
  74. int32_t stable_inset_left,
  75. int32_t stable_inset_top,
  76. int32_t stable_inset_right,
  77. int32_t stable_inset_bottom,
  78. int32_t systemui_visibility,
  79. int32_t transform,
  80. uint32_t is_internal,
  81. struct wl_array* identification_data);
  82. void (*send_drag_finished)(struct wl_resource* resource_,
  83. int32_t x,
  84. int32_t y,
  85. int32_t canceled);
  86. void (*send_drag_started)(struct wl_resource* resource_, uint32_t direction);
  87. void (*send_layout_mode)(struct wl_resource* resource_, uint32_t layout_mode);
  88. void (*send_default_device_scale_factor)(struct wl_resource* resource_,
  89. int32_t scale);
  90. void (*send_configure)(struct wl_resource* resource_, uint32_t layout_mode);
  91. int bounds_changed_in_output_since_version;
  92. int desktop_focus_state_changed_since_version;
  93. int layout_mode_since_version;
  94. int default_device_scale_factor_since_version;
  95. int change_zoom_level_since_version;
  96. int send_workspace_info_since_version;
  97. int set_use_default_scale_cancellation_since_version;
  98. };
  99. #endif // COMPONENTS_EXO_WAYLAND_ZCR_REMOTE_SHELL_EVENT_MAPPING_H_