Compare commits

...

5 Commits

18 changed files with 167 additions and 131 deletions

View File

@ -1,60 +1,42 @@
# WebSurf
*It's like OmniWeb met NetSurf*
THIS FORK
=======
## What's this?
This fork aims at getting a usable version of NetSurf running under the
GNUstep library. I will note that there is (I think) a working update of
the old cocoa port, checkout github/mmuman's repos for this. However,
this port requires CoreFoundation, and CoreGraphics dependencies. This
port compiles with just basic GNUstep base, gui, and back libraries
unlike the cocoa port.
It's NetSurf, on GNUstep! It works pretty well.
To build, follow the instructions on the quickstart link below, replace netsurf in the generated `workspace` folder with this, and run `make TARGET=gnustep`.
## How do I build this?
![Screenshot](/screenshots/screenshot.jpeg)
With Rik theme, client side decorations and mac-style menu.
```
wget https://git.netsurf-browser.org/netsurf.git/plain/docs/env.sh
unset HOST
source env.sh
ns-package-install
ns-clone
ns-pull-install
rm env.sh
cd ~/dev-netsurf/workspace
source env.sh
mv netsurf netsurf.old
git clone [THE URL OF THIS VERY REPO] netsurf
cd netsurf
gmake TARGET=gnustep
```
![Screenshot](/screenshots/screenshot2.png)
With standard theme.
It's a lot of steps, to make it easier, put these into a separate file (e.g. **deploy-websurf**)
and run it like so: `. ./deploy-websurf`
Current State
----------------
Works pretty well, mostly in parity with the GTK port. Has tabs (including vertical), history, download management, bookmarks.
## Credits
- NetSurf Team
- Sven Weidauer (Cocoa port)
- Anthony Cohn-Richardby (GNUstep port)
- Marco Cawthorne (WebSurf, maintenance, UI work)
## License
WebSurf is just a GNUstep oriented fork of NetSurf. So it shares the same license:
Tested and built on OpenBSD 6.8(macppc) + clang, and Ubuntu 20.10 + gcc.
NetSurf is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
Props to Sven Weidauer for the original cocoa port. Original copyright notice
has been included in files consisting of large parts of his work.
ORIGINAL NETSURF README
----------------
NetSurf
=======
This document should help point you at various useful bits of information.
Building NetSurf
----------------
Read the [Quick Start](docs/quick-start.md) document for instructions.
Creating a new port
-------------------
Look at the existing front ends for example implementations.
The framebuffer front end is simplest and most self-contained.
Also, you can [contact the developers](http://www.netsurf-browser.org/contact/)
for help.
Further documentation
---------------------
* [Developer documentation](http://www.netsurf-browser.org/developers/)
* [Developer wiki](http://wiki.netsurf-browser.org/Documentation/)
* [Code style guide](http://www.netsurf-browser.org/developers/StyleGuide.pdf)
In addition, as a special exception, permission is granted to link the code of this release of NetSurf with the OpenSSL project's "OpenSSL" library (or with modified versions of it that use the same licence as the "OpenSSL" library), and distribute the linked executables. You must obey the GNU General Public License version 2 in all respects for all of the code used other than "OpenSSL". If you modify the code, you may extend this exception to your version of the code, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version.

View File

@ -79,7 +79,7 @@ typedef struct textplain_content {
#define MARGIN 4
#define TAB_WIDTH 8 /* must be power of 2 currently */
#define TEXT_SIZE 10 * PLOT_STYLE_SCALE /* Unscaled text size in pt */
#define TEXT_SIZE 12 * PLOT_STYLE_SCALE /* Unscaled text size in pt */
static plot_font_style_t textplain_style = {
.family = PLOT_FONT_FAMILY_MONOSPACE,
@ -142,7 +142,7 @@ textplain_create_internal(textplain_content *c, lwc_string *encoding)
parserutils_inputstream *stream;
parserutils_error error;
textplain_style.size = (nsoption_int(font_size) * PLOT_STYLE_SCALE) / 10;
textplain_style.size = (nsoption_int(font_size) * PLOT_STYLE_SCALE) / 12;
utf8_data = malloc(CHUNK);
if (utf8_data == NULL)
@ -392,7 +392,7 @@ static float textplain_line_height(void)
/* Size is in points, so convert to pixels.
* Then use a constant line height of 1.2 x font size.
*/
return FIXTOFLT(FDIV((FMUL(FLTTOFIX(1.2), FMUL(nscss_screen_dpi, INTTOFIX((textplain_style.size / PLOT_STYLE_SCALE))))), F_72));
return FIXTOFLT(FDIV((FMUL(FLTTOFIX(1.2), FMUL(nscss_screen_dpi, INTTOFIX((textplain_style.size / PLOT_STYLE_SCALE))))), F_72)) + 8; /* 8 px padding */
}

View File

@ -61,8 +61,9 @@ static nserror set_defaults(struct nsoption_s *defaults)
@implementation AppDelegate
-(void)applicationDidFinishLaunching: (NSNotification*)aNotification {
NSLog(@"NSApp did finish launching..");
-(void)applicationDidFinishLaunching: (NSNotification*)aNotification
{
[NSApp setServicesProvider:self];
[NSBundle loadNibNamed: @"Menu" owner: NSApp];
[self clearBrowsingHistory];
}
@ -132,7 +133,7 @@ static NSMenuItem *menuItemForItem(id item) {
object: nil];
[self bookmarksUpdated: nil];
[self historyUpdated: nil];
[self didTapNewWindow: nil];
//[self didTapNewWindow: nil];
}
-(void)didTapNewWindow: (id)sender {
@ -298,6 +299,73 @@ static NSMenuItem *menuItemForItem(id item) {
}
}
-(void) openFileWindow: (id)sender
{
Website *website;
NSOpenPanel *openPanel = [NSOpenPanel openPanel];
[openPanel setAllowsMultipleSelection: YES];
if ([openPanel runModal] == NSOKButton) {
for (int i = 0; i < [[openPanel URLs] count]; i++) {
Website *website;
NSURL *url = [[openPanel URLs] objectAtIndex: i];
website = [[Website alloc] initWithName: @"" url: [NSString
stringWithFormat: @"file://%@", [url absoluteString]]];
[website autorelease];
[self openWebsite: website];
}
}
}
- (BOOL) application: (NSApplication *)application
openFile: (NSString *)fileName
{
Website *website;
website = [[Website alloc] initWithName: @"" url: [NSString
stringWithFormat: @"file://%@", fileName]];
[website autorelease];
[self openWebsite: website];
return YES;
}
- (void) openURL: (NSPasteboard*)pb
userData: (NSString*)ud
error: (NSString**)err
{
NSString *webURL;
NSArray *types;
NSArray *args;
NSString *path;
NSTask *task;
NSString *pboardString;
Website *website;
*err = nil;
types = [pb types];
if (![types containsObject:NSStringPboardType] ||
!(pboardString = [pb stringForType:NSStringPboardType]))
{
*err = NSLocalizedString(@"Error: Pasteboard doesn't contain a string.",
@"Pasteboard couldn't give string.");
return;
}
webURL = [pb stringForType: NSStringPboardType];
if (webURL == nil)
{
*err = @"No string value supplied on pasteboard";
return;
}
website = [[Website alloc] initWithName: @"" url: webURL];
[website autorelease];
[self openWebsite: website];
return;
}
@end
int main(int argc, char **argv) {

View File

@ -580,51 +580,35 @@ static id newTabTarget;
-(void)reconfigureUrlBarButtons {
NSLog(@"reconfigure url bar buttons");
UrlBarButtonType buttonType = [[Preferences defaultPreferences] urlBarButtonType];
switch (buttonType) {
case UrlBarButtonTypeImage:
[backButton setTitle: nil];
[backButton setImage: [NSImage imageNamed: @"ArrowLeft"]];
[backButton setAlternateImage: [NSImage imageNamed: @"Arrow_Left.Dis"]];
[forwardButton setTitle: nil];
[forwardButton setImage: [NSImage imageNamed: @"ArrowRight"]];
[forwardButton setAlternateImage: [NSImage imageNamed: @"Arrow_Right.Dis"]];
[refreshButton setTitle: nil];
[refreshButton setImage: [NSImage imageNamed: @"Fetch"]];
[searchImage setImage: [NSImage imageNamed: @"smallSearch"]];
[searchLabel setStringValue: nil];
/* new additions - eukara */
[homeButton setTitle: nil];
[homeButton setImage: [NSImage imageNamed: @"Home"]];
[bookmarksButton setTitle: nil];
[bookmarksButton setImage: [NSImage imageNamed: @"BookmarksPanel"]];
[bookmarkAddButton setTitle: nil];
[bookmarkAddButton setImage: [NSImage imageNamed: @"AddBookmark"]];
[findButton setTitle: nil];
[findButton setImage: [NSImage imageNamed: @"Librarian"]];
[shareButton setTitle: nil];
[shareButton setImage: [NSImage imageNamed: @"History"]];
[settingsButton setTitle: nil];
[settingsButton setImage: [NSImage imageNamed: @"Processes"]];
[infoButton setTitle: nil];
[infoButton setImage: [NSImage imageNamed: @"Inspector"]];
[printButton setTitle: nil];
[printButton setImage: [NSImage imageNamed: @"Print"]];
break;
case UrlBarButtonTypeText:
[backButton setTitle: @"Back"];
[backButton setImage: nil];
[forwardButton setTitle: @"Forward"];
[forwardButton setImage: nil];
[refreshButton setTitle: @"Refresh"];
[refreshButton setImage: nil];
[searchImage setImage: nil];
[searchLabel setStringValue: @"Search:"];
break;
default:
break;
}
[backButton setTitle: nil];
[backButton setImage: [NSImage imageNamed: @"ArrowLeft"]];
[backButton setAlternateImage: [NSImage imageNamed: @"Arrow_Left.Dis"]];
[forwardButton setTitle: nil];
[forwardButton setImage: [NSImage imageNamed: @"ArrowRight"]];
[forwardButton setAlternateImage: [NSImage imageNamed: @"Arrow_Right.Dis"]];
[refreshButton setTitle: nil];
[refreshButton setImage: [NSImage imageNamed: @"Fetch"]];
[searchImage setImage: [NSImage imageNamed: @"smallSearch"]];
[searchLabel setStringValue: nil];
/* new additions - eukara */
[homeButton setTitle: nil];
[homeButton setImage: [NSImage imageNamed: @"Home"]];
[bookmarksButton setTitle: nil];
[bookmarksButton setImage: [NSImage imageNamed: @"BookmarksPanel"]];
[bookmarkAddButton setTitle: nil];
[bookmarkAddButton setImage: [NSImage imageNamed: @"AddBookmark"]];
[findButton setTitle: nil];
[findButton setImage: [NSImage imageNamed: @"Librarian"]];
[shareButton setTitle: nil];
[shareButton setImage: [NSImage imageNamed: @"History"]];
[settingsButton setTitle: nil];
[settingsButton setImage: [NSImage imageNamed: @"Processes"]];
[infoButton setTitle: nil];
[infoButton setImage: [NSImage imageNamed: @"Inspector"]];
[printButton setTitle: nil];
[printButton setImage: [NSImage imageNamed: @"Print"]];
}
-(void)onPreferencesUpdated: (id)sender {
@ -680,7 +664,7 @@ static id newTabTarget;
-(void)sharePage: (id)sender
{
NSRunAlertPanel(@"Hey!", @"This feature is coming soon.", @"OK", NULL, NULL);
[[[NSApplication sharedApplication] delegate] showHistoryWindow: sender];
}

View File

@ -2,7 +2,7 @@
# Mac OS X target setup
# ----------------------------------------------------------------------------
POSTEXES += NetSurf.app
POSTEXES += WebSurf.app
EXETARGET := nscocoa
SDK_CFLAGS := $(shell gnustep-config --objc-flags)
@ -81,13 +81,12 @@ SOURCES = $(addprefix $(shell pwd)/,$(S_COMMON) $(S_IMAGE) $(S_BROWSER) $(S_FRON
# prefixed rule so that the testament is run
$(shell pwd)/content/fetchers/about/about.c: testament
EXETARGET := NetSurf
EXETARGET := WebSurf
R_RESOURCES := \
Menu.gorm \
Browser.gorm \
Downloads.gorm \
NetSurf.tiff \
Find.gorm \
History.gorm \
Bookmarks.gorm \
@ -117,30 +116,29 @@ LOCALIZED_RESOURCES := Localizable.strings
# Install target
# ----------------------------------------------------------------------------
install-cocoa: NetSurf.app
install-cocoa: WebSurf.app
NetSurf.app: NetSurf $(FRONTEND_SOURCE_DIR)/Makefile $(R_RESOURCES) NetSurf.app/Resources/Info-gnustep.plist
$(VQ)echo Assembling NetSurf.app bundle
$(Q)cp NetSurf NetSurf.app/
$(Q)cp $(FRONTEND_RESOURCES_DIR)/NetSurf.icns NetSurf.app
$(Q)mkdir -p NetSurf.app/Resources
$(Q)cp -pLR $(R_RESOURCES) NetSurf.app/Resources
$(Q)cp -pLR $(E_RESOURCES) NetSurf.app/
WebSurf.app: WebSurf $(FRONTEND_SOURCE_DIR)/Makefile $(R_RESOURCES) WebSurf.app/Resources/Info-gnustep.plist
$(VQ)echo Assembling WebSurf.app bundle
$(Q)cp WebSurf WebSurf.app/
$(Q)mkdir -p WebSurf.app/Resources
$(Q)cp -pLR $(R_RESOURCES) WebSurf.app/Resources
$(Q)cp -pLR $(E_RESOURCES) WebSurf.app/
NetSurf.app/Resources/Info-gnustep.plist: $(FRONTEND_RESOURCES_DIR)/NetSurf-Info.plist $(FRONTEND_SOURCE_DIR)/Makefile
WebSurf.app/Resources/Info-gnustep.plist: $(FRONTEND_RESOURCES_DIR)/WebSurf-Info.plist $(FRONTEND_SOURCE_DIR)/Makefile
$(VQ)echo Generating Info.plist
$(Q)rm -rf NetSurf.app/Resources
$(Q)mkdir -p NetSurf.app/Resources
$(Q)rm -rf WebSurf.app/Resources
$(Q)mkdir -p WebSurf.app/Resources
$(Q)sed -e 's/$${EXECUTABLE_NAME}/$(EXETARGET)/' \
-e 's/$${PRODUCT_NAME.*}/$(EXETARGET)/' \
-e 's/$${MACOSX_DEPLOYMENT_TARGET}/$(MACOSX_VERSION)/' \
-e 's/$${NETSURF_VERSION}/$(VERSION_FULL)/' \
-e 's/$${NETSURF_SHORT_VERSION}/$(VERSION_MAJ).$(VERSION_MIN)/' \
< $(FRONTEND_RESOURCES_DIR)/NetSurf-Info.plist > NetSurf.app/Resources/Info-gnustep.plist
< $(FRONTEND_RESOURCES_DIR)/WebSurf-Info.plist > WebSurf.app/Resources/Info-gnustep.plist
CLEANS += clean-package-cocoa
clean-package-cocoa:
$(VQ)echo " CLEAN: NetSurf.app"
$(Q)$(RM) -r NetSurf.app
$(VQ)echo " CLEAN: WebSurf.app"
$(Q)$(RM) -r WebSurf.app

View File

@ -7,7 +7,8 @@
"showFindPanel:",
"showHistoryWindow:",
"showBookmarksWindow:",
"showPreferencesWindow:"
"showPreferencesWindow:",
"openFileWindow:"
);
Outlets = (
);
@ -19,6 +20,7 @@
"didTapNewWindow:",
"findNext:",
"findPrevious:",
"openFileWindow:",
"newFolder:",
"newTab:",
"reload:",

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,12 +1,15 @@
{
ApplicationDescription = "World Wide Web Viewer";
ApplicationIcon = "NetSurf.tiff";
ApplicationName = NetSurf;
ApplicationDescription = "World Wide Web Browser";
ApplicationIcon = "WebSurf.tiff";
ApplicationName = WebSurf;
ApplicationRelease = "1.0";
Authors = (
"Vera Visions, LLC."
"NetSurf Team",
"Sven Weidauer (Cocoa port)",
"Anthony Cohn-Richardby (GNUstep port)",
"Marco Cawthorne (WebSurf, maintenance, UI work)"
);
CFBundleIdentifier = "com.vera-visions.NetSurf";
CFBundleIdentifier = "com.vera-visions.WebSurf";
CFBundleURLTypes = (
{
CFBundleURLName = "Website URL";
@ -16,11 +19,10 @@
);
}
);
Copyright = "Copyright \U00A9 2022 Vera Visions, LLC.";
Copyright = "Copyright \U00A9 2022 Vera Visions, L.L.C.";
GSMainMarkupFile = "";
NOTE = "Automatically generated, do not edit!";
NSExecutable = NetSurf;
NSIcon = "NetSurf.tiff";
NSExecutable = WebSurf;
NSIcon = "WebSurf.tiff";
NSMainNibFile = "MainMenu.gorm";
NSMainStoryboardFile = "";
NSPrincipalClass = NSApplication;
@ -28,10 +30,10 @@
NSServices = (
{
NSMenuItem = {
default = "Open URL in NetSurf";
default = "Open URL in WebSurf";
};
NSMessage = openURL;
NSPortName = NetSurf;
NSPortName = WebSurf;
NSSendTypes = (
NSURLPboardType,
NSStringPboardType

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 146 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 239 KiB