From e257ac37d3738ebd38c90f17feaf03b529320b0b Mon Sep 17 00:00:00 2001 From: Emmeran Seehuber Date: Sun, 12 Mar 2017 17:53:27 +0100 Subject: [PATCH] Define the ObjectDrawer interface (first version) --- .../com/openhtmltopdf/extend/FSObjectDrawer.java | 12 ++++++++++++ .../extend/FSObjectDrawerFactory.java | 14 ++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 openhtmltopdf-core/src/main/java/com/openhtmltopdf/extend/FSObjectDrawer.java create mode 100644 openhtmltopdf-core/src/main/java/com/openhtmltopdf/extend/FSObjectDrawerFactory.java diff --git a/openhtmltopdf-core/src/main/java/com/openhtmltopdf/extend/FSObjectDrawer.java b/openhtmltopdf-core/src/main/java/com/openhtmltopdf/extend/FSObjectDrawer.java new file mode 100644 index 000000000..5eae07a51 --- /dev/null +++ b/openhtmltopdf-core/src/main/java/com/openhtmltopdf/extend/FSObjectDrawer.java @@ -0,0 +1,12 @@ +package com.openhtmltopdf.extend; + +import com.openhtmltopdf.render.RenderingContext; +import org.w3c.dom.Element; + +/** + * Handle the drawing of <object> tags + */ +public interface FSObjectDrawer { + void drawObject(Element e, float x, float y, float width, float height, OutputDevice outputDevice, + RenderingContext ctx); +} diff --git a/openhtmltopdf-core/src/main/java/com/openhtmltopdf/extend/FSObjectDrawerFactory.java b/openhtmltopdf-core/src/main/java/com/openhtmltopdf/extend/FSObjectDrawerFactory.java new file mode 100644 index 000000000..15b09c794 --- /dev/null +++ b/openhtmltopdf-core/src/main/java/com/openhtmltopdf/extend/FSObjectDrawerFactory.java @@ -0,0 +1,14 @@ +package com.openhtmltopdf.extend; + +import org.w3c.dom.Element; + +/** + * Factory for ObjectDrawers, i.e. classes which draw <object> tags + */ +public interface FSObjectDrawerFactory { + + /** + * Determine an object drawer for the given object tag element. + */ + FSObjectDrawer createDrawer(Element e); +}