summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2016-05-30 11:31:35 +0100
committerVincent Sanders <vince@kyllikki.org>2016-05-30 11:31:35 +0100
commit9ce71876ce500e242e2384c21abb38a8f431138b (patch)
tree90a1c65c971ead5de6240bda611eb626fb85ff3a /desktop
parent527756cca0471a55389a3494d35f9b1b13f20b7e (diff)
downloadnetsurf-9ce71876ce500e242e2384c21abb38a8f431138b.tar.gz
netsurf-9ce71876ce500e242e2384c21abb38a8f431138b.tar.bz2
move layout header into public API
Diffstat (limited to 'desktop')
-rw-r--r--desktop/browser_history.c2
-rw-r--r--desktop/gui_factory.c2
-rw-r--r--desktop/gui_layout.h91
-rw-r--r--desktop/textarea.c2
-rw-r--r--desktop/treeview.c2
5 files changed, 4 insertions, 95 deletions
diff --git a/desktop/browser_history.c b/desktop/browser_history.c
index 871cc3e4b..79a921ad1 100644
--- a/desktop/browser_history.c
+++ b/desktop/browser_history.c
@@ -36,7 +36,7 @@
#include "content/urldb.h"
#include "netsurf/bitmap.h"
-#include "desktop/gui_layout.h"
+#include "netsurf/layout.h"
#include "desktop/gui_internal.h"
#include "desktop/browser_history.h"
#include "desktop/browser_private.h"
diff --git a/desktop/gui_factory.c b/desktop/gui_factory.c
index e2549cc74..a085c0ca8 100644
--- a/desktop/gui_factory.c
+++ b/desktop/gui_factory.c
@@ -37,7 +37,7 @@
#include "netsurf/search.h"
#include "netsurf/clipboard.h"
#include "netsurf/utf8.h"
-#include "desktop/gui_layout.h"
+#include "netsurf/layout.h"
#include "desktop/netsurf.h"
/**
diff --git a/desktop/gui_layout.h b/desktop/gui_layout.h
deleted file mode 100644
index 1696aee91..000000000
--- a/desktop/gui_layout.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright 2016 Vincent Sanders <vince@netsurf-browser.org>
- *
- * This file is part of NetSurf, http://www.netsurf-browser.org/
- *
- * NetSurf is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
- *
- * NetSurf is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-/**
- * \file
- *
- * Interface to platform-specific layout operation table.
- *
- * This table is part of the layout used to measure glyphs before
- * rendering, previously referred to as font functions.
- *
- * \note This is an old interface within the browser, it has been
- * broken out purely to make the API obvious not as an indication this
- * is the correct approach.
- */
-
-#ifndef _NETSURF_DESKTOP_GUI_LAYOUT_H_
-#define _NETSURF_DESKTOP_GUI_LAYOUT_H_
-
-struct plot_font_style;
-
-struct gui_layout_table
-{
- /**
- * Measure the width of a string.
- *
- * \param[in] fstyle plot style for this text
- * \param[in] string UTF-8 string to measure
- * \param[in] length length of string, in bytes
- * \param[out] width updated to width of string[0..length)
- * \return NSERROR_OK and width updated or appropriate error
- * code on faliure
- */
- nserror (*width)(const struct plot_font_style *fstyle, const char *string, size_t length, int *width);
-
-
- /**
- * Find the position in a string where an x coordinate falls.
- *
- * \param[in] fstyle style for this text
- * \param[in] string UTF-8 string to measure
- * \param[in] length length of string, in bytes
- * \param[in] x coordinate to search for
- * \param[out] char_offset updated to offset in string of actual_x, [0..length]
- * \param[out] actual_x updated to x coordinate of character closest to x
- * \return NSERROR_OK and char_offset and actual_x updated or appropriate error code on faliure
- */
- nserror (*position)(const struct plot_font_style *fstyle, const char *string, size_t length, int x, size_t *char_offset, int *actual_x);
-
-
- /**
- * Find where to split a string to make it fit a width.
- *
- * \param[in] fstyle style for this text
- * \param[in] string UTF-8 string to measure
- * \param[in] length length of string, in bytes
- * \param[in] x width available
- * \param[out] char_offset updated to offset in string of actual_x, [1..length]
- * \param[out] actual_x updated to x coordinate of character closest to x
- * \return NSERROR_OK or appropriate error code on faliure
- *
- * On exit, char_offset indicates first character after split point.
- *
- * \note char_offset of 0 must never be returned.
- *
- * Returns:
- * char_offset giving split point closest to x, where actual_x <= x
- * else
- * char_offset giving split point closest to x, where actual_x > x
- *
- * Returning char_offset == length means no split possible
- */
- nserror (*split)(const struct plot_font_style *fstyle, const char *string, size_t length, int x, size_t *char_offset, int *actual_x);
-};
-
-#endif
diff --git a/desktop/textarea.c b/desktop/textarea.c
index 833815eba..157d6c188 100644
--- a/desktop/textarea.c
+++ b/desktop/textarea.c
@@ -38,7 +38,7 @@
#include "desktop/plotters.h"
#include "desktop/scrollbar.h"
#include "netsurf/clipboard.h"
-#include "desktop/gui_layout.h"
+#include "netsurf/layout.h"
#include "desktop/gui_internal.h"
#define CARET_COLOR 0x0000FF
diff --git a/desktop/treeview.c b/desktop/treeview.c
index d72bf2f8d..ead0510b8 100644
--- a/desktop/treeview.c
+++ b/desktop/treeview.c
@@ -33,7 +33,7 @@
#include "desktop/textarea.h"
#include "desktop/treeview.h"
#include "netsurf/clipboard.h"
-#include "desktop/gui_layout.h"
+#include "netsurf/layout.h"
#include "desktop/gui_internal.h"
/** @todo get rid of REDRAW_MAX -- need to be able to know window size */