Support drawing widgets by interpreting an external SVG definition

Desktop / LibreOffice - Tomaž Vajngerl [collabora.co.uk] - 6 March 2019 18:36 EST

This uses SvgDrawVisitor and draw commands to draw widgets from an "external" SVG file. The difference to normal SVG drawing is that the shapes are adjusted and not just resized to the widget size. The result of such adjusted drawing is that the margins are preserved exactly just the dimensions of the shapes is adjusted to the desired size (if the shape bounding rectangle starts at {5,5}, so will also when it is adjusted), also the stroke widths are completely preserved.

This enables us to use SVG to define also for dynamic widgets, like for example entry fields, listboxes, comboboxes,... which
vary in size - depending on the dialog definition.

Change-Id: I26fc9a37539d3675a77b48660d235a8a55b81156 Reviewed-on: https://gerrit.libreoffice.org/68816

f7ea15720d4a Support drawing widgets by interpreting an external SVG definition
vcl/inc/widgetdraw/WidgetDefinition.hxx | 17 +++-
vcl/source/gdi/FileDefinitionWidgetDraw.cxx | 143 ++++++++++++++++++++++++++++
vcl/source/gdi/WidgetDefinition.cxx | 9 +-
vcl/source/gdi/WidgetDefinitionReader.cxx | 6 ++
4 files changed, 172 insertions(+), 3 deletions(-)

Upstream: cgit.freedesktop.org


  • Share