| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "components/exo/wayland/server.h" | 5 #include "components/exo/wayland/server.h" |
| 6 | 6 |
| 7 #include <grp.h> | 7 #include <grp.h> |
| 8 #include <linux/input.h> | 8 #include <linux/input.h> |
| 9 #include <stddef.h> | 9 #include <stddef.h> |
| 10 #include <stdint.h> | 10 #include <stdint.h> |
| (...skipping 949 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 960 void shell_surface_set_title(wl_client* client, | 960 void shell_surface_set_title(wl_client* client, |
| 961 wl_resource* resource, | 961 wl_resource* resource, |
| 962 const char* title) { | 962 const char* title) { |
| 963 GetUserDataAs<ShellSurface>(resource) | 963 GetUserDataAs<ShellSurface>(resource) |
| 964 ->SetTitle(base::string16(base::UTF8ToUTF16(title))); | 964 ->SetTitle(base::string16(base::UTF8ToUTF16(title))); |
| 965 } | 965 } |
| 966 | 966 |
| 967 void shell_surface_set_class(wl_client* client, | 967 void shell_surface_set_class(wl_client* client, |
| 968 wl_resource* resource, | 968 wl_resource* resource, |
| 969 const char* clazz) { | 969 const char* clazz) { |
| 970 GetUserDataAs<ShellSurface>(resource)->SetApplicationId(clazz); | 970 views::Widget* widget = GetUserDataAs<ShellSurface>(resource)->GetWidget(); |
| 971 ShellSurface::SetApplicationId(widget->GetNativeWindow(), clazz); |
| 971 } | 972 } |
| 972 | 973 |
| 973 const struct wl_shell_surface_interface shell_surface_implementation = { | 974 const struct wl_shell_surface_interface shell_surface_implementation = { |
| 974 shell_surface_pong, shell_surface_move, | 975 shell_surface_pong, shell_surface_move, |
| 975 shell_surface_resize, shell_surface_set_toplevel, | 976 shell_surface_resize, shell_surface_set_toplevel, |
| 976 shell_surface_set_transient, shell_surface_set_fullscreen, | 977 shell_surface_set_transient, shell_surface_set_fullscreen, |
| 977 shell_surface_set_popup, shell_surface_set_maximized, | 978 shell_surface_set_popup, shell_surface_set_maximized, |
| 978 shell_surface_set_title, shell_surface_set_class}; | 979 shell_surface_set_title, shell_surface_set_class}; |
| 979 | 980 |
| 980 //////////////////////////////////////////////////////////////////////////////// | 981 //////////////////////////////////////////////////////////////////////////////// |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1169 void xdg_surface_set_title(wl_client* client, | 1170 void xdg_surface_set_title(wl_client* client, |
| 1170 wl_resource* resource, | 1171 wl_resource* resource, |
| 1171 const char* title) { | 1172 const char* title) { |
| 1172 GetUserDataAs<ShellSurface>(resource) | 1173 GetUserDataAs<ShellSurface>(resource) |
| 1173 ->SetTitle(base::string16(base::UTF8ToUTF16(title))); | 1174 ->SetTitle(base::string16(base::UTF8ToUTF16(title))); |
| 1174 } | 1175 } |
| 1175 | 1176 |
| 1176 void xdg_surface_set_add_id(wl_client* client, | 1177 void xdg_surface_set_add_id(wl_client* client, |
| 1177 wl_resource* resource, | 1178 wl_resource* resource, |
| 1178 const char* app_id) { | 1179 const char* app_id) { |
| 1179 GetUserDataAs<ShellSurface>(resource)->SetApplicationId(app_id); | 1180 views::Widget* widget = GetUserDataAs<ShellSurface>(resource)->GetWidget(); |
| 1181 ShellSurface::SetApplicationId(widget->GetNativeWindow(), app_id); |
| 1180 } | 1182 } |
| 1181 | 1183 |
| 1182 void xdg_surface_show_window_menu(wl_client* client, | 1184 void xdg_surface_show_window_menu(wl_client* client, |
| 1183 wl_resource* resource, | 1185 wl_resource* resource, |
| 1184 wl_resource* seat, | 1186 wl_resource* seat, |
| 1185 uint32_t serial, | 1187 uint32_t serial, |
| 1186 int32_t x, | 1188 int32_t x, |
| 1187 int32_t y) { | 1189 int32_t y) { |
| 1188 NOTIMPLEMENTED(); | 1190 NOTIMPLEMENTED(); |
| 1189 } | 1191 } |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1433 //////////////////////////////////////////////////////////////////////////////// | 1435 //////////////////////////////////////////////////////////////////////////////// |
| 1434 // remote_surface_interface: | 1436 // remote_surface_interface: |
| 1435 | 1437 |
| 1436 void remote_surface_destroy(wl_client* client, wl_resource* resource) { | 1438 void remote_surface_destroy(wl_client* client, wl_resource* resource) { |
| 1437 wl_resource_destroy(resource); | 1439 wl_resource_destroy(resource); |
| 1438 } | 1440 } |
| 1439 | 1441 |
| 1440 void remote_surface_set_app_id(wl_client* client, | 1442 void remote_surface_set_app_id(wl_client* client, |
| 1441 wl_resource* resource, | 1443 wl_resource* resource, |
| 1442 const char* app_id) { | 1444 const char* app_id) { |
| 1443 GetUserDataAs<ShellSurface>(resource)->SetApplicationId(app_id); | 1445 views::Widget* widget = GetUserDataAs<ShellSurface>(resource)->GetWidget(); |
| 1446 ShellSurface::SetApplicationId(widget->GetNativeWindow(), app_id); |
| 1444 } | 1447 } |
| 1445 | 1448 |
| 1446 void remote_surface_set_window_geometry(wl_client* client, | 1449 void remote_surface_set_window_geometry(wl_client* client, |
| 1447 wl_resource* resource, | 1450 wl_resource* resource, |
| 1448 int32_t x, | 1451 int32_t x, |
| 1449 int32_t y, | 1452 int32_t y, |
| 1450 int32_t width, | 1453 int32_t width, |
| 1451 int32_t height) { | 1454 int32_t height) { |
| 1452 GetUserDataAs<ShellSurface>(resource)->SetGeometry( | 1455 GetUserDataAs<ShellSurface>(resource)->SetGeometry( |
| 1453 gfx::Rect(x, y, width, height)); | 1456 gfx::Rect(x, y, width, height)); |
| (...skipping 1618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3072 DCHECK(event_loop); | 3075 DCHECK(event_loop); |
| 3073 wl_event_loop_dispatch(event_loop, timeout.InMilliseconds()); | 3076 wl_event_loop_dispatch(event_loop, timeout.InMilliseconds()); |
| 3074 } | 3077 } |
| 3075 | 3078 |
| 3076 void Server::Flush() { | 3079 void Server::Flush() { |
| 3077 wl_display_flush_clients(wl_display_.get()); | 3080 wl_display_flush_clients(wl_display_.get()); |
| 3078 } | 3081 } |
| 3079 | 3082 |
| 3080 } // namespace wayland | 3083 } // namespace wayland |
| 3081 } // namespace exo | 3084 } // namespace exo |
| OLD | NEW |