From 4664d6a1d44a58980b87c20354f1faf1f479725b Mon Sep 17 00:00:00 2001 From: anthony Date: Thu, 19 Nov 2020 19:35:49 +0000 Subject: [PATCH] minor edits --- frontends/gnustep/AppDelegate.m | 7 +------ frontends/gnustep/BrowserWindowController.h | 1 + frontends/gnustep/BrowserWindowController.m | 21 +++++++++++++++++---- frontends/gnustep/tables/fetch.m | 1 + frontends/gnustep/tables/misc.m | 2 +- frontends/gnustep/tables/window.m | 1 + 6 files changed, 22 insertions(+), 11 deletions(-) diff --git a/frontends/gnustep/AppDelegate.m b/frontends/gnustep/AppDelegate.m index 319f7c8d7..808f8865d 100644 --- a/frontends/gnustep/AppDelegate.m +++ b/frontends/gnustep/AppDelegate.m @@ -42,12 +42,7 @@ static nserror set_defaults(struct nsoption_s *defaults) struct nsurl *url; nserror error; - if (nsoption_charp(homepage_url) != NULL) { - error = nsurl_create(nsoption_charp(homepage_url), &url); - } else { - NSLog(@"opening default page %s", NETSURF_HOMEPAGE); - error = nsurl_create(NETSURF_HOMEPAGE, &url); - } + error = nsurl_create("https://www.startpage.com", &url); if (error == NSERROR_OK) { error = browser_window_create(BW_CREATE_HISTORY, url, NULL, NULL, NULL); diff --git a/frontends/gnustep/BrowserWindowController.h b/frontends/gnustep/BrowserWindowController.h index 86dcb9c54..7de71d5e8 100644 --- a/frontends/gnustep/BrowserWindowController.h +++ b/frontends/gnustep/BrowserWindowController.h @@ -9,6 +9,7 @@ struct browser_window; id scrollView; id urlBar; struct browser_window *browser; + id plotView; } -(id)initWithBrowser: (struct browser_window*)aBrowser; diff --git a/frontends/gnustep/BrowserWindowController.m b/frontends/gnustep/BrowserWindowController.m index 05d047904..8cacc5da4 100644 --- a/frontends/gnustep/BrowserWindowController.m +++ b/frontends/gnustep/BrowserWindowController.m @@ -1,8 +1,10 @@ /* All Rights reserved */ -#include -#include "BrowserWindowController.h" -#include "PlotView.h" +#import +#import "BrowserWindowController.h" +#import "PlotView.h" +#import "netsurf/browser_window.h" +#import "utils/nsurl.h" @implementation BrowserWindowController @@ -14,7 +16,7 @@ } -(void)awakeFromNib { - PlotView *plotView = [[PlotView alloc] initWithFrame: NSMakeRect(0, 0, 1000, 1000)]; + plotView = [[PlotView alloc] initWithFrame: NSMakeRect(0, 0, 1000, 1000)]; [plotView setBrowser: browser]; [[scrollView contentView] addSubview: plotView]; NSLog(@"Browser window loaded"); @@ -22,6 +24,17 @@ -(id)back: (id)sender { NSLog(@"Browser backward"); + [plotView display]; + bool ready = browser_window_redraw_ready(browser); + if (ready) { + NSLog(@"redraw ready!"); + } + if (browser_window_has_content(browser)) { + NSLog(@"has content"); + } + struct nsurl *url = browser_window_access_url(browser); + NSLog(@"url: '%s'", nsurl_access(url)); + } -(id)forward: (id)sender { diff --git a/frontends/gnustep/tables/fetch.m b/frontends/gnustep/tables/fetch.m index 28be523ef..2eb5509b7 100644 --- a/frontends/gnustep/tables/fetch.m +++ b/frontends/gnustep/tables/fetch.m @@ -9,6 +9,7 @@ // Return the MIME type of the specified file. Returned string can be inval on next req. static const char *gnustep_fetch_filetype(const char *unix_path) { + NSLog(@"gnustep_fetch_filetype"); static char filetype[100]; filetype[0] = '\0'; return filetype; diff --git a/frontends/gnustep/tables/misc.m b/frontends/gnustep/tables/misc.m index ef60ccce5..ff3d17d70 100644 --- a/frontends/gnustep/tables/misc.m +++ b/frontends/gnustep/tables/misc.m @@ -14,7 +14,7 @@ static nserror gnustep_misc_schedule(int t, void (*callback)(void *p), void *p) NSLog(@"gnustep_misc_schedule in %dms", t); NetsurfCallback *nsCallback = [NetsurfCallback newOrScheduledWithFunctionPointer: callback parameter: p]; - if (t < 1) { + if (t < 0) { [nsCallback cancel]; return NSERROR_OK; } else { diff --git a/frontends/gnustep/tables/window.m b/frontends/gnustep/tables/window.m index ba46850c0..8f6b18055 100644 --- a/frontends/gnustep/tables/window.m +++ b/frontends/gnustep/tables/window.m @@ -70,6 +70,7 @@ static nserror gnustep_window_event(struct gui_window *gw, enum gui_window_event NSLog(@"GW_EVENT_STOP_THROBBER"); break; default: + NSLog(@"Unknown window event."); break; } return NSERROR_OK;