Guiliani  Version 2.6 revision 7293 (documentation build 12)
GfxEnvWayland.h
1/*
2* Copyright (C) TES Electronic Solutions GmbH,
3* All Rights Reserved.
4* Contact: info@guiliani.de
5*
6* This file is part of the Guiliani HMI framework
7* for the development of graphical user interfaces on embedded systems.
8*/
9
10#ifndef __GFXENV_WAYLAND_H__
11#define __GFXENV_WAYLAND_H__
12
13#include "GUIRect.h"
14#include "GfxEnv.h"
15#include "GUICommonEnums.h"
16
17#include <wayland-client.h>
18#include <wayland-client-protocol.h>
19#include <wayland-egl.h> // Wayland EGL MUST be included before EGL headers
20
21// ignore include when generating documentation
22#ifndef DOXYGEN
23#include "xdg-shell-client-protocol.h"
24#include "xdg-decoration-unstable-v1.h"
25#include "xdg-output-unstable-v1.h"
26#endif
27
29
34class CGfxEnvWayland : public CGfxEnv
35{
36public:
39 {
40 /* Globals */
47 struct zxdg_decoration_manager_v1* zxdg_decoration_mgr;
48 struct zxdg_toplevel_decoration_v1* zxdg_decoration;
49 struct zxdg_output_manager_v1* xdg_output_manager;
50
51 // for Framebuffer
52 struct wl_shm* wl_shm;
56
57 // for OpenGL
61
62 // listener
66 struct wl_callback_listener wl_surface_frame_listener;
71 struct zxdg_toplevel_decoration_v1_listener xdg_toplevel_decoration_listener;
72
75
76 /* State */
77 int width;
78 int height;
79 bool closed;
80 eC_UByte* draw_buffer;
82
83 uint format;
85 };
86
87public:
96 static eC_Bool CreateInstance(
97 const SurfaceMode_t& eSurfaceMode,
98 const CGUICommonEnums::ImageType_t& eScreenFormat,
99 const eC_UInt& uiWidth,
100 const eC_UInt& uiHeight,
101 const eC_Bool& bFullscreen = false);
102
103 virtual void* GetDisplayHandle() const;
104
105 virtual void* GetWindowHandle() const;
106
107protected:
116 const SurfaceMode_t& eSurfaceMode,
117 const CGUICommonEnums::ImageType_t& eScreenFormat,
118 const eC_UInt& uiWidth,
119 const eC_UInt& uiHeight,
120 const eC_Bool& bFullscreen);
121
125
126protected:
127 virtual void SetScreenSize(
128 const eC_UInt& uiWidth,
129 const eC_UInt& uiHeight);
130
131 virtual eC_Bool IsCreated() const;
132
133 virtual eC_Bool RefreshScreen(const CGUIRect &kInvalidatedArea);
134
135 virtual eC_Bool SwapBuffers();
136
137 virtual void** GetFrameBuffers() const;
138
139 virtual void SetWindowCaption(const eC_String& kCaption);
140
141private:
142 void CreateScreen();
143
144 uint GetFormat(const CGUICommonEnums::ImageType_t& eFormat);
145
149 CGfxEnvWayland(const CGfxEnvWayland& kSource);
150
154 CGfxEnvWayland& operator=(const CGfxEnvWayland& kSource);
155
156private:
157 eC_Bool m_bFullscreen;
158 ClientState_t m_kState;
159};
160#endif
ImageType_t
Definition: GUICommonEnums.h:80
Helper class to supply a platform independent rectangle implementation.
Definition: GUIRect.h:63
Definition: GfxEnv.h:53
SurfaceMode_t
Definition: GfxEnv.h:60
Implements Wayland-specific features.
Definition: GfxEnvWayland.h:35
virtual eC_Bool RefreshScreen(const CGUIRect &kInvalidatedArea)
virtual void ** GetFrameBuffers() const
virtual void * GetDisplayHandle() const
CGfxEnvWayland(const SurfaceMode_t &eSurfaceMode, const CGUICommonEnums::ImageType_t &eScreenFormat, const eC_UInt &uiWidth, const eC_UInt &uiHeight, const eC_Bool &bFullscreen)
virtual void SetScreenSize(const eC_UInt &uiWidth, const eC_UInt &uiHeight)
virtual ~CGfxEnvWayland()
virtual eC_Bool SwapBuffers()
virtual void SetWindowCaption(const eC_String &kCaption)
virtual void * GetWindowHandle() const
virtual eC_Bool IsCreated() const
static eC_Bool CreateInstance(const SurfaceMode_t &eSurfaceMode, const CGUICommonEnums::ImageType_t &eScreenFormat, const eC_UInt &uiWidth, const eC_UInt &uiHeight, const eC_Bool &bFullscreen=false)
Definition: GfxEnvWayland.h:39
uint format
format
Definition: GfxEnvWayland.h:83
struct xdg_surface_listener xdg_surface_listener
surface listener
Definition: GfxEnvWayland.h:68
struct wl_surface * wl_surface
surface
Definition: GfxEnvWayland.h:45
struct wl_shell * wl_shell
shell
Definition: GfxEnvWayland.h:58
struct wl_registry_listener wl_registry_listener
registry listener
Definition: GfxEnvWayland.h:63
struct xdg_toplevel_listener xdg_toplevel_listener
toplevel listener
Definition: GfxEnvWayland.h:67
struct zxdg_decoration_manager_v1 * zxdg_decoration_mgr
decoration manager
Definition: GfxEnvWayland.h:47
struct wl_display * wl_display
display
Definition: GfxEnvWayland.h:41
int height
height
Definition: GfxEnvWayland.h:78
void * native_window
native window
Definition: GfxEnvWayland.h:81
struct zxdg_toplevel_decoration_v1 * zxdg_decoration
decoration
Definition: GfxEnvWayland.h:48
int width
width
Definition: GfxEnvWayland.h:77
struct wl_seat_listener wl_seat_listener
seat listener
Definition: GfxEnvWayland.h:64
struct wl_registry * wl_registry
registry
Definition: GfxEnvWayland.h:42
struct xdg_toplevel * xdg_toplevel
xdg-toplevel
Definition: GfxEnvWayland.h:55
bool wait_for_configure
wait for configure
Definition: GfxEnvWayland.h:73
struct wl_subcompositor * wl_subcompositor
sub compositor
Definition: GfxEnvWayland.h:44
eC_UByte * draw_buffer
draw buffer
Definition: GfxEnvWayland.h:80
bool closed
closed
Definition: GfxEnvWayland.h:79
uint bytesperpixel
bytes per pixel
Definition: GfxEnvWayland.h:84
bool use_buffer
use buffer
Definition: GfxEnvWayland.h:74
struct wl_region * wl_region
region
Definition: GfxEnvWayland.h:60
struct wl_subsurface * wl_subsurface
subsurface
Definition: GfxEnvWayland.h:46
struct wl_compositor * wl_compositor
compositor
Definition: GfxEnvWayland.h:43
struct xdg_wm_base_listener xdg_wm_base_listener
wm base listener
Definition: GfxEnvWayland.h:69
struct wl_shell_surface_listener wl_shell_surface_listener
shell listener
Definition: GfxEnvWayland.h:70
struct zxdg_output_manager_v1 * xdg_output_manager
output manager
Definition: GfxEnvWayland.h:49
struct xdg_surface * xdg_surface
xdg-surface
Definition: GfxEnvWayland.h:54
struct xdg_wm_base * xdg_wm_base
wm base
Definition: GfxEnvWayland.h:53
struct zxdg_toplevel_decoration_v1_listener xdg_toplevel_decoration_listener
decoration listener
Definition: GfxEnvWayland.h:71
struct wl_shm * wl_shm
buffer
Definition: GfxEnvWayland.h:52
struct wl_callback_listener wl_surface_frame_listener
frame listener
Definition: GfxEnvWayland.h:66
struct wl_buffer_listener wl_buffer_listener
buffer listener
Definition: GfxEnvWayland.h:65
struct wl_shell_surface * wl_shell_surface
shell surface
Definition: GfxEnvWayland.h:59