2020-05-22 16:47:40 +01:00
|
|
|
#
|
|
|
|
# libwebsockets - small server side websockets and web server implementation
|
|
|
|
#
|
lws_display: add display list / DLO support
This adds optional display list support to lws_display, using DLOs (Display
List Objects). DLOs for rectangle / rounded rectangle (with circle as the
degenerate case), PNGs, JPEG and compressed, antialiased bitmapped fonts
and text primitives are provided.
Logical DLOs are instantiated on heap and listed into an lws_display_list
owner, DLOs handle attributes like position, bounding box, colour +
opacity, and local error diffusion backing buffer.
When the display list is complete, it can be rasterized a line at a time,
with scoped error diffusion resolved, such that no allocation for the
framebuffer is required at any point. DLOs are freed as the rasterization
moves beyond their bounding box.
Adds a platform registry binding names and other metadata to lws_display
fonts / PNGs / JPEGs. Provides registration, destruction and best match
selection apis.
2022-01-04 06:00:55 +00:00
|
|
|
# Copyright (C) 2010 - 2022 Andy Green <andy@warmcat.com>
|
2020-05-22 16:47:40 +01:00
|
|
|
#
|
|
|
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
# of this software and associated documentation files (the "Software"), to
|
|
|
|
# deal in the Software without restriction, including without limitation the
|
|
|
|
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
|
|
|
# sell copies of the Software, and to permit persons to whom the Software is
|
|
|
|
# furnished to do so, subject to the following conditions:
|
|
|
|
#
|
|
|
|
# The above copyright notice and this permission notice shall be included in
|
|
|
|
# all copies or substantial portions of the Software.
|
|
|
|
#
|
|
|
|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
|
|
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
|
|
|
# IN THE SOFTWARE.
|
|
|
|
#
|
|
|
|
# The strategy is to only export to PARENT_SCOPE
|
|
|
|
#
|
|
|
|
# - changes to LIB_LIST
|
|
|
|
# - changes to SOURCES
|
|
|
|
# - includes via include_directories
|
|
|
|
#
|
|
|
|
# and keep everything else private
|
|
|
|
|
|
|
|
include_directories(.)
|
2021-08-25 09:35:07 +01:00
|
|
|
if (NOT LWS_ONLY_SSPC)
|
2020-05-22 16:47:40 +01:00
|
|
|
list(APPEND SOURCES
|
|
|
|
misc/base64-decode.c
|
2021-03-16 13:32:05 +00:00
|
|
|
misc/prng.c
|
2020-05-22 16:47:40 +01:00
|
|
|
misc/lws-ring.c)
|
|
|
|
|
2021-05-26 09:13:03 +01:00
|
|
|
if (LWS_WITH_NETWORK)
|
|
|
|
list(APPEND SOURCES
|
|
|
|
misc/cache-ttl/lws-cache-ttl.c
|
|
|
|
misc/cache-ttl/heap.c
|
|
|
|
)
|
|
|
|
|
|
|
|
if (LWS_WITH_CACHE_NSCOOKIEJAR)
|
|
|
|
list(APPEND SOURCES
|
|
|
|
misc/cache-ttl/file.c)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
endif()
|
|
|
|
|
2022-02-18 13:59:17 +00:00
|
|
|
if (LWS_WITH_COMPRESSED_BACKTRACES)
|
|
|
|
list(APPEND SOURCES
|
|
|
|
misc/backtrace.c)
|
|
|
|
endif()
|
|
|
|
|
2020-05-22 16:47:40 +01:00
|
|
|
if (LWS_WITH_FTS)
|
|
|
|
list(APPEND SOURCES
|
|
|
|
misc/fts/trie.c
|
|
|
|
misc/fts/trie-fd.c)
|
|
|
|
endif()
|
|
|
|
|
2022-03-01 17:29:24 +00:00
|
|
|
if (LWS_WITH_GZINFLATE)
|
|
|
|
list(APPEND SOURCES
|
|
|
|
misc/upng-gzip.c)
|
|
|
|
endif()
|
|
|
|
|
2021-12-27 14:41:26 +00:00
|
|
|
if (LWS_WITH_UPNG)
|
|
|
|
list(APPEND SOURCES
|
|
|
|
misc/upng.c)
|
|
|
|
endif()
|
2022-01-23 19:17:20 +00:00
|
|
|
if (LWS_WITH_JPEG)
|
|
|
|
list(APPEND SOURCES
|
|
|
|
misc/jpeg.c)
|
|
|
|
endif()
|
|
|
|
|
2021-12-27 14:41:26 +00:00
|
|
|
|
lws_display: add display list / DLO support
This adds optional display list support to lws_display, using DLOs (Display
List Objects). DLOs for rectangle / rounded rectangle (with circle as the
degenerate case), PNGs, JPEG and compressed, antialiased bitmapped fonts
and text primitives are provided.
Logical DLOs are instantiated on heap and listed into an lws_display_list
owner, DLOs handle attributes like position, bounding box, colour +
opacity, and local error diffusion backing buffer.
When the display list is complete, it can be rasterized a line at a time,
with scoped error diffusion resolved, such that no allocation for the
framebuffer is required at any point. DLOs are freed as the rasterization
moves beyond their bounding box.
Adds a platform registry binding names and other metadata to lws_display
fonts / PNGs / JPEGs. Provides registration, destruction and best match
selection apis.
2022-01-04 06:00:55 +00:00
|
|
|
if (LWS_WITH_DLO)
|
|
|
|
list(APPEND SOURCES
|
|
|
|
misc/dlo/dlo.c
|
|
|
|
misc/dlo/dlo-rect.c
|
|
|
|
misc/dlo/dlo-font-mcufont.c
|
|
|
|
misc/dlo/dlo-text.c)
|
|
|
|
|
2021-12-29 19:24:05 +00:00
|
|
|
if (LWS_WITH_SECURE_STREAMS AND LWS_WITH_CLIENT)
|
|
|
|
list(APPEND SOURCES
|
|
|
|
misc/dlo/dlo-ss.c)
|
|
|
|
endif()
|
lws_display: add display list / DLO support
This adds optional display list support to lws_display, using DLOs (Display
List Objects). DLOs for rectangle / rounded rectangle (with circle as the
degenerate case), PNGs, JPEG and compressed, antialiased bitmapped fonts
and text primitives are provided.
Logical DLOs are instantiated on heap and listed into an lws_display_list
owner, DLOs handle attributes like position, bounding box, colour +
opacity, and local error diffusion backing buffer.
When the display list is complete, it can be rasterized a line at a time,
with scoped error diffusion resolved, such that no allocation for the
framebuffer is required at any point. DLOs are freed as the rasterization
moves beyond their bounding box.
Adds a platform registry binding names and other metadata to lws_display
fonts / PNGs / JPEGs. Provides registration, destruction and best match
selection apis.
2022-01-04 06:00:55 +00:00
|
|
|
|
2022-02-14 09:01:28 +00:00
|
|
|
if (LWS_WITH_UPNG)
|
2021-12-29 19:24:05 +00:00
|
|
|
list(APPEND SOURCES
|
|
|
|
misc/dlo/dlo-png.c)
|
|
|
|
endif()
|
lws_display: add display list / DLO support
This adds optional display list support to lws_display, using DLOs (Display
List Objects). DLOs for rectangle / rounded rectangle (with circle as the
degenerate case), PNGs, JPEG and compressed, antialiased bitmapped fonts
and text primitives are provided.
Logical DLOs are instantiated on heap and listed into an lws_display_list
owner, DLOs handle attributes like position, bounding box, colour +
opacity, and local error diffusion backing buffer.
When the display list is complete, it can be rasterized a line at a time,
with scoped error diffusion resolved, such that no allocation for the
framebuffer is required at any point. DLOs are freed as the rasterization
moves beyond their bounding box.
Adds a platform registry binding names and other metadata to lws_display
fonts / PNGs / JPEGs. Provides registration, destruction and best match
selection apis.
2022-01-04 06:00:55 +00:00
|
|
|
|
2022-02-14 09:01:28 +00:00
|
|
|
if (LWS_WITH_JPEG)
|
2021-12-29 19:24:05 +00:00
|
|
|
list(APPEND SOURCES
|
|
|
|
misc/dlo/dlo-jpeg.c)
|
|
|
|
endif()
|
|
|
|
|
2022-02-14 09:01:28 +00:00
|
|
|
if (LWS_WITH_LHP)
|
2021-12-29 19:24:05 +00:00
|
|
|
list(APPEND SOURCES
|
|
|
|
misc/dlo/dlo-lhp.c
|
|
|
|
)
|
|
|
|
endif()
|
lws_display: add display list / DLO support
This adds optional display list support to lws_display, using DLOs (Display
List Objects). DLOs for rectangle / rounded rectangle (with circle as the
degenerate case), PNGs, JPEG and compressed, antialiased bitmapped fonts
and text primitives are provided.
Logical DLOs are instantiated on heap and listed into an lws_display_list
owner, DLOs handle attributes like position, bounding box, colour +
opacity, and local error diffusion backing buffer.
When the display list is complete, it can be rasterized a line at a time,
with scoped error diffusion resolved, such that no allocation for the
framebuffer is required at any point. DLOs are freed as the rasterization
moves beyond their bounding box.
Adds a platform registry binding names and other metadata to lws_display
fonts / PNGs / JPEGs. Provides registration, destruction and best match
selection apis.
2022-01-04 06:00:55 +00:00
|
|
|
|
|
|
|
endif() #dlo
|
|
|
|
|
2021-05-26 09:13:03 +01:00
|
|
|
# this is an older, standalone hashed disk cache
|
|
|
|
# implementation unrelated to lws-cache-ttl
|
2020-05-22 16:47:40 +01:00
|
|
|
if (LWS_WITH_DISKCACHE)
|
|
|
|
list(APPEND SOURCES
|
|
|
|
misc/diskcache.c)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if (LWS_WITH_STRUCT_JSON)
|
|
|
|
list(APPEND SOURCES
|
|
|
|
misc/lws-struct-lejp.c)
|
|
|
|
endif()
|
|
|
|
|
2020-05-09 09:37:53 +01:00
|
|
|
if (LWS_WITH_JSONRPC)
|
|
|
|
list(APPEND SOURCES
|
|
|
|
misc/jrpc/jrpc.c)
|
|
|
|
include_directories(misc/jrpc)
|
|
|
|
endif()
|
|
|
|
|
2020-05-22 16:47:40 +01:00
|
|
|
if (LWS_WITH_STRUCT_SQLITE3)
|
|
|
|
list(APPEND SOURCES
|
|
|
|
misc/lws-struct-sqlite.c)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if (LWS_WITH_FSMOUNT AND ${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
|
|
|
|
list(APPEND SOURCES misc/fsmount.c)
|
|
|
|
endif()
|
|
|
|
|
2021-08-30 10:20:07 +01:00
|
|
|
if (LWS_WITH_DIR AND NOT LWS_PLAT_BAREMETAL)
|
2020-05-22 16:47:40 +01:00
|
|
|
list(APPEND SOURCES misc/dir.c)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if (LWS_WITH_THREADPOOL AND LWS_HAVE_PTHREAD_H)
|
|
|
|
list(APPEND SOURCES misc/threadpool/threadpool.c)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if (LWS_WITH_PEER_LIMITS)
|
|
|
|
list(APPEND SOURCES
|
|
|
|
misc/peer-limits.c)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if (LWS_WITH_LWSAC)
|
|
|
|
list(APPEND SOURCES
|
2020-07-02 15:38:53 +01:00
|
|
|
misc/lwsac/lwsac.c)
|
2021-08-30 10:20:07 +01:00
|
|
|
if (NOT LWS_PLAT_FREERTOS AND NOT LWS_PLAT_BAREMETAL)
|
2020-07-02 15:38:53 +01:00
|
|
|
list(APPEND SOURCES
|
|
|
|
misc/lwsac/cached-file.c)
|
|
|
|
endif()
|
2020-09-28 10:13:39 +01:00
|
|
|
if (LWS_WITH_SECURE_STREAMS_CPP)
|
|
|
|
list(APPEND SOURCES misc/lwsac/lwsac.cxx)
|
|
|
|
endif()
|
2020-05-22 16:47:40 +01:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if (NOT LWS_WITHOUT_BUILTIN_SHA1)
|
|
|
|
list(APPEND SOURCES
|
|
|
|
misc/sha-1.c)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if (LWS_WITH_LEJP)
|
|
|
|
list(APPEND SOURCES
|
|
|
|
misc/lejp.c)
|
|
|
|
endif()
|
2021-06-30 04:58:25 +01:00
|
|
|
if (LWS_WITH_CBOR)
|
|
|
|
list(APPEND SOURCES
|
|
|
|
misc/lecp.c
|
|
|
|
misc/ieeehalfprecision.c)
|
|
|
|
endif()
|
lhp: Lightweight HTML Parser
Introduce a very lightweight html5 + css2.1+ stateful stream parser, along
the same lines as the lws json and cbor ones.
This is interesting primarily because of just how low-resource it is for
modest css + html, it uses an lwsac to hold the entirity of the css in
memory at once but the html is parsed in chunks without any need to keep
previous chunks around (chunks may be as small as 1 byte).
A user callback receives element entry and exit callbacks with payload and
all attributes parsed out, CSS related to the active element stack is
parsed to provide a list of active css attributes, which takes heap for the
duration of the parsing.
In effect this provides rich information about the html and css state to
the callback, which has the job of producing the layout in a user-defined
way.
As such, there is no DOM in memory at one time, there is only a stack of
active elements like <html><body><div>xxx with their associated attributes
(like class). So as it is, it does not support DOM modification such as
JS changing elements after parsing, although elements with interesting IDs
could be kept around by the callback. There is a corresponding tiny and
relatively flat heap usage regardless of html size.
Default CSS is specified as recommended in the CSS 2.1 standard.
Inline <style></style> elements are supported, but not pre-html5 style= in
element attributes, since these are incompatible with strict CSP.
What the attributes should mean on your system, eg, font-size, font-family
etc is left for the user callback to decide, along with how to lay out the
items using the CSS attributes, and render them.
Fixed point 32.32 constants are used (fraction expressed at parts in 100M)
instead of floating point.
If you have presentation needs, even on a constrained display on a
constrained microcontroller, this makes it feasible to use standardized
markup and styling instead of roll your own.
2021-12-19 19:10:20 +00:00
|
|
|
if (LWS_WITH_LHP)
|
|
|
|
list(APPEND SOURCES
|
|
|
|
misc/lhp.c)
|
|
|
|
|
|
|
|
if (LWS_WITH_SECURE_STREAMS)
|
|
|
|
list(APPEND SOURCES
|
|
|
|
misc/lhp-ss.c)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
endif()
|
2021-06-30 04:58:25 +01:00
|
|
|
|
2020-05-22 16:47:40 +01:00
|
|
|
if (UNIX)
|
|
|
|
if (NOT LWS_HAVE_GETIFADDRS)
|
|
|
|
list(APPEND HDR_PRIVATE misc/getifaddrs.h)
|
|
|
|
list(APPEND SOURCES misc/getifaddrs.c)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if (NOT WIN32 AND NOT LWS_WITHOUT_DAEMONIZE)
|
|
|
|
list(APPEND SOURCES
|
|
|
|
misc/daemonize.c)
|
|
|
|
endif()
|
|
|
|
|
2021-08-25 09:35:07 +01:00
|
|
|
endif()
|
2020-05-22 16:47:40 +01:00
|
|
|
#
|
|
|
|
# Keep explicit parent scope exports at end
|
|
|
|
#
|
|
|
|
|
|
|
|
exports_to_parent_scope()
|