`
`/*
`"(c) Copyright 1993-1997 Pad++ Consortium {University of New Mexico
`(UNM),
`and New York University (NYU)}, All Rights Reserved."
`Licensee can not remove or obscure any of the
`copyright or trademark notices in this software.
`IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY
`FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
`ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY
`DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE
`POSSIBILITY OF SUCH DAMAGE.
`THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES,
`INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
`FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE
`IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE
`NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR
`MODIFICATIONS.
`See the file "License" for general information on usage and
`redistribution, and the file "LicenseTerms" for the specific license
`agreement on usage and redistribution of this file, and the Pad++
`software in general.
`*/
`#include "defs.h"
`#include "object.h"
`#include "pad.h"
`#include "text.h"
`#include "html.h"
`#include "image.h"
`#include "object.h"
`#include "pad-tcl.h"
`#include "pad-string.h"
`#include "line.h"
`#include "win.h"
`#include "restorer.h"
`#include "group.h"
`#include "callback.h"
`#include "transform.h"
`#include "global.h"
`#include "imagedata.h"
`#include <string.h>
`#include <stdlib.h>
`#include <sys/types.h>
`#include <sys/stat.h>
`#ifdef PAD_UNIX
`# include <unistd.h>
`#endif
`#define HTML_DEFAULT_FILL "gray90"
`
`(cid:3)
`
`SoftView Exhibit 2004-1
`Kyocera Corp. v. SoftView LLC
`IPR2013-00007
`
`
`
`(cid:3)
`
`#define HTML_DEFAULT_BORDER "black"
`#define HTML_DEFAULT_BORDERWIDTH 1
`#define HTML_DEFAULT_DONESCRIPT ""
`#define HTML_DEFAULT_ERRORSCRIPT ""
`#define HTML_DEFAULT_FONT "Line-1.2"
`#define HTML_DEFAULT_URL ""
`#define HTML_DEFAULT_UPDATESCRIPT ""
`#define HTML_DEFAULT_STATE HTML_ANCHOR_UNVISITED
`#define HTML_MIN_SIZE 100
`// The html object itself is really just a wrapper for loading in
`// all kinds of sub-Objects (like text, images, etc.) It gets
`// rendered as the background of the html file.
`//
`// The html object and all of its components are created with pixel
`// coordinates. Text is created one pixel high. Images are
`// scaled down by a factor of 10 (yielding text that is effectively
`// 10 pixels high).
`//
`// The current Position (x_curr_pos, y_curr_pos) indicates the nw corner
`// of each object. x_left_marg represents the left margin.
`static float IMAGE_SIZE = 0.1,
` DUMMY_IMAGE_SIZE = 5.0;
`static char *StartTagArray[] = {
` "html",
` "body",
` "address",
` "h1",
` "h2",
` "h3",
` "h4",
` "h5",
` "h6",
` "p",
` "a",
` "img",
` "ul",
` "li",
` "dl",
` "dt",
` "de",
` "dd",
` "hr",
` "br",
` "title",
` "head",
` "em",
` "i",
` "b",
` "center",
` "menu",
`
`(cid:3)
`
`SoftView Exhibit 2004-2
`Kyocera Corp. v. SoftView LLC
`IPR2013-00007
`
`
`
`(cid:3)
`
` "cite",
` "font",
` "pre",
` "kbd",
` "strong",
` "base",
` "code",
` "ol",
` "!--",
` "form",
` "input",
` ""
`};
`static HTML_TagOrKey tagArray[] = {
` {"html", TAG_HTML},
` {"body", TAG_BODY},
` {"address", TAG_ADDRESS},
` {"h1", TAG_H1},
` {"h2", TAG_H2},
` {"h3", TAG_H3},
` {"h4", TAG_H4},
` {"h5", TAG_H5},
` {"h6", TAG_H6},
` {"p", TAG_P},
` {"a", TAG_A},
` {"img", TAG_IMG},
` {"ul", TAG_UL},
` {"li", TAG_LI},
` {"dl", TAG_DL},
` {"dt", TAG_DT},
` {"de", TAG_DE},
` {"dd", TAG_DD},
` {"hr", TAG_HR},
` {"br", TAG_BR},
` {"title", TAG_TITLE},
` {"head", TAG_HEAD},
` {"em", TAG_EM},
` {"i", TAG_I},
` {"b", TAG_B},
` {"center", TAG_CENTER},
` {"menu", TAG_MENU},
` {"cite", TAG_CITE},
` {"font", TAG_FONT},
` {"pre", TAG_PRE},
` {"kbd", TAG_KBD},
` {"strong", TAG_STRONG},
` {"base", TAG_BASE},
` {"code", TAG_CODE},
` {"ol", TAG_OL},
` {"!--", TAG_COMMENT1},
` {"!---", TAG_COMMENT2},
` {"meta", TAG_META},
` {"textarea", TAG_TEXTAREA},
`
`(cid:3)
`
`SoftView Exhibit 2004-3
`Kyocera Corp. v. SoftView LLC
`IPR2013-00007
`
`
`
`(cid:3)
`
` {"form", TAG_FORM},
` {"input", TAG_INPUT},
` {"table", TAG_TABLE},
` {"tr", TAG_TR},
` {"td", TAG_TD},
` {"th", TAG_TH},
` {"blockquote", TAG_BLOCKQUOTE},
` {"blink",TAG_BLINK},
` {"link", TAG_LINK},
` {"caption", TAG_CAPTION},
` {"header", TAG_HEADER},
` {"", TAG_UNKNOWN},
` {NULL, 0}
`};
`static HTML_TagOrKey keyArray[] = {
` {"href", KEY_HREF},
` {"src", KEY_SRC},
` {"alt", KEY_ALT},
` {"name", KEY_NAME},
` {"align", KEY_ALIGN},
` {"border", KEY_BORDER},
` {"width", KEY_WIDTH},
` {"height", KEY_HEIGHT},
` {"ismap", KEY_ISMAP},
` {"bgcolor",KEY_BGCOLOR},
` {"text", KEY_TEXT},
` {"link", KEY_LINK},
` {"alink", KEY_ALINK},
` {"vlink", KEY_VLINK},
` {"pad_scale", KEY_PAD_SCALE_BEGIN},
` {"/pad_scale", KEY_PAD_SCALE_END},
` {"pad_tcl", KEY_PAD_TCL},
` {"", KEY_UNKNOWN},
` {NULL, 0}
`};
`static Pad_String Token;
`float x_curr_pos,
` y_curr_pos,
` x_left_marg;
`static Pad_Bool Anchor_active = FALSE; // True if creating an anchor
`static HTML_Anchor *Anchor_first; // First anchor component
`static HTML_Anchor *Anchor_current; // Current anchor component
`static Pad_String Anchor_href; // Current anchor href
`static Pad_String Anchor_name; // Current anchor name
`static int NewLine;
` // Number of recent newlines
`static Pad_Bool Title;
` // True if inside Title tag
`static Pad_Bool H1;
`
` // True if inside H1 tag
`static Pad_Bool H2;
`
` // True if inside H2 tag
`static Pad_Bool H3;
`
` // True if inside H3 tag
`static Pad_Bool H4;
`
` // True if inside H4 tag
`
`(cid:3)
`
`SoftView Exhibit 2004-4
`Kyocera Corp. v. SoftView LLC
`IPR2013-00007
`
`
`
`(cid:3)
`
` // True if inside H5 tag
`
`static Pad_Bool H5;
` // True if inside H6 tag
`
`static Pad_Bool H6;
` // True if inside DD tag
`static Pad_Bool HTML_DD;
`static Pad_Bool PreFormatted; // True if inside PRE tag
`static Pad_List LineObjs; // List of objects on the current
`line
`static float DefaultLineSize; // Default space to next line
`static float LineSize;
` // Height of text line
`static float MaxLineSize;
` // Keeps track of how much room to add
`for a newline
`static HTML_EntryTagTcl *Pad_tcl_entry;
`static Pad_Bool LayingOut; // Keeps track of whether we are in
` // Create_display_list() or not. Used for
` // adding Pad_Objects to HTML after
`creation
`// Keeps track of whether we are in
`static Pad_Bool Initializing;
` // Set_url() or not. Used for
` // adding Pad_Objects to HTML after
`creation
`static Pad_List MSML_Scale_list; // The stack of scale items for MSML
`static Pad_List MSML_Left_margin; // The stack of left margins for MSML
`static float MSML_Scale;
` // What the current MSML scale is
`static float HTML_VERTICAL_IMAGE_OFFSET; // Space added to images for
`vertical padding
`//////////////////////////////////////////////////////////////////
`//
`// Support Routines
`//
`//////////////////////////////////////////////////////////////////
`//
`// Maintain stack of scale tags for MSML extension.
`//
`static void
`MSML_Reset_scale(void)
` float *f;
` while ((f = (float *)MSML_Scale_list.Pop())) {
`
`delete f;
` }
` MSML_Scale = 1.0;
`
`{
`
`} s
`
`tatic float
`MSML_Push_scale(float newScale)
` float *f = new float(newScale);
`
`{
`
`(cid:3)
`
`SoftView Exhibit 2004-5
`Kyocera Corp. v. SoftView LLC
`IPR2013-00007
`
`
`
`(cid:3)
`
` MSML_Scale_list.Push(f); // Add new value to top of stack
` return(newScale);
`// Return top of stack value
`
`} s
`
`tatic float
`MSML_Pop_scale(void)
` float *f;
` float tmp;
` f = (float *)MSML_Scale_list.Pop();
` if (f) {
`
`tmp = *f;
`
`delete f;
` } else {
`
`tmp = 1.0;
` }
` return(tmp);
`
`{
`
`// Return the old top of stack
`
`} /
`
`/
`// Maintain stack of left margins
`//
`static void
`MSML_Reset_left_marg(void)
` float *f;
` while ((f = (float *)MSML_Left_margin.Pop())) {
`
`delete f;
` }
` x_left_marg = 0.0;
`
`{
`
`} s
`
`tatic float
`MSML_Push_left_marg(float new_margin)
` float *f = new float(new_margin);
` MSML_Left_margin.Push(f);
`// Add new value to top of stack
` return(new_margin);
`
`// Return top of stack value
`
`{
`
`} s
`
`tatic float
`MSML_Pop_left_marg(void)
` float *f;
` float tmp;
` f = (float *)MSML_Left_margin.Pop();
` if (f) {
`
`delete f;
` }
`
`{
`
`(cid:3)
`
`SoftView Exhibit 2004-6
`Kyocera Corp. v. SoftView LLC
`IPR2013-00007
`
`
`
`(cid:3)
`
` f = (float *)MSML_Left_margin.First();
` if (f) {
`
`tmp = *f;
` } else {
`
`tmp = 0.0;
` }
` return(tmp);
`
`// Return the resulting top of stack
`
`} /
`
`/////////////////////////////////////////////////////////////////
`//
`// Start of Class Definitions
`//
`//////////////////////////////////////////////////////////////////
`HTML::~HTML()
` HTML_Display *d;
` HTML_Entry *e;
` Pad_Object *o;
` Generate_delete();
` if (urlItem) {
`
`pad->Url_cancel(urlItem);
` }
` if (updateScript) {
`
`delete updateScript;
`
`updateScript = NULL;
` }
` if (doneScript) {
`
`delete doneScript;
`
`doneScript = NULL;
` }
` if (errorScript) {
`
`delete errorScript;
`
`errorScript = NULL;
` }
` if (source) {
`
`delete [] source;
`
`source = NULL;
` }
` while ((d = (HTML_Display *)displayList.Pop())) {
`
`delete d;
` }
` while ((e = (HTML_Entry *)entryList.Pop())) {
`
`delete e;
` }
` while ((o = (Pad_Object *)members.Pop())) {
`
`delete o;
`
`{
`
`(cid:3)
`
`SoftView Exhibit 2004-7
`Kyocera Corp. v. SoftView LLC
`IPR2013-00007
`
`
`
`(cid:3)
`
` }
`
`} H
`
`{
`
`TML::HTML(Pad *pad) :
`Pad_Group(pad)
` _type = PAD_HTML;
` htmlFlags = PAD_NO_MASK;
` width = HTML_DEFAULT_WIDTH; // Width of page in characters
` xmin = 0.0;
` ymin = 0.0;
` xmax = 0.0;
` ymax = 0.0;
` inlineImages = 0;
` Set_border_default();
` Set_borderwidth_default();
` Set_fill_default();
` Set_font_default();
` updateScript = NULL;
` doneScript = NULL;
` errorScript = NULL;
` source = NULL;
` sourceIndex = 0;
` sourceSpace = 0;
` urlItem = NULL;
`
`} /
`
`/
`// Callback for when a URL is updated (i.e., more data arrived)
`//
`static Pad_Bool
`HTML_UpdateCB(ClientData clientData, int, char *new_data, int len)
` unsigned char *more_data;
` HTML *html = (HTML *)clientData;
`
`
`
`
`// First call, so get http header data from
`urlItem
` if (html->source == NULL) {
`
`html->docType = html->urlItem->docType;
`
`html->docLastModified = html->urlItem->docLastModified;
`
`html->docLength = html->urlItem->docLength;
`
`if (html->urlItem->docLength > 0) {
`
` html->source = new unsigned char[html->urlItem->docLength + 1];
`
` html->sourceSpace = html->urlItem->docLength;
`
`}
` }
`// Double space if not big enough
`
`
`
`
` if (len > (html->sourceSpace - html->sourceIndex + 1)) {
`
`html->sourceSpace = MAX(len, html->sourceSpace);
`
`{
`
`(cid:3)
`
`SoftView Exhibit 2004-8
`Kyocera Corp. v. SoftView LLC
`IPR2013-00007
`
`
`
`(cid:3)
`
`html->sourceSpace *= 2;
`
`more_data = new unsigned char[html->sourceSpace];
`
`memcpy(more_data, html->source, html->sourceIndex);
`
`delete [] html->source;
`
`html->source = more_data;
`
` }
` memcpy(&html->source[html->sourceIndex], new_data, len);
` html->sourceIndex += len;
` html->source[html->sourceIndex] = '\0';
` return(TRUE);
`
`} /
`
`/
`// Callback for when a URL has completed loading
`//
`static Pad_Bool
`HTML_DoneCB(ClientData clientData, int)
` int index, result;
` Pad_Bool eof;
` HTML *html = (HTML *)clientData;
` HTML_Entry *e;
` Pad_String cmd;
`// Don't do anything if document never retrieved.
`
`
`
`
`// Presumably, the error callback was already
`
`
`
`
`activated.
` if (!html->source) {
`
`return(TRUE);
` }
`// If no document type, then assume it is html
`
`
`
`
` if ((html->docType == "text/html") || (html->docType == "")) {
`
`index = 0;
`
`eof = FALSE;
`
`while (!eof && (e = html->Next_token(index, eof))) {
`
` html->entryList.Push_last(e);
`
`}
` } else if (html->docType == "image/gif" ||
`
` html->docType == "image/jpeg") {
`
`
`
`
`// URL is a GIF or JPEG image
`
`HTML_EntryTagImage *ei;
`
`ei = new HTML_EntryTagImage(NULL, html);
`
`html->entryList.Push_last(ei);
`
`ei->Set_image(Pad_renderer->Alloc_image(html->source, html-
`>sourceIndex));
`
`
`
`
`// No need to keep image source around
`
`delete [] html->source;
`
`html->source = NULL;
`
`html->sourceSpace = 0;
`
`html->sourceIndex = 0;
` }
` html->Create_display_list();
`
`{
`
`(cid:3)
`
`SoftView Exhibit 2004-9
`Kyocera Corp. v. SoftView LLC
`IPR2013-00007
`
`
`
`(cid:3)
`
`// Call 'update' script.
`
`
`
`
` if (html->updateScript) {
`
`cmd = html->updateScript->Get();
`
`cmd += " ";
`
`cmd += html->id;
`
`result = Pad_GlobalEval(html->updateScript->Language(), cmd.Get());
`
`if (result == TCL_ERROR) {
`
` Tcl_AddErrorInfo(html->pad->view->win->interp, "\n (Pad URL
`Fetch)");
`
` Pad_Background_error(html->pad->view->win->interp);
`
`}
` }
`// If no in-line images, then html is loaded, so
`
`
`
`
`call
`// "done" script
`
`
`
`
` if ((html->inlineImages == 0) && (html->doneScript)) {
`
`cmd = html->doneScript->Get();
`
`cmd += " ";
`
`cmd += html->id;
`
`result = Pad_GlobalEval(html->doneScript->Language(), cmd.Get());
`
`if (result == TCL_ERROR) {
`
` Tcl_AddErrorInfo(html->pad->view->win->interp, "\n (Pad URL
`Fetch)");
`
` Pad_Background_error(html->pad->view->win->interp);
`
`}
` }
` html->urlItem = NULL;
` return(TRUE);
`
`} /
`
`/
`// Callback for when there has been an error with the URL
`//
`static Pad_Bool
`HTML_ErrorCB(ClientData clientData, int, char *, int)
` int result;
` HTML *html = (HTML *)clientData;
` Pad_String cmd;
`
`
`
`
`// Call 'error' script.
` if (html->errorScript) {
`
`cmd = html->errorScript->Get();
`
`cmd += " ";
`
`cmd += html->id;
`
`result = Pad_GlobalEval(html->errorScript->Language(), cmd.Get());
`
`if (result == TCL_ERROR) {
`
` Tcl_AddErrorInfo(html->pad->view->win->interp, "\n (Pad URL
`Fetch)");
`
` Pad_Background_error(html->pad->view->win->interp);
`
`}
`
`{
`
`(cid:3)
`
`SoftView Exhibit 2004-10
`Kyocera Corp. v. SoftView LLC
`IPR2013-00007
`
`
`
`(cid:3)
`
` }
` return(TRUE);
`
`} /
`
`/
`// Returns true if object needs more refinement.
`//
`Pad_Bool
`HTML::Continue_refinement(void)
` return(refineNeeded);
`
`{
`
`} /
`
`/
`// Set the object's <option> to the value specified by <sval>.
`// Note that each option has a specific setter and getter method
`// if the correct argument type is available.
`//
`Pad_Bool
`HTML::Set_option(Pad_Option *option, char *sval)
` float fval;
` Pad_Bool rc = TRUE;
` switch (option->id) {
` case PAD_BORDER:
`
`Set_border(sval);
`
`break;
` case PAD_BORDERWIDTH:
`
`fval = ATOVALUEF(pad->view->win, sval);
`
`Set_borderwidth(fval);
`
`break;
` case PAD_DONESCRIPT:
`
`Set_done_script(sval);
`
`break;
` case PAD_ERRORSCRIPT:
`
`Set_error_script(sval);
`
`break;
` case PAD_FILL:
`
`Set_fill(sval);
`
`break;
` case PAD_HTMLANCHORS:
`
`Pad_errorString = "Error: -htmlanchors is a read-only option";
`
`rc = FALSE;
`
`break;
` case PAD_UPDATESCRIPT:
`
`Set_update_script(sval);
`
`break;
` case PAD_URL:
`
`rc = Set_url(sval);
`
`break;
` default:
`
`rc = Pad_Group::Set_option(option, sval);
`
`{
`
`(cid:3)
`
`SoftView Exhibit 2004-11
`Kyocera Corp. v. SoftView LLC
`IPR2013-00007
`
`
`
`(cid:3)
`
`break;
`
` }
` return(rc);
`
`} /
`
`/
`// Set the object's <option> to the default value.
`//
`Pad_Bool
`HTML::Set_option_default(Pad_Option *option)
` Pad_Bool rc = TRUE;
` switch (option->id) {
` case PAD_BORDER:
`
`Set_border_default();
`
`break;
` case PAD_BORDERWIDTH:
`
`Set_borderwidth_default();
`
`break;
` case PAD_DONESCRIPT:
`
`Set_done_script_default();
`
`break;
` case PAD_ERRORSCRIPT:
`
`Set_error_script_default();
`
`break;
` case PAD_FILL:
`
`Set_fill_default();
`
`break;
` case PAD_HTMLANCHORS:
`
`Pad_errorString = "Error: -htmlanchors is a read-only option";
`
`rc = FALSE;
`
`break;
` case PAD_UPDATESCRIPT:
`
`Set_update_script_default();
`
`break;
` case PAD_URL:
`
`Set_url_default();
`
`break;
` default:
`
`rc = Pad_Group::Set_option_default(option);
`
`break;
` }
` return(rc);
`
`{
`
`} /
`
`/
`// Return the value of the object's <option> as a string
`// in <result>.
`//
`Pad_Bool
`
`(cid:3)
`
`SoftView Exhibit 2004-12
`Kyocera Corp. v. SoftView LLC
`IPR2013-00007
`
`
`
`(cid:3)
`
`HTML::Get_option(Pad_Option *option, Pad_String &result, Pad_Bool
`&modified)
` Pad_Bool rc = TRUE;
` switch (option->id) {
` case PAD_BORDER:
`
`modified = (htmlFlags & HTML_BORDER_SET) ? TRUE : FALSE;
`
`Get_bordername(result);
`
`break;
` case PAD_BORDERWIDTH:
`
`modified = (htmlFlags & HTML_BORDERWIDTH_SET) ? TRUE : FALSE;
`
`result = Get_borderwidth();
`
`break;
` case PAD_DONESCRIPT:
`
`modified = (htmlFlags & HTML_DONESCRIPT_SET) ? TRUE : FALSE;
`
`result = Get_done_script();
`
`break;
` case PAD_ERRORSCRIPT:
`
`modified = (htmlFlags & HTML_ERRORSCRIPT_SET) ? TRUE : FALSE;
`
`result = Get_error_script();
`
`break;
` case PAD_FILL:
`
`modified = (htmlFlags & HTML_FILL_SET) ? TRUE : FALSE;
`
`Get_fillname(result);
`
`break;
` case PAD_HTMLANCHORS:
`
`{
`
` Pad_Bool first;
`
` HTML_Anchor *a;
`
` Pad_List *anchors;
`
` Pad_Iterator oi;
`
` modified = FALSE;
`
` first = TRUE;
`
` anchors = Get_htmlanchors();
`
` result = "";
`
` DOLIST(oi, *anchors, HTML_Anchor, a)
`
` {
`
`
` if (first) {
`
`
` first = FALSE;
`
`
` } else {
`
`
` result += " ";
`
`
` }
`
`
` result += a->id;
`
` }
`
`}
`
`break;
` case PAD_UPDATESCRIPT:
`
`modified = (htmlFlags & HTML_UPDATESCRIPT_SET) ? TRUE : FALSE;
`
`result = Get_update_script();
`
`break;
` case PAD_URL:
`
`modified = (htmlFlags & HTML_URL_SET) ? TRUE : FALSE;
`
`{
`
`(cid:3)
`
`SoftView Exhibit 2004-13
`Kyocera Corp. v. SoftView LLC
`IPR2013-00007
`
`
`
`(cid:3)
`
`result = Get_url();
`
`break;
`
` default:
`
`rc = Pad_Group::Get_option(option, result, modified);
`
`break;
` }
` return(rc);
`
`} /
`
`/
`// Setters and Getters for the url
`//
`Pad_Bool
`HTML::Set_url(char *urlname)
` Pad_String strid;
` Pad_UrlItem *newUrlItem;
` Pad_Bool rc;
` Pad_String bind_cmd;
` HTML_Display *d;
` HTML_Entry *e;
` Pad_Object *o;
`// First clean out any existing entries, etc.
`
`
`
`
` while ((d = (HTML_Display *)displayList.Pop())) {
`
`delete d;
` }
` while ((e = (HTML_Entry *)entryList.Pop())) {
`
`delete e;
` }
` while ((o = (Pad_Object *)members.Pop())) {
`
`delete o;
` }
`
`{
`
` htmlFlags |= HTML_URL_SET;
` Pad_tcl_entry = NULL;
` textColor.Set("black");
` linkColor.Set("blue3");
` alinkColor.Set("red");
` vlinkColor.Set("plum4");
` ulinkColor.Set("gray50");
` Pad_renderer->Set_font(_font);
` DefaultLineSize = 1.1 * Pad_renderer->Get_font_height();
` NewLine = 0;
` Title = FALSE;
` H1 = FALSE;
` H2 = FALSE;
` H3 = FALSE;
` H4 = FALSE;
` H5 = FALSE;
`
`(cid:3)
`
`SoftView Exhibit 2004-14
`Kyocera Corp. v. SoftView LLC
`IPR2013-00007
`
`
`
`(cid:3)
`
` H6 = FALSE;
` HTML_VERTICAL_IMAGE_OFFSET = 0.2 * DefaultLineSize;
` Token = "";
` url = urlname;
` Initializing = TRUE;
` strid = id;
`
`
`
`
`// Set Tcl global variables used by MSML callbacks
` Tcl_SetVar(pad->view->win->interp, "Pad_CurrentHTML", strid.Get(),
`TCL_GLOBAL_ONLY);
` Tcl_SetVar(pad->view->win->interp, "Pad_CurrentHTMLPad",
`
` pad->view->win->Get_name(), TCL_GLOBAL_ONLY);
`
`
`
`
`// Define event binding so objects that are
`created
`
`
`
`
`// with the "_html" tag are added to the current
`HTML object
` bind_cmd = pad->view->win->Get_name();
` bind_cmd += " bind _html <Create> {%P addgroupmember %O
`$Pad_CurrentHTML}";
` Tcl_GlobalEval(pad->view->win->interp, bind_cmd.Get());
`
`
`
`
`// Guarantee a reasonable starting bounding box
` xmin = 0.0 - HTML_XOFFSET;
` ymin = 0.0 - HTML_YOFFSET + DefaultLineSize;
` xmax = width + HTML_XOFFSET;
` ymax = 0.0 + HTML_YOFFSET + DefaultLineSize;
` Update();
`// Start URL fetch
`
`
`
`
` newUrlItem = pad->view->pad->Url_fetch(urlname, NULL, NULL, this,
`TRUE,
`
`
`
`
`
`
` HTML_UpdateCB, HTML_DoneCB,
`HTML_ErrorCB);
` if (newUrlItem) {
`
`rc = TRUE;
`
`urlItem = newUrlItem;
`
`url = urlItem->urlname; // Get this urlname since relative names
`are expanded
` } else {
`
`Create_display_list();
`
`Pad_errorString = "Error: Can't open URL: ";
`
`Pad_errorString += urlname;
`
`rc = FALSE;
` }
` Initializing = FALSE;
` return(rc);
`
`} v
`
`(cid:3)
`
`oid
`HTML::Set_url_default(void)
`
`SoftView Exhibit 2004-15
`Kyocera Corp. v. SoftView LLC
`IPR2013-00007
`
`
`
`(cid:3)
`
`{
`
` Set_url(HTML_DEFAULT_URL);
` htmlFlags &= ~HTML_URL_SET;
`
`} c
`
`har *
`HTML::Get_url(void)
` return(url.Get());
`
`{
`
`} /
`
`/
`// Getters for htmlanchors
`//
`Pad_List *
`HTML::Get_htmlanchors(void)
` return(&anchorList);
`
`{
`
`} /
`
`/
`// Setters and Getters for the width of <this>
`//
`Pad_Bool
`HTML::Set_width(float new_width)
`
`
`
`// Reset width flag so when Compute_bounding_box
`gets called,
`
`
`
`// it recomputes the width.
`
` optionFlags &= ~PAD_WIDTH_SET;
` width = new_width;
` Create_display_list();
` optionFlags |= PAD_WIDTH_SET;
` return(TRUE);
`
`{
`
`} v
`
`oid
`HTML::Set_width_default(void)
` Set_width(HTML_DEFAULT_WIDTH);
` optionFlags &= ~PAD_WIDTH_SET;
`
`{
`
`} f
`
`loat
`HTML::Get_width(void)
` return(width);
`
`{
`
`} /
`
`/
`// Setters and getters for border color
`
`(cid:3)
`
`SoftView Exhibit 2004-16
`Kyocera Corp. v. SoftView LLC
`IPR2013-00007
`
`
`
`(cid:3)
`
`//
`void
`HTML::Set_border(char *borderName)
` htmlFlags |= HTML_BORDER_SET;
` border.Set(borderName);
` Damage();
`
`{
`
`} v
`
`{
`
`oid
`HTML::Set_border_default(void)
` htmlFlags &= ~HTML_BORDER_SET;
` border.Set(HTML_DEFAULT_BORDER);
` Damage();
`
`} v
`
`oid
`HTML::Get_bordername(Pad_String &borderName)
` border.Get(borderName);
`
`{
`
`} v
`
`oid
`HTML::Set_borderwidth(float borderWidth)
` htmlFlags |= HTML_BORDERWIDTH_SET;
` lineWidth = borderWidth;
` Update();
`
`{
`
`} v
`
`oid
`HTML::Set_borderwidth_default(void)
` Set_borderwidth(HTML_DEFAULT_BORDERWIDTH);
` htmlFlags &= ~HTML_BORDERWIDTH_SET;
`
`{
`
`} f
`
`loat
`HTML::Get_borderwidth(void)
` return(lineWidth);
`
`{
`
`} P
`
`ad_Bool
`HTML::Set_fill(char *colorname)
`
`{
`
` htmlFlags |= HTML_FILL_SET;
` fillColor.Set(colorname);
`
`
`
`
`// Set small color based on fill
` if (fillColor.Is_set()) {
`
`(cid:3)
`
`SoftView Exhibit 2004-17
`Kyocera Corp. v. SoftView LLC
`IPR2013-00007
`
`
`
`(cid:3)
`
`int red, green, blue;
`
`fillColor.Get(red, green, blue);
`
`smallColor.Set(
`
`
`MAX(0, (red - 60)),
`
`
`MAX(0, (green - 60)),
`
`
`MAX(0, (blue - 60)));
`
` }
` Damage();
` return(TRUE);
`
`} P
`
`ad_Bool
`HTML::Set_fill(int red, int green, int blue)
`
`{
`
` htmlFlags |= HTML_FILL_SET;
` fillColor.Set(red, green, blue);
`
`
`
`
`// Set small color based on fill
` if (fillColor.Is_set()) {
`
`smallColor.Set(
`
`
`MAX(0, (red - 60)),
`
`
`MAX(0, (green - 60)),
`
`
`MAX(0, (blue - 60)));
` }
` Damage();
` return(TRUE);
`
`} v
`
`oid
`HTML::Set_fill_default(void)
` Set_fill(HTML_DEFAULT_FILL);
` htmlFlags &= ~HTML_FILL_SET;
`
`{
`
`} v
`
`oid
`HTML::Get_fillname(Pad_String &fillname)
` fillColor.Get(fillname);
`
`{
`
`} /
`
`/
`// Setter functions for Tcl callback scripts
`//
`void
`HTML::Set_update_script(char *script)
` htmlFlags |= HTML_UPDATESCRIPT_SET;
` if (updateScript) {
`
`delete updateScript;
` }
`
`{
`
`(cid:3)
`
`SoftView Exhibit 2004-18
`Kyocera Corp. v. SoftView LLC
`IPR2013-00007
`
`
`
`(cid:3)
`
` if (script[0] == '\0') {
`
`updateScript = NULL;
` } else {
`
`updateScript = new Pad_Callback(script, Pad_callbackLanguage);
` }
`
`} v
`
`{
`
`oid
`HTML::Set_update_script_default(void)
` Set_update_script(HTML_DEFAULT_UPDATESCRIPT);
` htmlFlags &= ~HTML_UPDATESCRIPT_SET;
`
`} c
`
`{
`
`har *
`HTML::Get_update_script(void)
` if (updateScript) {
`
`return(updateScript->Get());
` } else {
`
`return(NULL);
` }
`
`} v
`
`oid
`HTML::Set_done_script(char *script)
` htmlFlags |= HTML_DONESCRIPT_SET;
` if (doneScript) {
`
`delete doneScript;
` }
` if (script[0] == '\0') {
`
`doneScript = NULL;
` } else {
`
`doneScript = new Pad_Callback(script, Pad_callbackLanguage);
` }
`
`{
`
`} v
`
`oid
`HTML::Set_done_script_default(void)
` Set_done_script(HTML_DEFAULT_DONESCRIPT);
` htmlFlags &= ~HTML_DONESCRIPT_SET;
`
`{
`
`} c
`
`har *
`HTML::Get_done_script(void)
` if (doneScript) {
`
`return(doneScript->Get());
` } else {
`
`return(NULL);
` }
`}
`
`{
`
`(cid:3)
`
`SoftView Exhibit 2004-19
`Kyocera Corp. v. SoftView LLC
`IPR2013-00007
`
`
`
`(cid:3)
`
`void
`HTML::Set_error_script(char *script)
` htmlFlags |= HTML_ERRORSCRIPT_SET;
` if (errorScript) {
`
`delete errorScript;
` }
` if (script[0] == '\0') {
`
`errorScript = NULL;
` } else {
`
`errorScript = new Pad_Callback(script, Pad_callbackLanguage);
` }
`
`{
`
`} v
`
`{
`
`oid
`HTML::Set_error_script_default(void)
` Set_error_script(HTML_DEFAULT_ERRORSCRIPT);
` htmlFlags &= ~HTML_ERRORSCRIPT_SET;
`
`} c
`
`har *
`HTML::Get_error_script(void)
` if (errorScript) {
`
`return(errorScript->Get());
` } else {
`
`return(NULL);
` }
`
`{
`
`} /
`
`/
`// Get the text from the HTML object
`//
`Pad_Bool
`HTML::Get_text(Pad_String &string)
` Pad_Iterator it;
` HTML_Entry *e;
` Pad_String tmpString;
` string = "";
` tmpString = "";
` DOLIST(it, entryList, HTML_Entry, e) {
`
`if (e->Get_text(tmpString)) {
` string += tmpString;
` string += " ";
` tmpString = "";
`
`}
` }
` return(TRUE);
`}
`
`{
`
`(cid:3)
`
`SoftView Exhibit 2004-20
`Kyocera Corp. v. SoftView LLC
`IPR2013-00007
`
`
`
`(cid:3)
`
`//
`// Accessor functions for html info
`//
`unsigned char *
`HTML::Get_source(void)
` return(source);
`
`{
`
`} c
`
`har *
`HTML::Get_type(void)
` return(docType.Get());
`
`{
`
`} c
`
`har *
`HTML::Get_last_modified(void)
` return(docLastModified.Get());
`
`{
`
`/
`// Get rid of starting white space.
`// Return the index of the first character that is not whitespace
`// starting at index.
`//
`void
`HTML::Skip_white_space(int &index)
` Pad_Bool found = FALSE;
` do {
`
`switch (source[index]) {
`
` case '\0':
`
` found = TRUE;
`
` break;
`
` case ' ':
`
` case '\t':
`
` case '\n':
`
` index++;
`
` break;
`
` default:
`
` found = TRUE;
`
` break;
`
`}
` } while (!found);
`}
`
`{
`
`(cid:3)
`
`} i
`
`nt
`HTML::Get_length(void)
` return(sourceIndex);
`
`{
`
`} /
`
`SoftView Exhibit 2004-21
`Kyocera Corp. v. SoftView LLC
`IPR2013-00007
`
`
`
`(cid:3)
`
`//
`// return the next token in Entry.
`//
`HTML_Entry *
`HTML::Next_token(int &index, Pad_Bool &eof)
` HTML_Entry *token;
` Skip_white_space(index);
` switch (source[index]) {
` case '\0':
`
`token = NULL;
`
`break;
`// Defining a tag
`
` case '<':
`
`token = Parse_tag(index, eof);
` break;
` default:
`
`
`// Defining text
`
`token = Parse_text(index, eof);
` break;
` }
` return(token);
`
`{
`
`} /
`
`/
`// Parse the following characters as a tag.
`// Fill in the list of Keys (type and value).
`//
`HTML_Entry *
`HTML::Parse_tag(int &index, Pad_Bool &eof)
` char c;
` Pad_Bool found = FALSE;
` HtmlEntryType type = HTML_ENTRY_UNDEF;
` HTML_EntryTag *tag;
` Token = "";
`// Parse tag along with keywords
`
`
`
` c = source[index++];
` if (c != '<') {
` cerr << "Parse_tag, How did we get here?" << endl;
` return(NULL);
` }
` c = source[index];
` if (c == '/') {
` type = HTML_ENTRY_END;
` index++;
` }
` do {
`
`c = source[index++];
`
`switch (c) {
`
` case '>':
`
` found = TRUE;
`
`{
`
`(cid:3)
`
`SoftView Exhibit 2004-22
`Kyocera Corp. v. SoftView LLC
`IPR2013-00007
`
`
`
`(cid:3)
`
` break;
`
` case '\0':
`
` type = HTML_EOF;
`
` eof = TRUE;
`
` break;
`
` case ' ':
`
` case '\t':
`
` case '\n':
`
` found = TRUE;
`
` break;
`
` default:
`
` Token.Append(c);
`
`}
`
` } while ((type != HTML_EOF) && !found);
` if (c != '>') {
`
`tag = new HTML_EntryTag(this, index);
` } else {
` tag = NULL;
` }
` // the copy constructors that get
` // called here are all destructive. If
` // they succeed they will delete tag
` // and return a new pointer of their
` // type. If they fail they will return
` // tag.
` if (type == HTML_ENTRY_END) {
` tag = new HTML_EntryTagEnd();
` } else if (Token == "a") {
` tag = new HTML_EntryTagAnchor(tag);
` } else if (Token == "img") {
` tag = new HTML_EntryTagImage(tag, this);
` } else if (Token == "meta") {
` tag = tag->Parse_meta(this);
` } else {
` tag = new HTML_EntryTagStart(tag);
` }
` tag->Parse(this);
`
`
`
` return(tag);
`
`// Now find out which tag it was
`
`} v
`
`oid
`HTML_EntryTagEnd::Parse(HTML *)
` _endTag = Set_tag_type();
`
`{
`
`} v
`
`oid
`HTML_EntryTagStart::Parse(HTML *)
` _startTag = Set_tag_type();
`
`{
`
`(cid:3)
`
`SoftView Exhibit 2004-23
`Kyocera Corp. v. SoftView LLC
`IPR2013-00007
`
`
`
`(cid:3)
`
`} H
`
`TML_EntryTag *
`HTML_EntryTag::Parse_meta(HTML *html)
` HTML_Key *key;
` HTML_EntryTagTcl *ett;
` HTML_EntryTag *et;
` Pad_Iterator pi;
` // We need to check for the PAD_TCL
` // key if present we need to create an
` // HTML_EntryTagTcl set
` // Pad_tcl_entry to point to it, so
` // that if we get a tcl create
` // callback, any Pad_Objects created
` // in the tcl script, can be stored.
` if (_keyList) {
`
`DOLIST(pi, *_keyList, HTML_Key, key) {
`
` switch (key->key){
`
` case KEY_PAD_SCALE_BEGIN :
`
`
`et = new HTML_EntryTagStart(this);
`
`
`return(et);
`
` case KEY_PAD_SCALE_END :
`
`
`et = new HTML_EntryTagStart(this);
`
`
`return(et);
`
` case KEY_PAD_TCL :
` // Pad_tcl_entry must be set before
` // making the call to Tcl_GlobalEval,
` // otherwise if an object gets created
` // by the tcl script it will cause an
` // error in HTML::Add() when the
` // create callback happens
`
`
`ett = new HTML_EntryTagTcl();
` // We would actually like to call
` // HTML_EntryTagTcl (this) to copy the
` // key_list from this right away, but
` // we can't, since the eval might
` // fail, and the 'copy constructor'
` // for HTML_EntryTag deletes the
` // parameter
`
`
`Pad_tcl_entry = ett;
` // send key->value.Get() to tcl interp
`
`
`if (Tcl_GlobalEval(html->pad->view->win->interp,
`
`
`
`
` key->value.Get()) == TCL_ERROR){
`
`
` Tcl_AddErrorInfo(html->pad->view->win->interp, "\n
`(MSML meta tag, pad_tcl key)");
`
`
` Pad_Background_error(html->pad->view->win->interp);
`
`
` return(this);
`
`
`}
`
`
`ett->Set_tag(this); // if the eval succeeds, then we
`
`
`
`
` // need to initialize the key_list of ett
`
`
`
`
` // and delete the old tag, since the pointer
`
`{
`
`(cid:3)
`
`SoftView Exhibit 2004-24
`Kyocera Corp. v. SoftView LLC
`IPR2013-00007
`
`
`
`(cid:3)
`
` // we return overwrites the old value of this
`
`
`
`
`delete this;
`
`
`return(ett);
`
`
`default :
`
`
`break;
`
`
` }
`
`}
`
`return(this);
`
` }
` return(NULL);
`
`} H
`
`tmlEntryTagType
`HTML_EntryTag::Set_tag_type(void)
` int i;
` _tag = Token;
` i = 0;
` while (tagArray[i].name) {
`
`if (Token == tagArra