2 * Copyright (c) 2013, TOYOTA MOTOR CORPORATION.
4 * This program is licensed under the terms and conditions of the
5 * Apache License, version 2.0. The full text of the Apache License is at
6 * http://www.apache.org/licenses/LICENSE-2.0
10 * @brief Display screen clear tool
15 #ifndef _CLEAR_SCREEN_H_
16 #define _CLEAR_SCREEN_H_
18 #include <sys/ioctl.h>
19 #include <GLES2/gl2.h>
21 #include <wayland-client.h>
22 #include <wayland-client-protocol.h>
23 #include <wayland-egl.h>
24 #include <wayland-util.h>
28 #define MAX_CON_NAME 127
33 struct wl_display *display;
34 struct wl_registry *registry;
35 struct wl_compositor *compositor;
36 struct wl_shell *shell;
37 struct ico_window_mgr *ico_window_mgr;
38 struct ico_exinput *ico_exinput;
41 struct output *output[MAX_DISPLAY];
43 struct surface *surface[MAX_SURFACE];
44 unsigned int init_color;
53 char connect[MAX_CON_NAME + 1];
57 struct display *display;
59 struct wl_pointer *pointer;
60 struct wl_keyboard *keyboard;
63 struct surface *pointer_focus;
64 struct surface *keyboard_focus;
65 uint32_t last_key, last_key_state;
69 struct display *display;
70 struct wl_output *output;
77 struct display *display;
78 struct wl_surface *surface;
79 struct wl_shell_surface *shell_surface;
80 struct output *output;
84 EGLSurface egl_surface;
87 void wayland_dispatch_nonblock(struct wl_display *display);
88 void sleep_with_wayland(struct wl_display *display, int msec);
89 void wait_with_wayland(struct wl_display *display, int msec, int *endflag);
90 int sec_str_2_value(const char *ssec);
91 EGLDisplay opengl_init(struct wl_display *display, EGLConfig *rconf, EGLContext *rctx);
92 EGLSurface opengl_create_window(struct display *display, struct wl_surface *surface,
93 EGLDisplay dpy, EGLConfig conf, EGLContext ctx,
94 const int width, const int height, const unsigned int color,
95 const int displayno, const int posx, const int posy);
96 void opengl_clear_window(const unsigned int color);
97 void opengl_swap_buffer(struct wl_display *display, EGLDisplay dpy, EGLSurface egl_surface);
98 void create_surface(struct display *display, const char *title);
99 void clear_surface(struct surface *surface);
100 void shell_surface_ping(void *data, struct wl_shell_surface *wl_shell_surface, uint32_t serial);
101 void shell_surface_configure(void *data, struct wl_shell_surface *wl_shell_surface,
102 uint32_t edges, int32_t width, int32_t height);
103 void shell_surface_popup_done(void *data, struct wl_shell_surface *wl_shell_surface);
104 void output_handle_geometry(void *data, struct wl_output *wl_output, int x, int y,
105 int physical_width, int physical_height, int subpixel,
106 const char *make, const char *model, int32_t transform);
107 void output_handle_mode(void *data, struct wl_output *wl_output, uint32_t flags,
108 int width, int height, int refresh);
109 void handle_global(void *data, struct wl_registry *registry, uint32_t id,
110 const char *interface, uint32_t version);
111 void surface_enter(void *data, struct wl_surface *wl_surface, struct wl_output *output);
112 void surface_leave(void *data, struct wl_surface *wl_surface, struct wl_output *output);
114 const struct wl_shell_surface_listener shell_surface_listener = {
116 shell_surface_configure,
117 shell_surface_popup_done
120 const struct wl_output_listener output_listener = {
121 output_handle_geometry,
125 const struct wl_registry_listener registry_listener = {
129 const struct wl_surface_listener surface_listener = {
134 #endif /*_CLEAR_SCREEN_H_*/