diff --git a/cocoa/BookmarksController.m b/cocoa/BookmarksController.m index 64c2ef37a..5d3de7488 100644 --- a/cocoa/BookmarksController.m +++ b/cocoa/BookmarksController.m @@ -23,7 +23,7 @@ #import "cocoa/BrowserViewController.h" #import "cocoa/gui.h" -#import "desktop/browser_private.h" +#import "desktop/browser.h" #import "desktop/hotlist.h" #import "desktop/tree.h" #import "utils/messages.h" @@ -163,8 +163,8 @@ static const char *cocoa_hotlist_path( void ) - (IBAction) addBookmark: (id) sender; { struct browser_window *bw = [[(NetSurfApp *)NSApp frontTab] browser]; - if (bw && bw->current_content) { - hotlist_add_url( hlcache_handle_get_url( bw->current_content ) ); + if (bw != NULL) { + hotlist_add_url(browser_window_get_url(bw)); } } diff --git a/cocoa/PreferencesWindowController.m b/cocoa/PreferencesWindowController.m index 54e7b91d0..f8a48499a 100644 --- a/cocoa/PreferencesWindowController.m +++ b/cocoa/PreferencesWindowController.m @@ -22,7 +22,7 @@ #import "cocoa/gui.h" #import "cocoa/BrowserViewController.h" -#import "desktop/browser_private.h" +#import "desktop/browser.h" #import "content/content.h" #import "utils/nsoption.h" #import "content/hlcache.h" @@ -39,7 +39,7 @@ - (IBAction) useCurrentPageAsHomepage: (id) sender; { struct browser_window *bw = [[(NetSurfApp *)NSApp frontTab] browser]; - const char *url = nsurl_access(hlcache_handle_get_url( bw->current_content )); + const char *url = nsurl_access(browser_window_get_url(bw)); [self setHomepageURL: [NSString stringWithUTF8String: url]]; } diff --git a/cocoa/coordinates.h b/cocoa/coordinates.h index d137f15a5..ff76ac976 100644 --- a/cocoa/coordinates.h +++ b/cocoa/coordinates.h @@ -19,7 +19,7 @@ #ifndef COCOA_COORDINATES_H #define COCOA_COORDINATES_H -#import "desktop/browser_private.h" +#import "desktop/browser.h" #import "render/box.h" extern CGFloat cocoa_scale_factor; @@ -108,7 +108,7 @@ static inline NSRect cocoa_rect_for_box( struct browser_window *bw, struct box * { struct rect r; box_bounds( box, &r ); - return cocoa_scaled_rect( bw->scale, r.x0, r.y0, r.x1, r.y1 ); + return cocoa_scaled_rect(browser_window_get_scale(bw), r.x0, r.y0, r.x1, r.y1 ); } #endif diff --git a/cocoa/gui.m b/cocoa/gui.m index eadf1d7d1..ab4fe464d 100644 --- a/cocoa/gui.m +++ b/cocoa/gui.m @@ -33,7 +33,7 @@ #import "desktop/mouse.h" #import "desktop/gui_window.h" #import "desktop/gui_misc.h" -#import "desktop/browser_private.h" +#import "desktop/browser.h" #import "desktop/textinput.h" #import "image/ico.h" #import "content/fetchers/resource.h" @@ -59,11 +59,9 @@ gui_window_create(struct browser_window *bw, { BrowserWindowController *window = nil; + browser_window_set_scale(bw, (float)nsoption_int(scale) / 100, false); if (existing != NULL) { - bw->scale = (float) nsoption_int(scale) / 100; window = [(BrowserViewController *)(existing) windowController]; - } else { - bw->scale = (float) nsoption_int(scale) / 100; } BrowserViewController *result = [[BrowserViewController alloc] initWithBrowser: bw];