summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2017-04-26 09:52:39 +0100
committerVincent Sanders <vince@kyllikki.org>2017-04-26 09:52:39 +0100
commit413ee474d2fff356a3cf2f245868ff01767d4079 (patch)
tree8a699dec29b0b89353e6cf8850a45993d09ecbee
parent72bd28d16eea3ba427a029a57818c658579f8ae8 (diff)
downloadnetsurf-413ee474d2fff356a3cf2f245868ff01767d4079.tar.gz
netsurf-413ee474d2fff356a3cf2f245868ff01767d4079.tar.bz2
update cocoa frontend with reformat API change
-rw-r--r--frontends/cocoa/BrowserView.h1
-rw-r--r--frontends/cocoa/BrowserView.m10
-rw-r--r--frontends/cocoa/gui.m24
3 files changed, 13 insertions, 22 deletions
diff --git a/frontends/cocoa/BrowserView.h b/frontends/cocoa/BrowserView.h
index c626c8c5b..1d02fb02b 100644
--- a/frontends/cocoa/BrowserView.h
+++ b/frontends/cocoa/BrowserView.h
@@ -47,7 +47,6 @@
- (void) removeCaret;
- (void) addCaretAt: (NSPoint) point height: (CGFloat) height;
-- (void) reformat;
- (void) updateHistory;
@end
diff --git a/frontends/cocoa/BrowserView.m b/frontends/cocoa/BrowserView.m
index f1259d835..e6e8e0b17 100644
--- a/frontends/cocoa/BrowserView.m
+++ b/frontends/cocoa/BrowserView.m
@@ -43,8 +43,6 @@
- (void) scrollVertical: (CGFloat) amount;
- (CGFloat) pageScroll;
-- (void) reformat;
-
- (void) popUpContextMenuForEvent: (NSEvent *) event;
- (IBAction) cmOpenURLInTab: (id) sender;
@@ -505,14 +503,6 @@ static browser_mouse_state cocoa_mouse_flags_for_event( NSEvent *evt )
return NSHeight( [[self superview] frame] ) - [[self enclosingScrollView] pageScroll];
}
-- (void) reformat
-{
- NSRect size = [[self superview] frame];
- browser_window_reformat(browser,
- false,
- cocoa_pt_to_px( NSWidth( size ) ),
- cocoa_pt_to_px( NSHeight( size ) ) );
-}
- (void) popUpContextMenuForEvent: (NSEvent *) event
{
diff --git a/frontends/cocoa/gui.m b/frontends/cocoa/gui.m
index 7e180fa24..1bf191ffc 100644
--- a/frontends/cocoa/gui.m
+++ b/frontends/cocoa/gui.m
@@ -129,18 +129,19 @@ static void gui_window_set_scroll(struct gui_window *g, int sx, int sy)
[[(BrowserViewController *)g browserView] scrollPoint: cocoa_point( sx, sy )];
}
-/**
- * callback from core to reformat a window.
- */
-static void cocoa_window_reformat(struct gui_window *gw)
-{
- if (gw != NULL) {
- [[(BrowserViewController *)gw browserView] reformat ];
- }
-}
-static void gui_window_get_dimensions(struct gui_window *g,
+/**
+ * Find the current dimensions of a cocoa 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)
{
@@ -154,6 +155,8 @@ static void gui_window_get_dimensions(struct gui_window *g,
}
*width = cocoa_pt_to_px( NSWidth( frame ) );
*height = cocoa_pt_to_px( NSHeight( frame ) );
+
+ return NSERROR_OK;
}
static void gui_window_update_extent(struct gui_window *g)
@@ -304,7 +307,6 @@ static struct gui_window_table window_table = {
.set_scroll = gui_window_set_scroll,
.get_dimensions = gui_window_get_dimensions,
.update_extent = gui_window_update_extent,
- .reformat = cocoa_window_reformat,
.set_title = gui_window_set_title,
.set_url = gui_window_set_url,