Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

STM Backend support #57

Merged
merged 20 commits into from
May 26, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions Source/WPE/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ if (USE_WPE_BACKEND_INTEL_CE)
add_definitions(-DWPE_BACKEND_INTEL_CE=1)
endif ()

if (USE_WPE_BACKEND_STM)
add_definitions(-DWPE_BACKEND_STM=1)
endif ()

if (USE_WPE_BACKEND_WESTEROS)
find_package(westeros REQUIRED)
add_definitions(-DWPE_BACKEND_WESTEROS=1)
Expand Down Expand Up @@ -71,6 +75,7 @@ set(WPE_INCLUDE_DIRECTORIES
"${CMAKE_SOURCE_DIR}/Source/WPE/Source/Graphics/GBM"
"${CMAKE_SOURCE_DIR}/Source/WPE/Source/Graphics/IntelCE"
"${CMAKE_SOURCE_DIR}/Source/WPE/Source/Graphics/Westeros"
"${CMAKE_SOURCE_DIR}/Source/WPE/Source/Graphics/STM"
"${CMAKE_SOURCE_DIR}/Source/WPE/Source/Input"
"${CMAKE_SOURCE_DIR}/Source/WPE/Source/Pasteboard"
"${CMAKE_SOURCE_DIR}/Source/WPE/Source/Pasteboard"
Expand All @@ -84,6 +89,7 @@ set(WPE_INCLUDE_DIRECTORIES
"${CMAKE_SOURCE_DIR}/Source/WPE/Source/ViewBackend/Wayland"
"${CMAKE_SOURCE_DIR}/Source/WPE/Source/ViewBackend/Wayland/Protocols"
"${CMAKE_SOURCE_DIR}/Source/WPE/Source/ViewBackend/Westeros"
"${CMAKE_SOURCE_DIR}/Source/WPE/Source/ViewBackend/STM"
${BCM_HOST_INCLUDE_DIRS}
${GDL_INCLUDE_DIRS}
${GLIB_INCLUDE_DIRS}
Expand Down Expand Up @@ -131,6 +137,7 @@ if (USE_WPE_BACKEND_BCM_NEXUS)

Source/ViewBackend/BCMNexus/ViewBackendBCMNexus.cpp
)
list(APPEND WPE_LIBRARIES nxclient)
endif ()

if (USE_WPE_BACKEND_BCM_RPI)
Expand All @@ -140,6 +147,7 @@ if (USE_WPE_BACKEND_BCM_RPI)

Source/ViewBackend/BCMRPi/ViewBackendBCMRPi.cpp
)
list(APPEND WPE_LIBRARIES nxclient)
endif ()

if (USE_WPE_BACKEND_INTEL_CE)
Expand Down Expand Up @@ -176,6 +184,21 @@ if (USE_WPE_BACKEND_WESTEROS)
)
endif ()

if (USE_WPE_BACKEND_STM)
list(APPEND WPE_INCLUDE_DIRECTORIES
${STM_INCLUDE_DIRS}
${STMEGL_INCLUDE_DIRS}
)
list(APPEND WPE_LIBRARIES
${STM_LIBRARIES}
${STMEGL_LIBRARIES}
)
list(APPEND WPE_SOURCES
Source/Graphics/STM/RenderingBackendSTM.cpp
Source/ViewBackend/STM/ViewBackendSTM.cpp
)
endif ()

if (USE_WPE_BUFFER_MANAGEMENT_GBM)
list(APPEND WPE_INCLUDE_DIRECTORIES
"${CMAKE_SOURCE_DIR}/Source/WPE/Source/Graphics/GBM"
Expand Down
36 changes: 34 additions & 2 deletions Source/WPE/Headers/WPE/Input/Events.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,17 @@ struct KeyboardEvent {
uint32_t unicode;
bool pressed;
uint8_t modifiers;

KeyboardEvent(){}
KeyboardEvent(uint32_t in_time, uint32_t in_keyCode, uint32_t in_unicode, bool in_pressed, uint8_t in_modifiers)
: time(in_time)
, keyCode(in_keyCode)
, unicode(in_unicode)
, pressed(in_pressed)
, modifiers(in_modifiers)
{
}

};

struct PointerEvent {
Expand All @@ -70,12 +81,23 @@ struct PointerEvent {
uint32_t state;
};

Type type;
uint32_t type;
uint32_t time;
int x;
int y;
uint32_t button;
uint32_t state;
PointerEvent() {}
PointerEvent(uint32_t in_type, uint32_t in_time, int in_x, int in_y, uint32_t in_button, uint32_t in_state)
: type(in_type)
, time(in_time)
, x(in_x)
, y(in_y)
, button(in_button)
, state(in_state)
{
}

};

struct AxisEvent {
Expand All @@ -91,12 +113,22 @@ struct AxisEvent {
int32_t value;
};

Type type;
uint32_t type;
uint32_t time;
int x;
int y;
uint32_t axis;
int32_t value;
AxisEvent() {}
AxisEvent(uint32_t in_type, uint32_t in_time, int in_x, int in_y, uint32_t in_axis, int32_t in_value)
: type(in_type)
, time(in_time)
, x(in_x)
, y(in_y)
, axis(in_axis)
, value(in_value)
{
}
};

struct TouchEvent {
Expand Down
3 changes: 3 additions & 0 deletions Source/WPE/Headers/WPE/ViewBackend/ViewBackend.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ namespace WPE {

namespace Input {
class Client;
struct KeyboardEvent;
struct PointerEvent;
struct AxisEvent;
}

namespace ViewBackend {
Expand Down
9 changes: 9 additions & 0 deletions Source/WPE/Source/Graphics/RenderingBackend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include "RenderingBackendBCMNexus.h"
#include "RenderingBackendBCMRPi.h"
#include "RenderingBackendIntelCE.h"
#include "RenderingBackendSTM.h"
#include <cstdio>

#if WPE_BUFFER_MANAGEMENT(GBM)
Expand All @@ -47,6 +48,10 @@
#include "RenderingBackendWesteros.h"
#endif

#if WPE_BACKEND(STM)
#include "RenderingBackendSTM.h"
#endif

namespace WPE {

namespace Graphics {
Expand Down Expand Up @@ -84,6 +89,10 @@ std::unique_ptr<RenderingBackend> RenderingBackend::create(const uint8_t* data,
return std::unique_ptr<RenderingBackendWesteros>(new RenderingBackendWesteros);
#endif

#if WPE_BACKEND(STM)
return std::unique_ptr<RenderingBackendSTM>(new RenderingBackendSTM);
#endif

fprintf(stderr, "RenderingBackend: no usable backend found, will crash.\n");
return nullptr;
}
Expand Down
Loading