summaryrefslogtreecommitdiff
path: root/frontends/beos
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2017-04-26 10:04:43 +0100
committerVincent Sanders <vince@kyllikki.org>2017-04-26 10:04:43 +0100
commit5467d5e1572804a78c140180fc3387c0908ce7c7 (patch)
tree5ac96cc0ddcea304fc41e5ae0c175a7008a04e18 /frontends/beos
parent3c264d63e60675cec987edea293316e8a40c9f08 (diff)
downloadnetsurf-5467d5e1572804a78c140180fc3387c0908ce7c7.tar.gz
netsurf-5467d5e1572804a78c140180fc3387c0908ce7c7.tar.bz2
update beos frontend to remove reformat API
Diffstat (limited to 'frontends/beos')
-rw-r--r--frontends/beos/window.cpp60
1 files changed, 25 insertions, 35 deletions
diff --git a/frontends/beos/window.cpp b/frontends/beos/window.cpp
index 4db7b3ca6..f3d63da98 100644
--- a/frontends/beos/window.cpp
+++ b/frontends/beos/window.cpp
@@ -911,28 +911,6 @@ void nsbeos_reflow_all_windows(void)
}
-
-/**
- * callback from core to reformat a window.
- */
-static void beos_window_reformat(struct gui_window *g)
-{
- if (g == NULL) {
- return;
- }
-
- NSBrowserFrameView *view = g->view;
- if (view && view->LockLooper()) {
- BRect bounds = view->Bounds();
- view->UnlockLooper();
-#warning XXX why - 1 & - 2 !???
- browser_window_reformat(g->bw,
- false,
- bounds.Width() + 1 /* - 2*/,
- bounds.Height() + 1);
- }
-}
-
void nsbeos_window_destroy_browser(struct gui_window *g)
{
browser_window_destroy(g->bw);
@@ -1334,19 +1312,32 @@ static struct gui_clipboard_table clipboard_table = {
struct gui_clipboard_table *beos_clipboard_table = &clipboard_table;
-static void gui_window_get_dimensions(struct gui_window *g, int *width, int *height,
- bool scaled)
+/**
+ * Find the current dimensions of a beos browser window content area.
+ *
+ * \param gw The gui window to measure content area of.
+ * \param width receives width of window
+ * \param height receives height of window
+ * \param scaled whether to return scaled values
+ * \return NSERROR_OK on sucess and width and height updated
+ * else error code.
+ */
+static nserror
+gui_window_get_dimensions(struct gui_window *g, int *width, int *height,
+ bool scaled)
{
- if (g->view && g->view->LockLooper()) {
- *width = g->view->Bounds().Width() + 1;
- *height = g->view->Bounds().Height() + 1;
- g->view->UnlockLooper();
- }
-
- if (scaled) {
- *width /= g->scale;
- *height /= g->scale;
- }
+ if (g->view &&
+ g->view->LockLooper()) {
+ *width = g->view->Bounds().Width() + 1;
+ *height = g->view->Bounds().Height() + 1;
+ g->view->UnlockLooper();
+
+ if (scaled) {
+ *width /= g->scale;
+ *height /= g->scale;
+ }
+ }
+ return NSERROR_OK;
}
static struct gui_window_table window_table = {
@@ -1357,7 +1348,6 @@ static struct gui_window_table window_table = {
gui_window_set_scroll,
gui_window_get_dimensions,
gui_window_update_extent,
- beos_window_reformat,
/* from scaffold */
gui_window_set_title,