Skip to content

Commit e686e2b

Browse files
committed
Waylandpp
egl resource context Pointer handler Touch handler Keyboard handler Runs on Ubuntu and Raspberry Pi 3
1 parent e48b110 commit e686e2b

File tree

9 files changed

+596
-594
lines changed

9 files changed

+596
-594
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,5 @@ Icon?
3333

3434
*.sublime-workspace
3535
cmake-*/
36+
37+
.vscode

CMakeLists.txt

Lines changed: 36 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ cmake_minimum_required(VERSION 3.5.2)
66

77
project(flutter_wayland)
88

9-
set(FLUTTER_ENGINE_SHA b9523318caa1a99ffde8adaf331212eb879cabc9)
9+
set(FLUTTER_ENGINE_SHA af51afceb8886cc11e25047523c4e0c7e1f5d408)
1010

1111
set(FLUTTER_EMBEDDER_ARTIFACTS_ZIP ${CMAKE_BINARY_DIR}/flutter_embedder_${FLUTTER_ENGINE_SHA}.zip)
1212
set(FLUTTER_ARTIFACTS_ZIP ${CMAKE_BINARY_DIR}/flutter_artifact_${FLUTTER_ENGINE_SHA}.zip)
@@ -37,32 +37,53 @@ if(NOT EXISTS ${FLUTTER_ARTIFACTS_ZIP})
3737
)
3838
endif()
3939

40-
find_package(PkgConfig)
41-
pkg_check_modules(WAYLAND_CLIENT REQUIRED wayland-client)
42-
pkg_check_modules(WAYLAND_EGL REQUIRED wayland-egl)
43-
pkg_check_modules(EGL REQUIRED egl)
40+
set(CMAKE_CXX_STANDARD 14)
4441

45-
# Executable
46-
file(GLOB_RECURSE FLUTTER_WAYLAND_SRC
47-
"src/*.cc"
48-
"src/*.h"
42+
include(FindPkgConfig)
43+
pkg_check_modules(WAYLANDPP_CLIENT REQUIRED "wayland-client++>=0.2.7")
44+
pkg_check_modules(WAYLANDPP_CURSOR REQUIRED "wayland-cursor++>=0.2.7")
45+
pkg_check_modules(WAYLANDPP_EGL REQUIRED "wayland-egl++>=0.2.7")
46+
pkg_check_modules(WAYLANDPP_CLIENT_EXTRA REQUIRED "wayland-client-extra++>=0.2.7")
47+
pkg_check_modules(EGL REQUIRED egl)
48+
pkg_check_modules(OPENGL REQUIRED gl)
49+
pkg_check_modules(XKBCOMMON REQUIRED xkbcommon)
50+
pkg_check_modules(RAPIDJSON REQUIRED "RapidJSON>=1.1.0")
51+
52+
53+
54+
set(FLUTTER_WAYLAND_SRC
55+
src/utils.cc
56+
src/utils.h
57+
src/wayland_display.cc
58+
src/wayland_display.h
59+
src/main.cc
4960
)
5061

5162
link_directories(${CMAKE_BINARY_DIR})
5263

5364
add_executable(flutter_wayland ${FLUTTER_WAYLAND_SRC})
5465

5566
target_link_libraries(flutter_wayland
56-
${WAYLAND_CLIENT_LIBRARIES}
57-
${WAYLAND_EGL_LIBRARIES}
58-
${EGL_LIBRARIES}
5967
flutter_engine
68+
${WAYLANDPP_CLIENT_LIBRARIES}
69+
${WAYLANDPP_EGL_LIBRARIES}
70+
${WAYLANDPP_CURSOR_LIBRARIES}
71+
${WAYLANDPP_CLIENT_EXTRA_LIBRARIES}
72+
${XKBCOMMON_LIBRARIES}
73+
${RAPIDJSON_LIBRARIES}
74+
${EGL_LDFLAGS}
75+
${OPENGL_LDFLAGS}
6076
)
6177

6278
target_include_directories(flutter_wayland
6379
PRIVATE
64-
${WAYLAND_CLIENT_INCLUDE_DIRS}
65-
${WAYLAND_EGL_INCLUDE_DIRS}
66-
${EGL_INCLUDE_DIRS}
80+
${WAYLANDPP_CLIENT_INCLUDE_DIRS}
81+
${WAYLANDPP_CURSOR_INCLUDE_DIRS}
82+
${WAYLANDPP_EGL_INCLUDE_DIRS}
83+
${WAYLANDPP_CLIENT_EXTRA_INCLUDE_DIRS}
84+
${RAPIDJSON_INCLUDE_DIRS}
85+
${OPENGL_INCLUDE_DIRS}
6786
${CMAKE_BINARY_DIR}
6887
)
88+
89+
target_compile_options(flutter_wayland PUBLIC ${EGL_CFLAGS})

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Flutter Wayland
33

44
A Flutter Embedder that talks to Wayland.
55

6-
![Running in Weston](assets/image.png)
6+
![Running in Weston](assets/ubuntu_wayland_18.0.4.png)
77

88
Build Setup Instructions
99
------------------------

assets/ubuntu_wayland_18.0.4.png

28 MB
Loading

src/flutter_application.cc

Lines changed: 0 additions & 185 deletions
This file was deleted.

src/flutter_application.h

Lines changed: 0 additions & 54 deletions
This file was deleted.

src/main.cc

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
#include <string>
88
#include <vector>
99

10-
#include "flutter_application.h"
1110
#include "utils.h"
1211
#include "wayland_display.h"
1312

@@ -55,27 +54,27 @@ static bool Main(std::vector<std::string> args) {
5554
return false;
5655
}
5756

58-
const size_t kWidth = 800;
59-
const size_t kHeight = 600;
57+
const size_t kWidth = 640;
58+
const size_t kHeight = 480;
6059

6160
for (const auto& arg : args) {
62-
FLWAY_ERROR << "Arg: " << arg << std::endl;
61+
FLWAY_LOG << "Arg: " << arg << std::endl;
6362
}
6463

65-
WaylandDisplay display(kWidth, kHeight);
64+
WaylandDisplay display(kWidth, kHeight, asset_bundle_path, args);
6665

6766
if (!display.IsValid()) {
6867
FLWAY_ERROR << "Wayland display was not valid." << std::endl;
6968
return false;
7069
}
7170

72-
FlutterApplication application(asset_bundle_path, args, display);
73-
if (!application.IsValid()) {
71+
display.InitializeApplication(asset_bundle_path, args);
72+
if (!display.IsValid()) {
7473
FLWAY_ERROR << "Flutter application was not valid." << std::endl;
7574
return false;
7675
}
7776

78-
if (!application.SetWindowSize(kWidth, kHeight)) {
77+
if (!display.SetWindowSize(kWidth, kHeight)) {
7978
FLWAY_ERROR << "Could not update Flutter application size." << std::endl;
8079
return false;
8180
}

0 commit comments

Comments
 (0)