Git Product home page Git Product logo

libwpe's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

libwpe's Issues

Build failure with macos

Trying to build this project in osx, but failed with finding EGL/eglplatform.h

Run-time dependency egl found: NO (tried pkgconfig, framework and cmake)
Has header "EGL/eglplatform.h" : NO

meson.build:64:1: ERROR: Assert failed: Required header <EGL/eglplatform.h> not found

Is this dependency issue or packaging issue (should the release artifact include EGL/eglplatform.h). Thanks!

Meson: Built documentation seems empty

Using Meson to build results in empty documentation. This can be reproduced with:

meson build -Dbuild-docs=true
ninja -C build
$BROWSER build/libwpe-doc/html/index.html

On the other hand, using CMake results in usable documentation.

Consider enforcing single-header include

We should consider enforcing a single-header include strategy, to avoid making the layout of our installed headers API. E.g. it would be nice to be able to remove headers in the future, or move declarations between headers, without having to increase the WPEBackend API version.

If there are particular headers that would not be desirable in a single-header include, they can be split out separately.

Doesn't include tests

We are working on building Webkitgtk with WPE in Ubuntu, which requires to promote libwpe to main. Our review process strongly recommends for new components to have tests which isn't the case today for libwpe. While the runtime is covered by the webkitgtk tests it would be nice to also have some unittest that could be done at buildtime in libwpe.

Generate Unicode↔Keysym tables

It would be desirable to generate unicode_to_keysym_table and keysym_to_unicode_table from a single source e.g. using a script, to avoid them having different or missing entries—for example, see #53 for an example of such a situation.

Use an export macro

Currently libwpe just uses __attribute__((visibility("default"))) for exports. This doesn't work on all platforms such as windows.

Consider renaming

The name WPEBackend is problematic because it sounds like a backend, not a dependency of the actual backends. Even people who would be expected to have some experience with WPE fail to understand this, and that's reasonable since you would certainly expect it to be a backend.

I think we've discussed this in the past and decided to keep the name, but it's a bad name and should be corrected before the damage becomes too great. E.g. we have a Fedora package now wpebackend, but it's new: changing the package name now would be less problematic than waiting a couple years and then changing it.

Setting zero as device scale factor wrecks havoc

Reported by @philn in Igalia/cog#384 (comment):

Also, shouldn't wpe_view_backend_dispatch_set_device_scale_factor() return an error or something when it receives a 0 factor? Because that's wrecking havoc :)

Probably we should check that the requested scaling factor is between reasonable limits, because I do not expect good things to happen by setting it too big either.

1.13.2: missig pkgconfig dependency

Just found that webkitgtk failed on missing xkbcommon. header file.

In file included from /usr/include/wpe-1.0/wpe/wpe.h:38,
                 from /usr/include/wpe-1.0/wpe/wpe-egl.h:37,
                 from /home/tkloczko/rpmbuild/BUILD/webkitgtk-2.36.3/Source/WebCore/platform/graphics/egl/GLContextEGLLibWPE.cpp:39:
/usr/include/wpe-1.0/wpe/input-xkb.h:48:10: fatal error: xkbcommon/xkbcommon.h: No such file or directory
   48 | #include <xkbcommon/xkbcommon.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.

And indeed wpe-1.pc file has no Requires: xkbcommon line.

[tkloczko@devel-g2v SPECS]$ rpm -ql libwpe-devel | grep include.*.h$ | xargs grep -h \#include|sort | uniq
#include "export.h"
#include "gamepad.h"
#include "input.h"
#include "input-xkb.h"
#include "keysyms.h"
#include "libwpe-version.h"
#include "loader.h"
#include "pasteboard.h"
#include "renderer-backend-egl.h"
#include "renderer-host.h"
#include <stdbool.h>
#include <stdint.h>
#include "version-deprecated.h"
#include "version.h"
#include "view-backend.h"
#include <wpe/export.h>
#include "wpe.h"
#include <xkbcommon/xkbcommon-compose.h>
#include <xkbcommon/xkbcommon.h>

As wpe iuses xkbcommon headers it should depend on in pkgconfig description

Add compiler warnings

libwpe should enable some compiler warnings. -Wall at minimum, and maybe also -Wextra.

Make all public structs opaque

We should make structs in the public API opaque in order to make it possible to add new members without breaking the ABI. E.g.:

struct wpe_input_keyboard_event {
    uint32_t time;
    uint32_t keyCode;
    uint32_t unicode;
    bool pressed;
    uint8_t modifiers;
};

Instead of exposing the contents of the struct, we would expose getter and setter functions: wpe_input_keyboard_event_get_time(), wpe_input_keyboard_event_set_time(), etc.

Since this is a bigger change, I don't think it has to block the first release, but we should do it before a 1.0 release IMO.

Add padding to vtables

We should add padding to the vtables in our public API, to avoid unnecessary ABI breaks down the road.

Should use memory allocation routines that crash on failure, or properly handle allocation failures

When running cppcheck, Ubuntu Security Team noticed a memory leak if realloc() fails:

src/input.c:231:29: error: Common realloc mistake: 'array' nulled but not freed upon failure [memleakOnRealloc]
                            array = (struct wpe_input_xkb_keymap_entry*)realloc(array, array_allocated_size * sizeof(struct wpe_input_xkb_keymap_entry));

"If realloc fails, the array pointer will become NULL and the old allocation will be lost (memory leak)." Nowadays this code lives in input-xbc.c, line 234.

Problem is, it's not just here. Other code in libwpe is not prepared for calloc() to fail. It's probably best to switch to memory allocation routines that crash if they fail so you don't have to check every single allocation for failure. I notice libwpe does not depend on GLib, but safer GLib equivalents would be g_realloc() or g_new0(). Easy enough to write your own wrapper, though.

(Interestingly, I checked wpebackend-fdo and it does not appear to have the same issue.)

Add .gitignore

Since CMake allows in-tree builds, libwpe should have a .gitignore:

Untracked files:
  (use "git add <file>..." to include in what will be committed)

	CMakeCache.txt
	CMakeFiles/
	DerivedSources/
	Makefile
	cmake_install.cmake
	libwpe-1.0.so
	libwpe-1.0.so.1
	libwpe-1.0.so.1.2.1
	wpe-1.0.pc

Allow specifying which shared object to load as WPE backend

This would allow a launcher/embedder to specify which WPE backend to use. This would remove the need to have a libWPEBackend-default.so file, and allows launchers which are implemented to work with some specific WPE backend to set the one to use instead of inadvertently loading the wrong one and failing in mysterious ways.

See Igalia/cog#11 for more of the the motivation for requesting this.

Install files properly

WPEBackend installs files into hardcoded locations, like lib/ and include/.

lib/ is particularly egregious since that's almost never the right place to install libraries. It works for us in our JHBuild development environment because JHBuild doesn't use multiarch (like Debian) or lib64 (like everywhere else).

tip-of-tree does not compile (cmake configuration failure)

Hi!

I'm trying to compile tip-of-tree libwpe on Ubuntu. I do the following steps:

  1. git clone https://github.com/WebPlatformForEmbedded/libwpe
  2. cd libwpe
  3. cmake .

Here is what I get:

aslushnikov:~/prog/libwpe(master)$ cmake .
-- The C compiler identification is GNU 7.4.0
-- The CXX compiler identification is GNU 7.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test CXX_HAS_FLAG_-fno-exceptions
-- Performing Test CXX_HAS_FLAG_-fno-exceptions - Success
-- Performing Test CXX_HAS_FLAG_-fno-rtti
-- Performing Test CXX_HAS_FLAG_-fno-rtti - Success
-- Performing Test CXX_HAS_FLAG_-Wall
-- Performing Test CXX_HAS_FLAG_-Wall - Success
-- Performing Test CC_HAS_FLAG_-Wall
-- Performing Test CC_HAS_FLAG_-Wall - Success
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1")
-- Checking for module 'egl'
--   Found egl, version 19.2.1
CMake Error at cmake/FindEGL.cmake:53 (target_link_libraries):
  Cannot specify link libraries for target "GL::egl" which is not built by
  this project.
Call Stack (most recent call first):
  CMakeLists.txt:51 (find_package)


-- Configuring incomplete, errors occurred!
See also "/home/aslushnikov/prog/libwpe/CMakeFiles/CMakeOutput.log".

Note: this worked fine on version 1.4.0; it looks like this commit changed the EGL discovery somehow and CMake is unhappy.

I tried compiling under clean ubuntu docker image with the same results.

Is this a bug in cmake configuration, or do I miss something?

Thanks!

Add documentation for the public API

As of #41 we have HotDoc wired to the build system, but writing actual documentation is still pending. So let's keep this issue open until we have a good the API reference documentation in place 😉

The original description of the issue follows, for reference.


Probably we would want to use GTK-Doc, which despite the name does not need GTK+ at all. That would allow cross-linking to the WPE WebKit API reference if needed.

Side note: there is an upstream bug to add GTK-Doc support to WPE WebKit as well.

Install loadable backend modules to a separate directory

Filing after some discussion on IRC.
We rely on libWPEBackend-fdo.so-1.0.so being installed in the standard library directory, but distros typically don't install unversioned .so files in the standard library directory except in -devel packages. We should consider moving the plugin to its own directory.

Meson: EGL library compilation flags not passed to compiler

In some cases the pkg-config egl.pc module file may define flags which need to be passed to the compiler, and currently the Meson build system is ignoring them.

A typical situation is having Mesa provide the EGL implementation, but Mesa itself has been compiled without X11 support. In that case egl.pc will contain the following line:

Cflags: -I${includedir} -DEGL_NO_X11    

In this case not passing the compiler flags results in compilation errors if the X11 headers happen to not be installed by chance in the system—which can very easily happen with Yocto and Buildroot, for example.

Procedure for adding new APIs

I'm wondering if there is a procedure for adding new APIs to libWPE.

Currently in WebKit there are a couple instances where I would potentially want to extend WPE's functionality for our PlayStation implementation and I think some things might be general enough to be of use for libWPE in general.

Currently this is what I was thinking for WebCore related functionality.

  • PlatformScreen just has some magic numbers for the screen's attributes.
  • For our User Agent we have stuff about the system software version and other things. Feels like there might be a use for getting some system information.

Can open separate issues for each but wanted to see how something like this might work. Thanks!

Failed to build with libc++: attempt to use a poisoned identifier

Caused by 159851d

In file included from ../libwpe-1.12.2/src/pasteboard-generic.cpp:30:
/usr/include/c++/v1/cstdlib:116:9: error: attempt to use a poisoned identifier
using ::calloc _LIBCPP_USING_IF_EXISTS;
        ^
/usr/include/c++/v1/cstdlib:117:9: error: attempt to use a poisoned identifier
using ::free _LIBCPP_USING_IF_EXISTS;
        ^
/usr/include/c++/v1/cstdlib:118:9: error: attempt to use a poisoned identifier
using ::malloc _LIBCPP_USING_IF_EXISTS;
        ^
/usr/include/c++/v1/cstdlib:119:9: error: attempt to use a poisoned identifier
using ::realloc _LIBCPP_USING_IF_EXISTS;
        ^
In file included from ../libwpe-1.12.2/src/pasteboard-generic.cpp:32:
In file included from /usr/include/c++/v1/map:535:
In file included from /usr/include/c++/v1/__node_handle:63:
In file included from /usr/include/c++/v1/memory:808:
In file included from /usr/include/c++/v1/__functional_base:23:
/usr/include/c++/v1/new:338:5: error: attempt to use a poisoned identifier
  ::free(__ptr);
    ^
In file included from ../libwpe-1.12.2/src/pasteboard-generic.cpp:32:
In file included from /usr/include/c++/v1/map:535:
In file included from /usr/include/c++/v1/__node_handle:63:
In file included from /usr/include/c++/v1/memory:821:
In file included from /usr/include/c++/v1/__memory/shared_ptr.h:35:
In file included from /usr/include/c++/v1/atomic:524:
In file included from /usr/include/c++/v1/__thread/timed_backoff_policy.h:16:
In file included from /usr/include/c++/v1/__threading_support:34:
In file included from /usr/include/pthread.h:30:
/usr/include/sched.h:84:7: error: attempt to use a poisoned identifier
void *calloc(size_t, size_t);
      ^
/usr/include/sched.h:85:6: error: attempt to use a poisoned identifier
void free(void *);
     ^
/usr/include/sched.h:124:36: error: attempt to use a poisoned identifier
#define CPU_ALLOC(n) ((cpu_set_t *)calloc(1,CPU_ALLOC_SIZE(n)))
                                   ^
/usr/include/sched.h:125:23: error: attempt to use a poisoned identifier
#define CPU_FREE(set) free(set)
                      ^
9 errors generated.

Compiler: Clang++ 14.0.6, libc++ 14.0.6

How to resovle the issue during build on ubuntu 16.04?

During I compile, I encounter varied issue listed below.


(1)
https://github.com/WebPlatformForEmbedded/libwpe.git failed with exit code 128, output:
fatal: unable to access 'https://github.com/WebPlatformForEmbedded/libwpe.git/': gnutls_handshake() failed: The TLS connection was non-properly terminated.

(2)
Traceback (most recent call last):
bb.data_smart.ExpansionError: Failure expanding variable SRCPV, expression was ${@bb.fetch2.get_srcrev(d)} which triggered exception FetchError: Fetcher failure for URL: 'git://github.com/WebPlatformForEmbedded/libwpe.git;protocol=https;branch=master'. The command git -c core.fsyncobjectfiles=0 ls-remote https://github.com/WebPlatformForEmbedded/libwpe.git gave empty output unexpectedly

(3)
git -c core.fsyncobjectfiles=0 ls-remote https://github.com/WebPlatformForEmbedded/libwpe.git failed with exit code 128, output:
fatal: unable to access 'https://github.com/WebPlatformForEmbedded/libwpe.git/': Operation timed out after 0 milliseconds with 0 out of 0 bytes received

(4)
git -c core.fsyncobjectfiles=0 ls-remote https://github.com/WebPlatformForEmbedded/libwpe.git failed with exit code 128, output:
error: RPC failed; curl 56 GnuTLS recv error (-9): A TLS packet with unexpected length was received.
fatal: expected flush after ref listing

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.