From 5467d5e1572804a78c140180fc3387c0908ce7c7 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Wed, 26 Apr 2017 10:04:43 +0100 Subject: update beos frontend to remove reformat API --- frontends/beos/window.cpp | 60 ++++++++++++++++++++--------------------------- 1 file changed, 25 insertions(+), 35 deletions(-) (limited to 'frontends/beos') 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, -- cgit v1.2.3