From 5031b80b331ddc58fd24f3fe7a85503320cf9689 Mon Sep 17 00:00:00 2001 From: James Bursa Date: Thu, 17 Jul 2003 23:01:02 +0000 Subject: [project @ 2003-07-17 23:01:02 by bursa] Fix 670947, tidy gui code, move some headers. svn path=/import/netsurf/; revision=231 --- render/box.c | 12 ++++++------ render/box.h | 4 +--- render/font.h | 30 ++++++++++++++++++++++++++++++ render/layout.c | 12 ++++-------- 4 files changed, 41 insertions(+), 17 deletions(-) create mode 100644 render/font.h (limited to 'render') diff --git a/render/box.c b/render/box.c index aee750bc1..27b4fceae 100644 --- a/render/box.c +++ b/render/box.c @@ -17,10 +17,10 @@ #include "netsurf/content/fetchcache.h" #include "netsurf/css/css.h" #include "netsurf/render/box.h" +#include "netsurf/render/font.h" #include "netsurf/render/html.h" #ifdef riscos #include "netsurf/desktop/gui.h" -#include "netsurf/riscos/font.h" #include "netsurf/riscos/plugin.h" #endif #define NDEBUG @@ -1691,12 +1691,12 @@ bool plugin_decode(struct content* content, char* url, struct box* box, * we can't handle this object. */ if(po->data == 0 && po->classid == 0) { - return FALSE; + return false; } if(po->data == 0 && po->classid != 0) { if(strncasecmp(po->classid, "clsid:", 6) == 0) { LOG(("ActiveX object - n0")); - return FALSE; + return false; } else { url = url_join(po->classid, po->codebase); @@ -1718,11 +1718,11 @@ bool plugin_decode(struct content* content, char* url, struct box* box, */ if(po->type != 0) { if (content_lookup(po->type) == CONTENT_OTHER) - return FALSE; + return false; } if(po->codetype != 0) { if (content_lookup(po->codetype) == CONTENT_OTHER) - return FALSE; + return false; } /* If we've got to here, the object declaration has provided us with @@ -1734,6 +1734,6 @@ bool plugin_decode(struct content* content, char* url, struct box* box, */ html_fetch_object(content, url, box); - return TRUE; + return true; } diff --git a/render/box.h b/render/box.h index dfb0a2603..4ec60d791 100644 --- a/render/box.h +++ b/render/box.h @@ -12,9 +12,7 @@ #include #include "libxml/HTMLparser.h" #include "netsurf/css/css.h" -#ifdef riscos -#include "netsurf/riscos/font.h" -#endif +#include "netsurf/render/font.h" /** * structures diff --git a/render/font.h b/render/font.h new file mode 100644 index 000000000..80d8a2f2f --- /dev/null +++ b/render/font.h @@ -0,0 +1,30 @@ +/* + * This file is part of NetSurf, http://netsurf.sourceforge.net/ + * Licensed under the GNU General Public License, + * http://www.opensource.org/licenses/gpl-license + * Copyright 2003 Phil Mellor + * Copyright 2003 James Bursa + */ + +#ifndef _NETSURF_RISCOS_FONT_H_ +#define _NETSURF_RISCOS_FONT_H_ + +#include "netsurf/css/css.h" + +struct font_data { + int handle; + unsigned int size; + unsigned int space_width; + struct font_data *next; +}; + +struct font_set *font_new_set(void); +struct font_data *font_open(struct font_set *set, struct css_style *style); +void font_free_set(struct font_set *set); +unsigned long font_width(struct font_data *font, const char * text, unsigned int length); +void font_position_in_string(const char* text, struct font_data *font, + unsigned int length, unsigned long x, int* char_offset, int* pixel_offset); +char * font_split(struct font_data *data, const char * text, unsigned int length, + unsigned int width, unsigned int *used_width); + +#endif diff --git a/render/layout.c b/render/layout.c index 7949d1d3a..369f77491 100644 --- a/render/layout.c +++ b/render/layout.c @@ -12,21 +12,17 @@ #include #include #include "libxml/HTMLparser.h" +#include "netsurf/content/content.h" +#include "netsurf/css/css.h" #ifdef riscos #include "netsurf/desktop/gui.h" #endif -#include "netsurf/content/content.h" #include "netsurf/render/box.h" -#include "netsurf/css/css.h" +#include "netsurf/render/font.h" #include "netsurf/render/layout.h" -#ifdef riscos -#include "netsurf/riscos/font.h" -#else -#include "netsurf/debug/fontd.h" -#endif -#include "netsurf/utils/utils.h" #define NDEBUG #include "netsurf/utils/log.h" +#include "netsurf/utils/utils.h" /** * internal functions -- cgit v1.2.3