#include <Ecore_Wl2.h>
#include <tbm_surface.h>
#include <wayland-client.h>
+#include <wayland-client-protocol.h>
+#include <wayland-extension/xdg-shell-unstable-v6-client-protocol.h>
#include <wayland-tbm-client.h>
#include <sys/mman.h>
#include <unistd.h>
__wlDisplay = nullptr;
__wlRegistry = nullptr;
__wlCompositor = nullptr;
- __wlShell = nullptr;
+ __zxdgShell = nullptr;
__wlSurface = nullptr;
- __wlShellSurface = nullptr;
+ __zxdgShellSurface = nullptr;
__wlTbmClient = nullptr;
}
~WlClientSimpleRendering()
{
- if (__wlShellSurface != nullptr) wl_shell_surface_destroy(__wlShellSurface);
+ if (__zxdgShellSurface != nullptr) zxdg_surface_v6_destroy(__zxdgShellSurface);
if (__wlSurface != nullptr) wl_surface_destroy(__wlSurface);
for (int i = 0; i < BUF_NUM; i++)
{
if (__tbmSurface[i] != nullptr) tbm_surface_destroy(__tbmSurface[i]);
}
if (__wlTbmClient != nullptr) wayland_tbm_client_deinit(__wlTbmClient);
- if (__wlShell != nullptr) wl_shell_destroy(__wlShell);
+ if (__zxdgShell != nullptr) zxdg_shell_v6_destroy(__zxdgShell);
if (__wlCompositor != nullptr) wl_compositor_destroy(__wlCompositor);
if (__wlRegistry != nullptr) wl_registry_destroy(__wlRegistry);
void CommitBuffer(int bufferNum);
struct wl_compositor *__wlCompositor;
- struct wl_shell *__wlShell;
+ struct zxdg_shell_v6 *__zxdgShell;
struct wl_surface *__wlSurface;
- struct wl_shell_surface *__wlShellSurface;
+ struct zxdg_surface_v6 *__zxdgShellSurface;
struct wl_buffer *__wlBuffer[BUF_NUM];
struct wayland_tbm_client *__wlTbmClient;
};
std::cout << __func__ << " Error. fail to bind " << interface << std::endl;
else
std::cout << __func__ << " bind " << interface << std::endl;
- } else if (strcmp(interface, "wl_shell") == 0) {
- temp->__wlShell = (struct wl_shell *)wl_registry_bind(registry, name, &wl_shell_interface, 1);
- if (temp->__wlShell == nullptr)
+ } else if (strcmp(interface, "zxdg_shell_v6") == 0) {
+ temp->__zxdgShell = (struct zxdg_shell_v6 *)wl_registry_bind(registry, name, &zxdg_shell_v6_interface, 1);
+ if (temp->__zxdgShell == nullptr)
std::cout << __func__ << " Error. fail to bind " << interface << std::endl;
else
std::cout << __func__ << " bind " << interface << std::endl;
wl_display_dispatch(__wlDisplay);
wl_display_roundtrip(__wlDisplay);
- if (__wlCompositor == nullptr || __wlShell == nullptr)
+ if (__wlCompositor == nullptr || __zxdgShell == nullptr)
{
std::cout << __func__ << " Error. fail binding" << std::endl;
this->DisconnectDisplay();
return -1;
}
- __wlShellSurface = wl_shell_get_shell_surface(__wlShell, __wlSurface);
- if (__wlShellSurface == nullptr)
+ __zxdgShellSurface = zxdg_shell_v6_get_xdg_surface(__zxdgShell, __wlSurface);
+ if (__zxdgShellSurface == nullptr)
{
- std::cout << __func__ << " Error. fail wl_shell_get_shell_surface" << std::endl;
+ std::cout << __func__ << " Error. fail zxdg_shell_v6_get_xdg_surface" << std::endl;
this->DisconnectDisplay();
return -1;
}
{
int i;
- if (__wlShellSurface != nullptr) wl_shell_surface_destroy(__wlShellSurface);
- __wlShellSurface = nullptr;
+ if (__zxdgShellSurface != nullptr) zxdg_surface_v6_destroy(__zxdgShellSurface);
+ __zxdgShellSurface = nullptr;
if (__wlSurface != nullptr) wl_surface_destroy(__wlSurface);
__wlSurface = nullptr;
for (i = 0; i < BUF_NUM; i++)
if (__wlTbmClient != nullptr) wayland_tbm_client_deinit(__wlTbmClient);
__wlTbmClient = nullptr;
- if (__wlShell != nullptr) wl_shell_destroy(__wlShell);
- __wlShell = nullptr;
+ if (__zxdgShell != nullptr) zxdg_shell_v6_destroy(__zxdgShell);
+ __zxdgShell = nullptr;
if (__wlCompositor) wl_compositor_destroy(__wlCompositor);
__wlCompositor = nullptr;
void WlClientSimpleRendering::CommitBuffer(int bufferNum)
{
- int ret = 0;
-
if (__wlSurface == nullptr || __wlDisplay == nullptr)
{
std::cout << __func__ << " Error. execute connect first" << std::endl;
std::cout << __func__ << " commit " << bufferNum << " buffer(tbm_surface:" << __tbmSurface[bufferNum] << ", wl_buffer:" << __wlBuffer[bufferNum] << ")" << std::endl;
+#if 0
+ int ret = 0;
+
ret = wl_display_dispatch(__wlDisplay);
if (ret < 0) {
std::cout << __func__ << " Error. wl_display_dispatch error:" << ret << std::endl;
return;
}
+#endif
wl_display_roundtrip(__wlDisplay);
}
}
}
- wl_shell_surface_set_toplevel(simpleRenderSample->__wlShellSurface);
+ zxdg_surface_v6_get_toplevel(simpleRenderSample->__zxdgShellSurface);
/* main loop */
i = 0;
wayland_tbm_client_dep = dependency('wayland-tbm-client')
executable('exampleClientNoShellRendering',
'exampleClientNoShellRendering.cpp',
- dependencies : [libds_declared_dep, wayland_client_dep, ecore_wayland2_dep, wayland_tbm_client_dep],
+ dependencies : [libds_declared_dep, wayland_client_dep, tizen_extension_client_dep, ecore_wayland2_dep, wayland_tbm_client_dep],
install_dir : libds_prefix_bindir,
install : true
)
wayland_tbm_client_dep = dependency('wayland-tbm-client')
+xdg_shell_client_dep = dependency('xdg-shell-client')
+xdg_shell_unstable_v6_client_dep = dependency('xdg-shell-unstable-v6-client')
executable('exampleClientShellRendering',
'exampleClientShellRendering.cpp',
- dependencies : [libds_declared_dep, wayland_client_dep, ecore_wayland2_dep, wayland_tbm_client_dep],
+ dependencies : [libds_declared_dep, wayland_client_dep, xdg_shell_client_dep, xdg_shell_unstable_v6_client_dep, ecore_wayland2_dep, wayland_tbm_client_dep],
install_dir : libds_prefix_bindir,
install : true
)