r9947 tlsa - /trunk/libnsfb/test/polystar2.c
by netsurf@semichrome.net
Author: tlsa
Date: Sun Jan 31 16:37:06 2010
New Revision: 9947
URL: http://source.netsurf-browser.org?rev=9947&view=rev
Log:
Minor changes to self crossing polygon test.
Modified:
trunk/libnsfb/test/polystar2.c
Modified: trunk/libnsfb/test/polystar2.c
URL: http://source.netsurf-browser.org/trunk/libnsfb/test/polystar2.c?rev=9947...
==============================================================================
--- trunk/libnsfb/test/polystar2.c (original)
+++ trunk/libnsfb/test/polystar2.c Sun Jan 31 16:37:06 2010
@@ -35,7 +35,6 @@
int radius;
nsfb_point_t *points;
int loop;
- double rotate;
int counter;
int colour;
@@ -62,7 +61,7 @@
sides = 5;
counter = 0;
- for (rotate = 0; rotate < (2 * M_PI); rotate += (M_PI / 4)) {
+ for (counter = 0; counter < 20; counter++) {
/* claim the whole screen for update */
nsfb_claim(nsfb, &box);
@@ -72,9 +71,9 @@
for (loop = 0; loop < sides;loop++) {
points[(2 * loop) % sides].x = (box.x1 / 2) +
- (radius * cos(loop * 2 * M_PI / sides + rotate));
+ (radius * cos(loop * 2 * M_PI / sides));
points[(2 * loop) % sides].y = (box.y1 / 2) +
- (radius * sin(loop * 2 * M_PI / sides + rotate));
+ (radius * sin(loop * 2 * M_PI / sides));
}
if (counter % 3 == 0)
@@ -87,9 +86,7 @@
nsfb_plot_polygon(nsfb, (const int *)points, sides, colour);
free(points);
- if (counter % 2 == 0)
- sides += 2;
- counter++;
+ sides += 2;
nsfb_update(nsfb, &box);
sleepMilli(400);
13 years, 7 months
r9946 tlsa - /trunk/libnsfb/src/plot/generic.c
by netsurf@semichrome.net
Author: tlsa
Date: Sun Jan 31 16:29:01 2010
New Revision: 9946
URL: http://source.netsurf-browser.org?rev=9946&view=rev
Log:
Improve rounding of fill span endpoints for polygon plotter.
Modified:
trunk/libnsfb/src/plot/generic.c
Modified: trunk/libnsfb/src/plot/generic.c
URL: http://source.netsurf-browser.org/trunk/libnsfb/src/plot/generic.c?rev=99...
==============================================================================
--- trunk/libnsfb/src/plot/generic.c (original)
+++ trunk/libnsfb/src/plot/generic.c Sun Jan 31 16:29:01 2010
@@ -173,9 +173,22 @@
} else {
/* find crossing (intersection of this line and
* current y level) */
- x_new = p_x0 + ((long long)
- (y - p_y0) * (p_x1 - p_x0)) /
- (p_y1 - p_y0);
+ int numerator = (y - p_y0) * (p_x1 - p_x0);
+ int denominator = (p_y1 - p_y0);
+
+ /* To round to nearest (rather than down)
+ * half the denominator is either added to
+ * or subtracted from the numerator,
+ * depending on whether the numerator and
+ * denominator have the same sign */
+ if ((numerator < 0) == (denominator < 0))
+ x_new = p_x0 + (numerator +
+ (denominator / 2)) /
+ denominator;
+ else
+ x_new = p_x0 + (numerator -
+ (denominator / 2)) /
+ denominator;
}
/* ignore crossings before current x */
13 years, 7 months
r9945 tlsa - in /trunk/netsurfweb: ./ projects/ projects/hubbub/ projects/iconv/ projects/libcss/ projects/libdom/ projects/libnsbmp/ projects/libnsgif/ projects/libparserutils/ projects/libpencil/ projects/libsvgtiny/ projects/libwapcaplet/ projects/rufl/ projects/tinct/
by netsurf@semichrome.net
Author: tlsa
Date: Sun Jan 31 15:12:14 2010
New Revision: 9945
URL: http://source.netsurf-browser.org?rev=9945&view=rev
Log:
s/Libdom/LibDOM/
Modified:
trunk/netsurfweb/index.en
trunk/netsurfweb/projects/hubbub/index.en
trunk/netsurfweb/projects/iconv/index.en
trunk/netsurfweb/projects/index.en
trunk/netsurfweb/projects/libcss/index.en
trunk/netsurfweb/projects/libdom/index.en
trunk/netsurfweb/projects/libnsbmp/index.en
trunk/netsurfweb/projects/libnsgif/index.en
trunk/netsurfweb/projects/libparserutils/index.en
trunk/netsurfweb/projects/libpencil/index.en
trunk/netsurfweb/projects/libsvgtiny/index.en
trunk/netsurfweb/projects/libwapcaplet/index.en
trunk/netsurfweb/projects/rufl/index.en
trunk/netsurfweb/projects/tinct/index.en
Modified: trunk/netsurfweb/index.en
URL: http://source.netsurf-browser.org/trunk/netsurfweb/index.en?rev=9945&r1=9...
==============================================================================
--- trunk/netsurfweb/index.en (original)
+++ trunk/netsurfweb/index.en Sun Jan 31 15:12:14 2010
@@ -55,7 +55,7 @@
<dd>HTML5 compliant parsing library</dd>
<dt><a href="/projects/libcss/">LibCSS</a><dt>
<dd>CSS parser and selection library<dd>
-<dt><a href="/projects/libdom/">Libdom</a></dt>
+<dt><a href="/projects/libdom/">LibDOM</a></dt>
<dd>DOM library</dd>
<dt><a href="/projects/libparserutils/">LibParserUtils</a><dt>
<dd>Parser building library<dd>
Modified: trunk/netsurfweb/projects/hubbub/index.en
URL: http://source.netsurf-browser.org/trunk/netsurfweb/projects/hubbub/index....
==============================================================================
--- trunk/netsurfweb/projects/hubbub/index.en (original)
+++ trunk/netsurfweb/projects/hubbub/index.en Sun Jan 31 15:12:14 2010
@@ -13,7 +13,7 @@
<li><a href="/">NetSurf</a></li>
<li><strong>Hubbub</strong></li>
<li><a href="/projects/libcss/">LibCSS</a></li>
-<li><a href="/projects/libdom/">Libdom</a></li>
+<li><a href="/projects/libdom/">LibDOM</a></li>
<li><a href="/projects/libparserutils/">LibParserUtils</a></li>
<li><a href="/projects/libwapcaplet/">LibWapcaplet</a></li>
<li><a href="/projects/libsvgtiny/">Libsvgtiny</a></li>
Modified: trunk/netsurfweb/projects/iconv/index.en
URL: http://source.netsurf-browser.org/trunk/netsurfweb/projects/iconv/index.e...
==============================================================================
--- trunk/netsurfweb/projects/iconv/index.en (original)
+++ trunk/netsurfweb/projects/iconv/index.en Sun Jan 31 15:12:14 2010
@@ -13,7 +13,7 @@
<li><a href="/">NetSurf</a></li>
<li><a href="/projects/hubbub/">Hubbub</a></li>
<li><a href="/projects/libcss/">LibCSS</a></li>
-<li><a href="/projects/libdom/">Libdom</a></li>
+<li><a href="/projects/libdom/">LibDOM</a></li>
<li><a href="/projects/libparserutils/">LibParserUtils</a></li>
<li><a href="/projects/libwapcaplet/">LibWapcaplet</a></li>
<li><a href="/projects/libsvgtiny/">Libsvgtiny</a></li>
Modified: trunk/netsurfweb/projects/index.en
URL: http://source.netsurf-browser.org/trunk/netsurfweb/projects/index.en?rev=...
==============================================================================
--- trunk/netsurfweb/projects/index.en (original)
+++ trunk/netsurfweb/projects/index.en Sun Jan 31 15:12:14 2010
@@ -13,7 +13,7 @@
<li><a href="/">NetSurf</a></li>
<li><a href="/projects/hubbub/">Hubbub</a></li>
<li><a href="/projects/libcss/">LibCSS</a></li>
-<li><a href="/projects/libdom/">Libdom</a></li>
+<li><a href="/projects/libdom/">LibDOM</a></li>
<li><a href="/projects/libparserutils/">LibParserUtils</a></li>
<li><a href="/projects/libwapcaplet/">LibWapcaplet</a></li>
<li><a href="/projects/libsvgtiny/">Libsvgtiny</a></li>
@@ -39,7 +39,7 @@
<dd>HTML5 compliant parsing library<dd>
<dt><a href="/projects/libcss/">LibCSS</a><dt>
<dd>CSS parser and selection library<dd>
-<dt><a href="/projects/libdom/">Libdom</a><dt>
+<dt><a href="/projects/libdom/">LibDOM</a><dt>
<dd>DOM library<dd>
<dt><a href="/projects/libparserutils/">LibParserUtils</a><dt>
<dd>Parser building library<dd>
Modified: trunk/netsurfweb/projects/libcss/index.en
URL: http://source.netsurf-browser.org/trunk/netsurfweb/projects/libcss/index....
==============================================================================
--- trunk/netsurfweb/projects/libcss/index.en (original)
+++ trunk/netsurfweb/projects/libcss/index.en Sun Jan 31 15:12:14 2010
@@ -13,7 +13,7 @@
<li><a href="/">NetSurf</a></li>
<li><a href="/projects/hubbub/">Hubbub</a></li>
<li><strong>LibCSS</strong></li>
-<li><a href="/projects/libdom/">Libdom</a></li>
+<li><a href="/projects/libdom/">LibDOM</a></li>
<li><a href="/projects/libparserutils/">LibParserUtils</a></li>
<li><a href="/projects/libwapcaplet/">LibWapcaplet</a></li>
<li><a href="/projects/libsvgtiny/">Libsvgtiny</a></li>
Modified: trunk/netsurfweb/projects/libdom/index.en
URL: http://source.netsurf-browser.org/trunk/netsurfweb/projects/libdom/index....
==============================================================================
--- trunk/netsurfweb/projects/libdom/index.en (original)
+++ trunk/netsurfweb/projects/libdom/index.en Sun Jan 31 15:12:14 2010
@@ -2,7 +2,7 @@
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
-<title>Libdom | DOM Library</title>
+<title>LibDOM | DOM Library</title>
<link rel="stylesheet" type="text/css" href="/projects/projects.css">
<link rel="icon" type="image/png" href="/webimages/favicon.png">
</head>
@@ -13,7 +13,7 @@
<li><a href="/">NetSurf</a></li>
<li><a href="/projects/hubbub/">Hubbub</a></li>
<li><a href="/projects/libcss/">LibCSS</a></li>
-<li><strong>Libdom</strong></li>
+<li><strong>LibDOM</strong></li>
<li><a href="/projects/libparserutils/">LibParserUtils</a></li>
<li><a href="/projects/libwapcaplet/">LibWapcaplet</a></li>
<li><a href="/projects/libsvgtiny/">Libsvgtiny</a></li>
@@ -26,11 +26,11 @@
</ul>
</div>
-<h1>Libdom</h1>
+<h1>LibDOM</h1>
-<h2>What is Libdom?</h2>
+<h2>What is LibDOM?</h2>
-<p>Libdom is an implementation of the <a href="http://www.w3.org/DOM/">W3C DOM</a>, written in C. It is currently in development for use with <a href="/">NetSurf</a> and is intended to be suitable for use in other projects too. For further details, see the <a href="http://source.netsurf-browser.org/trunk/dom/README">readme</a>.</p>
+<p>LibDOM is an implementation of the <a href="http://www.w3.org/DOM/">W3C DOM</a>, written in C. It is currently in development for use with <a href="/">NetSurf</a> and is intended to be suitable for use in other projects too. For further details, see the <a href="http://source.netsurf-browser.org/trunk/dom/README">readme</a>.</p>
<h2>Source code</h2>
@@ -38,11 +38,11 @@
<p class="svncommand">$ svn co svn://svn.netsurf-browser.org/trunk/dom</p>
-<p>Libdom is licensed under the <a href="http://opensource.org/licenses/mit-license.php">MIT Licence</a>.</p>
+<p>LibDOM is licensed under the <a href="http://opensource.org/licenses/mit-license.php">MIT Licence</a>.</p>
<h2>Contact</h2>
-<p>If you would like to help develop Libdom, or have questions about the library, please join the NetSurf <a href="http://www.netsurf-browser.org/lists/netsurf-dev">developer mailing list</a>.</p>
+<p>If you would like to help develop LibDOM, or have questions about the library, please join the NetSurf <a href="http://www.netsurf-browser.org/lists/netsurf-dev">developer mailing list</a>.</p>
</body>
</html>
Modified: trunk/netsurfweb/projects/libnsbmp/index.en
URL: http://source.netsurf-browser.org/trunk/netsurfweb/projects/libnsbmp/inde...
==============================================================================
--- trunk/netsurfweb/projects/libnsbmp/index.en (original)
+++ trunk/netsurfweb/projects/libnsbmp/index.en Sun Jan 31 15:12:14 2010
@@ -13,7 +13,7 @@
<li><a href="/">NetSurf</a></li>
<li><a href="/projects/hubbub/">Hubbub</a></li>
<li><a href="/projects/libcss/">LibCSS</a></li>
-<li><a href="/projects/libdom/">Libdom</a></li>
+<li><a href="/projects/libdom/">LibDOM</a></li>
<li><a href="/projects/libparserutils/">LibParserUtils</a></li>
<li><a href="/projects/libwapcaplet/">LibWapcaplet</a></li>
<li><a href="/projects/libsvgtiny/">Libsvgtiny</a></li>
Modified: trunk/netsurfweb/projects/libnsgif/index.en
URL: http://source.netsurf-browser.org/trunk/netsurfweb/projects/libnsgif/inde...
==============================================================================
--- trunk/netsurfweb/projects/libnsgif/index.en (original)
+++ trunk/netsurfweb/projects/libnsgif/index.en Sun Jan 31 15:12:14 2010
@@ -13,7 +13,7 @@
<li><a href="/">NetSurf</a></li>
<li><a href="/projects/hubbub/">Hubbub</a></li>
<li><a href="/projects/libcss/">LibCSS</a></li>
-<li><a href="/projects/libdom/">Libdom</a></li>
+<li><a href="/projects/libdom/">LibDOM</a></li>
<li><a href="/projects/libparserutils/">LibParserUtils</a></li>
<li><a href="/projects/libwapcaplet/">LibWapcaplet</a></li>
<li><a href="/projects/libsvgtiny/">Libsvgtiny</a></li>
Modified: trunk/netsurfweb/projects/libparserutils/index.en
URL: http://source.netsurf-browser.org/trunk/netsurfweb/projects/libparserutil...
==============================================================================
--- trunk/netsurfweb/projects/libparserutils/index.en (original)
+++ trunk/netsurfweb/projects/libparserutils/index.en Sun Jan 31 15:12:14 2010
@@ -13,7 +13,7 @@
<li><a href="/">NetSurf</a></li>
<li><a href="/projects/hubbub/">Hubbub</a></li>
<li><a href="/projects/libcss/">LibCSS</a></li>
-<li><a href="/projects/libdom/">Libdom</a></li>
+<li><a href="/projects/libdom/">LibDOM</a></li>
<li><strong>LibParserUtils</strong></li>
<li><a href="/projects/libwapcaplet/">LibWapcaplet</a></li>
<li><a href="/projects/libsvgtiny/">Libsvgtiny</a></li>
Modified: trunk/netsurfweb/projects/libpencil/index.en
URL: http://source.netsurf-browser.org/trunk/netsurfweb/projects/libpencil/ind...
==============================================================================
--- trunk/netsurfweb/projects/libpencil/index.en (original)
+++ trunk/netsurfweb/projects/libpencil/index.en Sun Jan 31 15:12:14 2010
@@ -13,7 +13,7 @@
<li><a href="/">NetSurf</a></li>
<li><a href="/projects/hubbub/">Hubbub</a></li>
<li><a href="/projects/libcss/">LibCSS</a></li>
-<li><a href="/projects/libdom/">Libdom</a></li>
+<li><a href="/projects/libdom/">LibDOM</a></li>
<li><a href="/projects/libparserutils/">LibParserUtils</a></li>
<li><a href="/projects/libwapcaplet/">LibWapcaplet</a></li>
<li><a href="/projects/libsvgtiny/">Libsvgtiny</a></li>
Modified: trunk/netsurfweb/projects/libsvgtiny/index.en
URL: http://source.netsurf-browser.org/trunk/netsurfweb/projects/libsvgtiny/in...
==============================================================================
--- trunk/netsurfweb/projects/libsvgtiny/index.en (original)
+++ trunk/netsurfweb/projects/libsvgtiny/index.en Sun Jan 31 15:12:14 2010
@@ -13,7 +13,7 @@
<li><a href="/">NetSurf</a></li>
<li><a href="/projects/hubbub/">Hubbub</a></li>
<li><a href="/projects/libcss/">LibCSS</a></li>
-<li><a href="/projects/libdom/">Libdom</a></li>
+<li><a href="/projects/libdom/">LibDOM</a></li>
<li><a href="/projects/libparserutils/">LibParserUtils</a></li>
<li><a href="/projects/libwapcaplet/">LibWapcaplet</a></li>
<li><strong>Libsvgtiny</strong></li>
Modified: trunk/netsurfweb/projects/libwapcaplet/index.en
URL: http://source.netsurf-browser.org/trunk/netsurfweb/projects/libwapcaplet/...
==============================================================================
--- trunk/netsurfweb/projects/libwapcaplet/index.en (original)
+++ trunk/netsurfweb/projects/libwapcaplet/index.en Sun Jan 31 15:12:14 2010
@@ -13,7 +13,7 @@
<li><a href="/">NetSurf</a></li>
<li><a href="/projects/hubbub/">Hubbub</a></li>
<li><a href="/projects/libcss/">LibCSS</a></li>
-<li><a href="/projects/libdom/">Libdom</a></li>
+<li><a href="/projects/libdom/">LibDOM</a></li>
<li><a href="/projects/libparserutils/">LibParserUtils</a></li>
<li><strong>LibWapcaplet</strong></li>
<li><a href="/projects/libsvgtiny/">Libsvgtiny</a></li>
Modified: trunk/netsurfweb/projects/rufl/index.en
URL: http://source.netsurf-browser.org/trunk/netsurfweb/projects/rufl/index.en...
==============================================================================
--- trunk/netsurfweb/projects/rufl/index.en (original)
+++ trunk/netsurfweb/projects/rufl/index.en Sun Jan 31 15:12:14 2010
@@ -13,7 +13,7 @@
<li><a href="/">NetSurf</a></li>
<li><a href="/projects/hubbub/">Hubbub</a></li>
<li><a href="/projects/libcss/">LibCSS</a></li>
-<li><a href="/projects/libdom/">Libdom</a></li>
+<li><a href="/projects/libdom/">LibDOM</a></li>
<li><a href="/projects/libparserutils/">LibParserUtils</a></li>
<li><a href="/projects/libwapcaplet/">LibWapcaplet</a></li>
<li><a href="/projects/libsvgtiny/">Libsvgtiny</a></li>
Modified: trunk/netsurfweb/projects/tinct/index.en
URL: http://source.netsurf-browser.org/trunk/netsurfweb/projects/tinct/index.e...
==============================================================================
--- trunk/netsurfweb/projects/tinct/index.en (original)
+++ trunk/netsurfweb/projects/tinct/index.en Sun Jan 31 15:12:14 2010
@@ -13,7 +13,7 @@
<li><a href="/">NetSurf</a></li>
<li><a href="/projects/hubbub/">Hubbub</a></li>
<li><a href="/projects/libcss/">LibCSS</a></li>
-<li><a href="/projects/libdom/">Libdom</a></li>
+<li><a href="/projects/libdom/">LibDOM</a></li>
<li><a href="/projects/libparserutils/">LibParserUtils</a></li>
<li><a href="/projects/libwapcaplet/">LibWapcaplet</a></li>
<li><a href="/projects/libsvgtiny/">Libsvgtiny</a></li>
13 years, 7 months
r9944 tlsa - /trunk/netsurf/Docs/BUILDING-Windows
by netsurf@semichrome.net
Author: tlsa
Date: Sun Jan 31 06:45:03 2010
New Revision: 9944
URL: http://source.netsurf-browser.org?rev=9944&view=rev
Log:
Formatting changes.
Modified:
trunk/netsurf/Docs/BUILDING-Windows
Modified: trunk/netsurf/Docs/BUILDING-Windows
URL: http://source.netsurf-browser.org/trunk/netsurf/Docs/BUILDING-Windows?rev...
==============================================================================
--- trunk/netsurf/Docs/BUILDING-Windows (original)
+++ trunk/netsurf/Docs/BUILDING-Windows Sun Jan 31 06:45:03 2010
@@ -1,5 +1,5 @@
--------------------------------------------------------------------------------
- Build Instructions for Windows NetSurf 17 January 2010
+ Build Instructions for Windows NetSurf 17 January 2010
--------------------------------------------------------------------------------
This document provides instructions for building the Windows version
@@ -7,6 +7,7 @@
dependencies.
Windows NetSurf has been tested on Wine and Vista.
+
Building and executing NetSurf
================================
@@ -55,7 +56,6 @@
$ i586-mingw32msvc-strip NetSurf.exe
-
Obtaining NetSurf's build dependencies
========================================
@@ -92,37 +92,34 @@
zlib:
- $ apt-get source zlib1g
- $ cd zlib-1.2.3.3.dfsg
- $ CC=i586-mingw32msvc-gcc AR=i586-mingw32msvc-ar RANLIB=i586-mingw32msvc-ranlib CFLAGS="-DNO_FSEEKO" ./configure --prefix=/usr/i586-mingw32msvc/
- $ make
- $ sudo make install
-
+ $ apt-get source zlib1g
+ $ cd zlib-1.2.3.3.dfsg
+ $ CC=i586-mingw32msvc-gcc AR=i586-mingw32msvc-ar RANLIB=i586-mingw32msvc-ranlib CFLAGS="-DNO_FSEEKO" ./configure --prefix=/usr/i586-mingw32msvc/
+ $ make
+ $ sudo make install
libiconv:
- $ wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.13.1.tar.gz
- $ tar -zxf libiconv-1.13.1.tar.gz
- $ cd libiconv-1.13.1
- $ ./configure --prefix=/usr/i586-mingw32msvc/ --host=i586-mingw32msvc --disable-shared
- $ make
- $ sudo make install
-
+ $ wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.13.1.tar.gz
+ $ tar -zxf libiconv-1.13.1.tar.gz
+ $ cd libiconv-1.13.1
+ $ ./configure --prefix=/usr/i586-mingw32msvc/ --host=i586-mingw32msvc --disable-shared
+ $ make
+ $ sudo make install
regex:
- $ wget http://downloads.sourceforge.net/project/mingw/User%20Contributed/regex/m...
- $ tar -zxf mingw-libgnurx-2.5.1-src.tar.gz
- $ ./configure --prefix=/usr/i586-mingw32msvc/ --host=i586-mingw32msvc
- $ make
- $ sudo make install
-
+ $ wget http://downloads.sourceforge.net/project/mingw/User%20Contributed/regex/m...
+ $ tar -zxf mingw-libgnurx-2.5.1-src.tar.gz
+ $ ./configure --prefix=/usr/i586-mingw32msvc/ --host=i586-mingw32msvc
+ $ make
+ $ sudo make install
openssl:
- $ wget http://www.openssl.org/source/openssl-0.9.8l.tar.gz
- $ tar -zxf openssl-0.9.8l.tar.gz
- $ cd openssl-0.9.8l
+ $ wget http://www.openssl.org/source/openssl-0.9.8l.tar.gz
+ $ tar -zxf openssl-0.9.8l.tar.gz
+ $ cd openssl-0.9.8l
--- openssl-0.9.8l/Configure 2009-11-05 12:07:06.000000000 +0000
+++ openssl-0.9.8l-work/Configure 2010-01-25 12:35:13.000000000 +0000
@@ -147,42 +144,39 @@
# define OPENSSL_GLOBAL_REF(name) (*(_shadow_##name()))
#else
- $ ./Configure no-shared --prefix=/usr/i586-mingw32msvc/ mingw
- $ make CC=i586-mingw32msvc-gcc RANLIB=i586-mingw32msvc-ranlib
-
+ $ ./Configure no-shared --prefix=/usr/i586-mingw32msvc/ mingw
+ $ make CC=i586-mingw32msvc-gcc RANLIB=i586-mingw32msvc-ranlib
libxml:
- $ apt-get source libxml2
- $ cd libxml2-2.6.32.dfsg/
- $ ./configure --prefix=/usr/i586-mingw32msvc/ --disable-shared --host=i586-mingw32msvc
- $ make
- $ sudo make install
-
+ $ apt-get source libxml2
+ $ cd libxml2-2.6.32.dfsg/
+ $ ./configure --prefix=/usr/i586-mingw32msvc/ --disable-shared --host=i586-mingw32msvc
+ $ make
+ $ sudo make install
libcurl:
- $ LDFLAGS=-mwindows ./configure --prefix=/usr/i586-mingw32msvc/ --host=i586-mingw32msvc --disable-shared --disable-ldap
- $ make
- $ sudo make install
-
+ $ LDFLAGS=-mwindows ./configure --prefix=/usr/i586-mingw32msvc/ --host=i586-mingw32msvc --disable-shared --disable-ldap
+ $ make
+ $ sudo make install
libpng:
- $ wget "http://downloads.sourceforge.net/project/libpng/01-libpng-master/1.4.0/li..."
- $ tar -zxf libpng-1.4.0.tar.gz
- $ cd libpng-1.4.0
- $ make
- $ sudo make install
-
+
+ $ wget "http://downloads.sourceforge.net/project/libpng/01-libpng-master/1.4.0/li..."
+ $ tar -zxf libpng-1.4.0.tar.gz
+ $ cd libpng-1.4.0
+ $ make
+ $ sudo make install
libjpeg:
-wget http://www.ijg.org/files/jpegsrc.v8.tar.gz
-tar -zxf jpegsrc.v8.tar.gz
-cd jpeg-8
-./configure --prefix=/usr/i586-mingw32msvc/ --host=i586-mingw32msvc --disable-shared
-make
-sudo make install
+ $ wget http://www.ijg.org/files/jpegsrc.v8.tar.gz
+ $ tar -zxf jpegsrc.v8.tar.gz
+ $ cd jpeg-8
+ $ ./configure --prefix=/usr/i586-mingw32msvc/ --host=i586-mingw32msvc --disable-shared
+ $ make
+ $ sudo make install
The NetSurf project's libraries
---------------------------------
@@ -224,5 +218,5 @@
file included in the svn distribution of NetSurf that could be
manually compiled
- $ cd windows/res
- $ i586-mingw32msvc-windres resource.rc -O coff -o resource.o
+ $ cd windows/res
+ $ i586-mingw32msvc-windres resource.rc -O coff -o resource.o
13 years, 7 months
r9943 jmb - in /branches/jmb/new-cache: ./ Docs/ amiga/ content/ content/fetchers/ desktop/ image/ render/ utils/ windows/ windows/res/
by netsurf@semichrome.net
Author: jmb
Date: Sun Jan 31 06:22:57 2010
New Revision: 9943
URL: http://source.netsurf-browser.org?rev=9943&view=rev
Log:
Sync with trunk
Added:
branches/jmb/new-cache/Docs/BUILDING-Windows
- copied unchanged from r9942, trunk/netsurf/Docs/BUILDING-Windows
branches/jmb/new-cache/utils/utsname.h
- copied unchanged from r9942, trunk/netsurf/utils/utsname.h
branches/jmb/new-cache/windows/
- copied from r9942, trunk/netsurf/windows/
Modified:
branches/jmb/new-cache/Makefile
branches/jmb/new-cache/Makefile.defaults
branches/jmb/new-cache/Makefile.resources
branches/jmb/new-cache/Makefile.sources
branches/jmb/new-cache/amiga/download.c
branches/jmb/new-cache/amiga/gui_options.c
branches/jmb/new-cache/content/fetch.c
branches/jmb/new-cache/content/fetch.h
branches/jmb/new-cache/content/fetchers/fetch_curl.c
branches/jmb/new-cache/content/fetchers/fetch_data.c
branches/jmb/new-cache/content/urldb.c
branches/jmb/new-cache/desktop/browser.c
branches/jmb/new-cache/desktop/gui.h
branches/jmb/new-cache/desktop/netsurf.c
branches/jmb/new-cache/image/bmp.c
branches/jmb/new-cache/image/jpeg.c
branches/jmb/new-cache/image/png.c
branches/jmb/new-cache/render/html.c
branches/jmb/new-cache/utils/config.h
branches/jmb/new-cache/utils/filename.c
branches/jmb/new-cache/utils/useragent.c
branches/jmb/new-cache/utils/utils.c
branches/jmb/new-cache/utils/utils.h
branches/jmb/new-cache/windows/res/ (props changed)
Modified: branches/jmb/new-cache/Makefile
URL: http://source.netsurf-browser.org/branches/jmb/new-cache/Makefile?rev=994...
==============================================================================
--- branches/jmb/new-cache/Makefile (original)
+++ branches/jmb/new-cache/Makefile Sun Jan 31 06:22:57 2010
@@ -93,7 +93,9 @@
ifneq ($(TARGET),beos)
ifneq ($(TARGET),amiga)
ifneq ($(TARGET),framebuffer)
- $(error Unknown TARGET "$(TARGET)", should either be "riscos", "gtk", "beos", "amiga", or "framebuffer")
+ ifneq ($(TARGET),windows)
+ $(error Unknown TARGET "$(TARGET)", should either be "riscos", "gtk", "beos", "amiga", "framebuffer" or "windows")
+ endif
endif
endif
endif
@@ -162,8 +164,20 @@
PKG_CONFIG :=
#endif
else
- # Building for GTK, Amiga, or Framebuffer
- PKG_CONFIG := pkg-config
+ ifeq ($(TARGET),windows)
+ ifneq ($(HOST),windows)
+ # Set Mingw defaults
+ MINGW_PREFIX ?= i586-mingw32msvc-
+ MINGW_INSTALL_ENV ?= /usr/i586-mingw32msvc/
+
+ # mingw cross-compile
+ CC := $(MINGW_PREFIX)gcc
+ PKG_CONFIG := $(MINGW_INSTALL_ENV)/bin/pkg-config
+ endif
+ else
+ # Building for GTK, Amiga, Framebuffer
+ PKG_CONFIG := pkg-config
+ endif
endif
endif
@@ -435,13 +449,42 @@
CFLAGS += $(GTKCFLAGS)
LDFLAGS += $(GTKLDFLAGS)
- # ----------------------------------------------------------------------------
+ # ---------------------------------------------------------------------------
# Windows flag setup
- # ----------------------------------------------------------------------------
+ # ---------------------------------------------------------------------------
ifeq ($(HOST),Windows_NT)
CFLAGS += -U__STRICT_ANSI__
endif
+endif
+
+# ----------------------------------------------------------------------------
+# Windows target setup
+# ----------------------------------------------------------------------------
+ifeq ($(TARGET),windows)
+ NETSURF_FEATURE_NSSVG_CFLAGS := -DWITH_NSSVG
+ NETSURF_FEATURE_ROSPRITE_CFLAGS := -DWITH_NSSPRITE
+ NETSURF_FEATURE_BMP_CFLAGS := -DWITH_BMP
+ NETSURF_FEATURE_GIF_CFLAGS := -DWITH_GIF
+ NETSURF_FEATURE_PNG_CFLAGS := -DWITH_PNG
+ $(eval $(call feature_enabled,BMP,-DWITH_BMP,-lnsbmp,NetSurf BMP decoder))
+ $(eval $(call feature_enabled,GIF,-DWITH_GIF,-lnsgif,NetSurf GIF decoder))
+ $(eval $(call feature_enabled,PNG,-DWITH_PNG,-lpng,PNG support))
+ $(eval $(call feature_enabled,NSSVG,-DWITH_NS_SVG,-lsvgtiny,SVG rendering))
+ $(eval $(call feature_enabled,MNG,,-llcms -ljpeg,MNG additional support))
+
+ LDFLAGS += -L${MINGW_INSTALL_ENV}/lib $(shell $(PKG_CONFIG) --libs zlib \
+ libxml-2.0 libcurl libhubbub libparserutils libcss libwapcaplet) \
+ -lparserutils -lssl -lcrypto -lregex -liconv -lcss -lwapcaplet \
+ -lgdi32 -lcomctl32 -lws2_32 -lmsimg32 -mwindows
+ CFLAGS += -U__STRICT_ANSI__ -mwin32
+ WSCFLAGS := -std=c99 \
+ $(WARNFLAGS) -I. -I/${MINGW_INSTALL_ENV}/include \
+ -DCURL_STATICLIB \
+ $(shell $(PKG_CONFIG) --cflags libcurl libhubbub zlib libparserutils \
+ libxml-2.0) -g
+ CFLAGS += $(WSCFLAGS)
+ LDFLAGS += $(WSCFLAGS)
endif
# ----------------------------------------------------------------------------
@@ -554,6 +597,9 @@
$(Q)$(CC) -o $(EXETARGET:,ff8=,e1f) $(OBJECTS) $(LDFLAGS)
$(Q)$(ELF2AIF) $(EXETARGET:,ff8=,e1f) $(EXETARGET)
$(Q)$(RM) $(EXETARGET:,ff8=,e1f)
+endif
+ifeq ($(TARGET),windows)
+ $(Q)$(TOUCH) windows/res/preferences
endif
ifeq ($(TARGET),gtk)
$(Q)$(TOUCH) gtk/res/toolbarIndices
Modified: branches/jmb/new-cache/Makefile.defaults
URL: http://source.netsurf-browser.org/branches/jmb/new-cache/Makefile.default...
==============================================================================
--- branches/jmb/new-cache/Makefile.defaults (original)
+++ branches/jmb/new-cache/Makefile.defaults Sun Jan 31 06:22:57 2010
@@ -229,6 +229,34 @@
endif
+# ----------------------------------------------------------------------------
+# windows-specific options
+# ----------------------------------------------------------------------------
+ifeq ($(TARGET),windows)
+
+ # Enable NetSurf's use of librosprite for displaying RISC OS Sprites
+ # Valid options: YES, NO, AUTO
+ NETSURF_USE_ROSPRITE := NO
+
+ # Enable NetSurf's use of libsvgtiny for displaying SVGs
+ # Valid options: YES, NO
+ NETSURF_USE_NSSVG := NO
+
+ # Force using glibc internal iconv implementation instead of external libiconv
+ # Valid options: YES, NO
+ NETSURF_USE_LIBICONV_PLUG := NO
+
+ # mng support does not currently build on windows
+ NETSURF_USE_MNG := NO
+
+ # no pdf support
+ NETSURF_USE_HARU_PDF := NO
+
+ # Optimisation levels
+ CFLAGS += -O2 -Wuninitialized
+
+endif
+
# Include any local configuration
-include Makefile.config
Modified: branches/jmb/new-cache/Makefile.resources
URL: http://source.netsurf-browser.org/branches/jmb/new-cache/Makefile.resourc...
==============================================================================
--- branches/jmb/new-cache/Makefile.resources (original)
+++ branches/jmb/new-cache/Makefile.resources Sun Jan 31 06:22:57 2010
@@ -62,7 +62,16 @@
$(eval $(foreach V,$(filter FB_IMAGE_%,$(.VARIABLES)),$(call convert_image,$($(V)),$(OBJROOT)/$(patsubst FB_IMAGE_%,%,$(V)).c,$(patsubst FB_IMAGE_%,%,$(V)))))
+# End of framebuffer resource definitions
+endif
+ifeq ($(TARGET),windows)
-# End of framebuffer resource definitions
-endif
+$(OBJROOT)/windows_resource.o: windows/res/resource.rc
+ $(VQ)echo " WINDRES: compiling windows resources"
+ ${Q}$(MINGW_PREFIX)windres $< -O coff -o $@
+
+S_RESOURCES := windows_resource.o
+
+# End of windows resource definitions
+endif
Modified: branches/jmb/new-cache/Makefile.sources
URL: http://source.netsurf-browser.org/branches/jmb/new-cache/Makefile.sources...
==============================================================================
--- branches/jmb/new-cache/Makefile.sources (original)
+++ branches/jmb/new-cache/Makefile.sources Sun Jan 31 06:22:57 2010
@@ -65,6 +65,12 @@
$(addprefix dialogs/,gtk_options.c gtk_about.c gtk_source.c)
S_GTK := $(addprefix gtk/,$(S_GTK)) $(addprefix utils/,container.c)
# code in utils/container.ch is non-universal it seems
+
+# S_WINDOWS are sources purely for the windows build
+S_WINDOWS := about.c bitmap.c download.c filetype.c findfile.c font.c \
+ gui.c history.c hotlist.c localhistory.c login.c misc.c plot.c \
+ prefs.c schedule.c thumbnail.c tree.c
+S_WINDOWS := $(addprefix windows/,$(S_WINDOWS))
# S_BEOS are sources purely for the BeOS build
S_BEOS := beos_about.cpp beos_bitmap.cpp beos_fetch_rsrc.cpp \
@@ -162,6 +168,11 @@
EXETARGET := nsfb$(SUBTARGET)
endif
+ifeq ($(TARGET),windows)
+SOURCES := $(S_COMMON) $(S_IMAGE) $(S_BROWSER) $(S_WINDOWS) $(S_RESOURCES)
+EXETARGET := NetSurf.exe
+endif
+
ifeq ($(SOURCES),)
$(error Unable to build NetSurf, could not determine set of sources to build)
endif
Modified: branches/jmb/new-cache/amiga/download.c
URL: http://source.netsurf-browser.org/branches/jmb/new-cache/amiga/download.c...
==============================================================================
--- branches/jmb/new-cache/amiga/download.c (original)
+++ branches/jmb/new-cache/amiga/download.c Sun Jan 31 06:22:57 2010
@@ -32,6 +32,7 @@
#include "amiga/options.h"
#include "amiga/bitmap.h"
#include "amiga/iff_dr2d.h"
+#include "amiga/arexx.h" /* temporarily required for notifications */
#include "content/fetch.h"
@@ -198,8 +199,19 @@
struct dlnode *dln,*dln2;
struct browser_window *bw = dw->bw;
bool queuedl = false;
+ STRPTR sendcmd = NULL;
if(!dw) return;
+
+ if(option_download_notify)
+ {
+ if(sendcmd = ASPrintf("RINGHIO APP=NetSurf SCREEN=FRONT TITLE=NetSurf \"%s downloaded\"",dw->url))
+ {
+ IDoMethod(arexx_obj, AM_EXECUTE, sendcmd, "RINGHIO",
+ NULL, NULL, NULL, NULL);
+ FreeVec(sendcmd);
+ }
+ }
bw->download = false;
if(dw->url) free(dw->url);
Modified: branches/jmb/new-cache/amiga/gui_options.c
URL: http://source.netsurf-browser.org/branches/jmb/new-cache/amiga/gui_option...
==============================================================================
--- branches/jmb/new-cache/amiga/gui_options.c (original)
+++ branches/jmb/new-cache/amiga/gui_options.c Sun Jan 31 06:22:57 2010
@@ -1,5 +1,5 @@
/*
- * Copyright 2009 Chris Young <chris(a)unsatisfactorysoftware.co.uk>
+ * Copyright 2009, 2010 Chris Young <chris(a)unsatisfactorysoftware.co.uk>
*
* This file is part of NetSurf, http://www.netsurf-browser.org/
*
@@ -21,6 +21,7 @@
#include <proto/exec.h>
#include <proto/intuition.h>
#include <proto/utility.h>
+#include <proto/application.h>
#include <libraries/gadtools.h>
#include <exec/types.h>
#include <intuition/classusr.h>
@@ -362,6 +363,7 @@
BOOL proxyhostdisabled = TRUE, proxyauthdisabled = TRUE;
BOOL disableanims, animspeeddisabled = FALSE;
BOOL scaleselected = option_scale_quality, scaledisabled = FALSE;
+ BOOL download_notify_disabled = FALSE;
char animspeed[10];
struct TextAttr fontsans, fontserif, fontmono, fontcursive, fontfantasy;
@@ -421,6 +423,12 @@
{
scaledisabled = TRUE;
scaleselected = FALSE;
+ }
+
+ if(ApplicationBase->lib_Version < 53)
+ {
+ download_notify_disabled = TRUE;
+ option_download_notify = FALSE;
}
fontsans.ta_Name = ASPrintf("%s.font",option_font_sans);
@@ -1018,9 +1026,9 @@
LAYOUT_AddChild, gow->gadgets[GID_OPTS_NOTIFY] = CheckBoxObject,
GA_ID, GID_OPTS_NOTIFY,
GA_RelVerify, TRUE,
- GA_Disabled, TRUE,
+ GA_Disabled, download_notify_disabled,
GA_Text, gadlab[GID_OPTS_NOTIFY],
- GA_Selected, FALSE, //option_download_notify,
+ GA_Selected, option_download_notify,
CheckBoxEnd,
LayoutEnd,
LAYOUT_AddChild, gow->gadgets[GID_OPTS_DLDIR] = GetFileObject,
Modified: branches/jmb/new-cache/content/fetch.c
URL: http://source.netsurf-browser.org/branches/jmb/new-cache/content/fetch.c?...
==============================================================================
--- branches/jmb/new-cache/content/fetch.c (original)
+++ branches/jmb/new-cache/content/fetch.c Sun Jan 31 06:22:57 2010
@@ -33,8 +33,7 @@
#include <string.h>
#include <strings.h>
#include <time.h>
-#include <sys/select.h>
-#include <sys/stat.h>
+
#include "utils/config.h"
#include "content/fetch.h"
#include "content/fetchers/fetch_curl.h"
Modified: branches/jmb/new-cache/content/fetch.h
URL: http://source.netsurf-browser.org/branches/jmb/new-cache/content/fetch.h?...
==============================================================================
--- branches/jmb/new-cache/content/fetch.h (original)
+++ branches/jmb/new-cache/content/fetch.h Sun Jan 31 06:22:57 2010
@@ -24,7 +24,6 @@
#define _NETSURF_DESKTOP_FETCH_H_
#include <stdbool.h>
-#include <sys/select.h>
#include "utils/config.h"
typedef enum {
Modified: branches/jmb/new-cache/content/fetchers/fetch_curl.c
URL: http://source.netsurf-browser.org/branches/jmb/new-cache/content/fetchers...
==============================================================================
--- branches/jmb/new-cache/content/fetchers/fetch_curl.c (original)
+++ branches/jmb/new-cache/content/fetchers/fetch_curl.c Sun Jan 31 06:22:57 2010
@@ -35,9 +35,8 @@
#include <string.h>
#include <strings.h>
#include <time.h>
-#include <sys/select.h>
#include <sys/stat.h>
-#include <sys/utsname.h>
+
#include "utils/config.h"
#include <openssl/ssl.h>
#include "content/fetch.h"
Modified: branches/jmb/new-cache/content/fetchers/fetch_data.c
URL: http://source.netsurf-browser.org/branches/jmb/new-cache/content/fetchers...
==============================================================================
--- branches/jmb/new-cache/content/fetchers/fetch_data.c (original)
+++ branches/jmb/new-cache/content/fetchers/fetch_data.c Sun Jan 31 06:22:57 2010
@@ -26,10 +26,9 @@
#include <string.h>
#include <strings.h>
#include <time.h>
-#include <sys/select.h>
-#include <sys/stat.h>
-#include <sys/utsname.h>
+
#include <curl/curl.h> /* for URL unescaping functions */
+
#include "utils/config.h"
#include "content/fetch.h"
#include "content/fetchers/fetch_data.h"
Modified: branches/jmb/new-cache/content/urldb.c
URL: http://source.netsurf-browser.org/branches/jmb/new-cache/content/urldb.c?...
==============================================================================
--- branches/jmb/new-cache/content/urldb.c (original)
+++ branches/jmb/new-cache/content/urldb.c Sun Jan 31 06:22:57 2010
@@ -96,7 +96,6 @@
#include <strings.h>
#include <time.h>
-#include <sys/select.h>
#include <curl/curl.h>
#include "image/bitmap.h"
Modified: branches/jmb/new-cache/desktop/browser.c
URL: http://source.netsurf-browser.org/branches/jmb/new-cache/desktop/browser....
==============================================================================
--- branches/jmb/new-cache/desktop/browser.c (original)
+++ branches/jmb/new-cache/desktop/browser.c Sun Jan 31 06:22:57 2010
@@ -34,7 +34,7 @@
#include <string.h>
#include <strings.h>
#include <math.h>
-#include <sys/select.h>
+
#include "curl/curl.h"
#include "utils/config.h"
#include "content/fetch.h"
Modified: branches/jmb/new-cache/desktop/gui.h
URL: http://source.netsurf-browser.org/branches/jmb/new-cache/desktop/gui.h?re...
==============================================================================
--- branches/jmb/new-cache/desktop/gui.h (original)
+++ branches/jmb/new-cache/desktop/gui.h Sun Jan 31 06:22:57 2010
@@ -59,6 +59,7 @@
#include "desktop/browser.h"
#include "desktop/search.h"
+void gui_stdout(void);
void gui_init(int argc, char** argv);
void gui_init2(int argc, char** argv);
void gui_multitask(void);
Modified: branches/jmb/new-cache/desktop/netsurf.c
URL: http://source.netsurf-browser.org/branches/jmb/new-cache/desktop/netsurf....
==============================================================================
--- branches/jmb/new-cache/desktop/netsurf.c (original)
+++ branches/jmb/new-cache/desktop/netsurf.c Sun Jan 31 06:22:57 2010
@@ -23,11 +23,13 @@
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
-#include <sys/utsname.h>
+
#include <libxml/encoding.h>
#include <libxml/globals.h>
#include <libxml/xmlversion.h>
+
#include "utils/config.h"
+#include "utils/utsname.h"
#include "content/fetch.h"
#include "content/fetchcache.h"
#include "content/urldb.h"
@@ -83,32 +85,38 @@
{
struct utsname utsname;
+#ifdef HAVE_SIGPIPE
/* Ignore SIGPIPE - this is necessary as OpenSSL can generate these
* and the default action is to terminate the app. There's no easy
* way of determining the cause of the SIGPIPE (other than using
* sigaction() and some mechanism for getting the file descriptor
* out of libcurl). However, we expect nothing else to generate a
* SIGPIPE, anyway, so may as well just ignore them all. */
+
signal(SIGPIPE, SIG_IGN);
+#endif
#if !((defined(__SVR4) && defined(__sun)) || defined(__NetBSD__) || \
- defined(__OpenBSD__))
+ defined(__OpenBSD__) || defined(_WIN32))
stdout = stderr;
#endif
if ((argc > 1) && (argv[1][0] == '-') && (argv[1][1] == 'v') && (argv[1][2] == 0)) {
- int argcmv;
- verbose_log = true;
- for (argcmv = 2; argcmv < argc; argcmv++) {
- argv[argcmv - 1] = argv[argcmv];
- }
- argc--;
+ int argcmv;
+ verbose_log = true;
+ for (argcmv = 2; argcmv < argc; argcmv++) {
+ argv[argcmv - 1] = argv[argcmv];
+ }
+ argc--;
+
+#ifndef HAVE_STDOUT
+ gui_stdout();
+#endif
}
#ifdef _MEMDEBUG_H_
memdebug_memdebug("memdump");
#endif
-
LOG(("version '%s'", netsurf_version));
if (uname(&utsname) < 0)
LOG(("Failed to extract machine information"));
Modified: branches/jmb/new-cache/image/bmp.c
URL: http://source.netsurf-browser.org/branches/jmb/new-cache/image/bmp.c?rev=...
==============================================================================
--- branches/jmb/new-cache/image/bmp.c (original)
+++ branches/jmb/new-cache/image/bmp.c Sun Jan 31 06:22:57 2010
@@ -98,7 +98,7 @@
/* Store our content width and description */
c->width = bmp->width;
c->height = bmp->height;
- LOG(("BMP width %u height %u\n\n", c->width, c->height));
+ LOG(("BMP width %u height %u", c->width, c->height));
c->title = malloc(100);
if (c->title)
snprintf(c->title, 100, messages_get("BMPTitle"), c->width,
Modified: branches/jmb/new-cache/image/jpeg.c
URL: http://source.netsurf-browser.org/branches/jmb/new-cache/image/jpeg.c?rev...
==============================================================================
--- branches/jmb/new-cache/image/jpeg.c (original)
+++ branches/jmb/new-cache/image/jpeg.c Sun Jan 31 06:22:57 2010
@@ -34,14 +34,17 @@
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
-#define JPEG_INTERNAL_OPTIONS
-#include "jpeglib.h"
+
#include "desktop/plotters.h"
#include "image/bitmap.h"
-#include "image/jpeg.h"
+
#include "utils/log.h"
#include "utils/messages.h"
#include "utils/utils.h"
+
+#define JPEG_INTERNAL_OPTIONS
+#include "jpeglib.h"
+#include "image/jpeg.h"
#ifdef riscos
/* We prefer the library to be configured with these options to save
Modified: branches/jmb/new-cache/image/png.c
URL: http://source.netsurf-browser.org/branches/jmb/new-cache/image/png.c?rev=...
==============================================================================
--- branches/jmb/new-cache/image/png.c (original)
+++ branches/jmb/new-cache/image/png.c Sun Jan 31 06:22:57 2010
@@ -133,7 +133,7 @@
{
int bit_depth, color_type, interlace, intent;
double gamma;
- unsigned long width, height;
+ png_uint_32 width, height;
struct content *c = png_get_progressive_ptr(png);
/* Read the PNG details */
@@ -154,7 +154,7 @@
if (color_type == PNG_COLOR_TYPE_PALETTE)
png_set_palette_to_rgb(png);
if (color_type == PNG_COLOR_TYPE_GRAY && bit_depth < 8)
- png_set_gray_1_2_4_to_8(png);
+ png_set_expand_gray_1_2_4_to_8(png);
if (png_get_valid(png, info, PNG_INFO_tRNS))
png_set_tRNS_to_alpha(png);
if (bit_depth == 16)
@@ -185,8 +185,8 @@
c->width = width;
c->height = height;
- LOG(("size %li * %li, bpp %i, rowbytes %zu", width,
- height, bit_depth, c->data.png.rowbytes));
+ LOG(("size %li * %li, bpp %i, rowbytes %zu", (unsigned long)width,
+ (unsigned long)height, bit_depth, c->data.png.rowbytes));
}
Modified: branches/jmb/new-cache/render/html.c
URL: http://source.netsurf-browser.org/branches/jmb/new-cache/render/html.c?re...
==============================================================================
--- branches/jmb/new-cache/render/html.c (original)
+++ branches/jmb/new-cache/render/html.c Sun Jan 31 06:22:57 2010
@@ -476,7 +476,7 @@
return false;
}
#if ALWAYS_DUMP_BOX
- box_dump(c->data.html.layout->children, 0);
+ box_dump(stderr, c->data.html.layout->children, 0);
#endif
#if ALWAYS_DUMP_FRAMESET
if (c->data.html.frameset)
Modified: branches/jmb/new-cache/utils/config.h
URL: http://source.netsurf-browser.org/branches/jmb/new-cache/utils/config.h?r...
==============================================================================
--- branches/jmb/new-cache/utils/config.h (original)
+++ branches/jmb/new-cache/utils/config.h Sun Jan 31 06:22:57 2010
@@ -26,7 +26,7 @@
#define HAVE_STRNDUP
#if defined(__FreeBSD__) || (defined(__SRV4) && defined(__sun)) || \
defined(__APPLE__) || defined(__HAIKU__) || defined(__BEOS__) \
- || defined(__OpenBSD__)
+ || defined(__OpenBSD__) || defined(_WIN32)
/* FreeBSD and Solaris do not have this function, so
* we implement it ourselves in util.c
*/
@@ -35,10 +35,30 @@
#endif
#define HAVE_STRCASESTR
-#if !(defined(_GNU_SOURCE) || defined(__NetBSD__) || defined(__OpenBSD__)) \
- || defined(riscos) || defined(__APPLE__)
+#if (!(defined(_GNU_SOURCE) || defined(__NetBSD__) || defined(__OpenBSD__)) \
+ || defined(riscos) || defined(__APPLE__) || defined(_WIN32))
#undef HAVE_STRCASESTR
char *strcasestr(const char *haystack, const char *needle);
+#endif
+
+#define HAVE_UTSNAME
+#if (defined(_WIN32))
+#undef HAVE_UTSNAME
+#endif
+
+#define HAVE_MKDIR
+#if (defined(_WIN32))
+#undef HAVE_MKDIR
+#endif
+
+#define HAVE_SIGPIPE
+#if (defined(_WIN32))
+#undef HAVE_SIGPIPE
+#endif
+
+#define HAVE_STDOUT
+#if (defined(_WIN32))
+#undef HAVE_STDOUT
#endif
#define HAVE_STRCHRNUL
Modified: branches/jmb/new-cache/utils/filename.c
URL: http://source.netsurf-browser.org/branches/jmb/new-cache/utils/filename.c...
==============================================================================
--- branches/jmb/new-cache/utils/filename.c (original)
+++ branches/jmb/new-cache/utils/filename.c Sun Jan 31 06:22:57 2010
@@ -32,6 +32,8 @@
#include <errno.h>
#include <sys/stat.h>
#include <unistd.h>
+
+#include "utils/config.h"
#include "utils/filename.h"
#include "utils/log.h"
#include "utils/url.h"
@@ -181,13 +183,13 @@
for (start = directory; *start != '\0'; start++) {
if (*start == '/') {
*start = '\0';
- mkdir(directory, S_IRWXU);
+ nsmkdir(directory, S_IRWXU);
*start = '/';
}
}
LOG(("Temporary directory location: %s", directory));
- mkdir(directory, S_IRWXU);
+ nsmkdir(directory, S_IRWXU);
free(directory);
@@ -481,7 +483,7 @@
new_dir->prefix[8] = '/';
if (!is_dir(filename_directory)) {
- if (!mkdir(filename_directory, S_IRWXU))
+ if (!nsmkdir(filename_directory, S_IRWXU))
return new_dir;
/* the user has probably deleted the parent directory
@@ -508,7 +510,7 @@
last_1[0] = '\0';
if (!is_dir(filename_directory)) {
- if (mkdir(filename_directory, S_IRWXU)) {
+ if (nsmkdir(filename_directory, S_IRWXU)) {
LOG(("Failed to create directory '%s'",
filename_directory));
return NULL;
Modified: branches/jmb/new-cache/utils/useragent.c
URL: http://source.netsurf-browser.org/branches/jmb/new-cache/utils/useragent....
==============================================================================
--- branches/jmb/new-cache/utils/useragent.c (original)
+++ branches/jmb/new-cache/utils/useragent.c Sun Jan 31 06:22:57 2010
@@ -17,10 +17,11 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include <sys/utsname.h>
#include <stdio.h>
#include <stdlib.h>
+#include "utils/config.h"
+#include "utils/utsname.h"
#include "desktop/netsurf.h"
#include "utils/log.h"
#include "utils/useragent.h"
Modified: branches/jmb/new-cache/utils/utils.c
URL: http://source.netsurf-browser.org/branches/jmb/new-cache/utils/utils.c?re...
==============================================================================
--- branches/jmb/new-cache/utils/utils.c (original)
+++ branches/jmb/new-cache/utils/utils.c Sun Jan 31 06:22:57 2010
@@ -463,3 +463,17 @@
}
#endif
+
+#ifndef HAVE_UTSNAME
+#include "utils/utsname.h"
+
+int uname(struct utsname *buf) {
+ strcpy(buf->sysname,"windows");
+ strcpy(buf->nodename,"nodename");
+ strcpy(buf->release,"release");
+ strcpy(buf->version,"version");
+ strcpy(buf->machine,"pc");
+
+ return 0;
+}
+#endif
Modified: branches/jmb/new-cache/utils/utils.h
URL: http://source.netsurf-browser.org/branches/jmb/new-cache/utils/utils.h?re...
==============================================================================
--- branches/jmb/new-cache/utils/utils.h (original)
+++ branches/jmb/new-cache/utils/utils.h Sun Jan 31 06:22:57 2010
@@ -72,6 +72,11 @@
void (*cancel)(query_id, enum query_response res, void *pw);
} query_callback;
+#ifdef HAVE_MKDIR
+#define nsmkdir(dir, mode) mkdir((dir), (mode))
+#else
+#define nsmkdir(dir, mode) mkdir((dir))
+#endif
char * strip(char * const s);
int whitespace(const char * str);
13 years, 7 months
r9942 tlsa - in /trunk/netsurf/windows/res/icons: ./ back.png back_g.png back_h.png forward.png forward_g.png forward_h.png home.png home_g.png home_h.png reload.png reload_g.png reload_h.png stop.png stop_g.png stop_h.png
by netsurf@semichrome.net
Author: tlsa
Date: Sun Jan 31 06:16:06 2010
New Revision: 9942
URL: http://source.netsurf-browser.org?rev=9942&view=rev
Log:
Add toolbar icons.
Added:
trunk/netsurf/windows/res/icons/
trunk/netsurf/windows/res/icons/back.png (with props)
trunk/netsurf/windows/res/icons/back_g.png (with props)
trunk/netsurf/windows/res/icons/back_h.png (with props)
trunk/netsurf/windows/res/icons/forward.png (with props)
trunk/netsurf/windows/res/icons/forward_g.png (with props)
trunk/netsurf/windows/res/icons/forward_h.png (with props)
trunk/netsurf/windows/res/icons/home.png (with props)
trunk/netsurf/windows/res/icons/home_g.png (with props)
trunk/netsurf/windows/res/icons/home_h.png (with props)
trunk/netsurf/windows/res/icons/reload.png (with props)
trunk/netsurf/windows/res/icons/reload_g.png (with props)
trunk/netsurf/windows/res/icons/reload_h.png (with props)
trunk/netsurf/windows/res/icons/stop.png (with props)
trunk/netsurf/windows/res/icons/stop_g.png (with props)
trunk/netsurf/windows/res/icons/stop_h.png (with props)
Added: trunk/netsurf/windows/res/icons/back.png
URL: http://source.netsurf-browser.org/trunk/netsurf/windows/res/icons/back.pn...
==============================================================================
Binary file - no diff available.
Propchange: trunk/netsurf/windows/res/icons/back.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: trunk/netsurf/windows/res/icons/back_g.png
URL: http://source.netsurf-browser.org/trunk/netsurf/windows/res/icons/back_g....
==============================================================================
Binary file - no diff available.
Propchange: trunk/netsurf/windows/res/icons/back_g.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: trunk/netsurf/windows/res/icons/back_h.png
URL: http://source.netsurf-browser.org/trunk/netsurf/windows/res/icons/back_h....
==============================================================================
Binary file - no diff available.
Propchange: trunk/netsurf/windows/res/icons/back_h.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: trunk/netsurf/windows/res/icons/forward.png
URL: http://source.netsurf-browser.org/trunk/netsurf/windows/res/icons/forward...
==============================================================================
Binary file - no diff available.
Propchange: trunk/netsurf/windows/res/icons/forward.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: trunk/netsurf/windows/res/icons/forward_g.png
URL: http://source.netsurf-browser.org/trunk/netsurf/windows/res/icons/forward...
==============================================================================
Binary file - no diff available.
Propchange: trunk/netsurf/windows/res/icons/forward_g.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: trunk/netsurf/windows/res/icons/forward_h.png
URL: http://source.netsurf-browser.org/trunk/netsurf/windows/res/icons/forward...
==============================================================================
Binary file - no diff available.
Propchange: trunk/netsurf/windows/res/icons/forward_h.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: trunk/netsurf/windows/res/icons/home.png
URL: http://source.netsurf-browser.org/trunk/netsurf/windows/res/icons/home.pn...
==============================================================================
Binary file - no diff available.
Propchange: trunk/netsurf/windows/res/icons/home.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: trunk/netsurf/windows/res/icons/home_g.png
URL: http://source.netsurf-browser.org/trunk/netsurf/windows/res/icons/home_g....
==============================================================================
Binary file - no diff available.
Propchange: trunk/netsurf/windows/res/icons/home_g.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: trunk/netsurf/windows/res/icons/home_h.png
URL: http://source.netsurf-browser.org/trunk/netsurf/windows/res/icons/home_h....
==============================================================================
Binary file - no diff available.
Propchange: trunk/netsurf/windows/res/icons/home_h.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: trunk/netsurf/windows/res/icons/reload.png
URL: http://source.netsurf-browser.org/trunk/netsurf/windows/res/icons/reload....
==============================================================================
Binary file - no diff available.
Propchange: trunk/netsurf/windows/res/icons/reload.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: trunk/netsurf/windows/res/icons/reload_g.png
URL: http://source.netsurf-browser.org/trunk/netsurf/windows/res/icons/reload_...
==============================================================================
Binary file - no diff available.
Propchange: trunk/netsurf/windows/res/icons/reload_g.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: trunk/netsurf/windows/res/icons/reload_h.png
URL: http://source.netsurf-browser.org/trunk/netsurf/windows/res/icons/reload_...
==============================================================================
Binary file - no diff available.
Propchange: trunk/netsurf/windows/res/icons/reload_h.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: trunk/netsurf/windows/res/icons/stop.png
URL: http://source.netsurf-browser.org/trunk/netsurf/windows/res/icons/stop.pn...
==============================================================================
Binary file - no diff available.
Propchange: trunk/netsurf/windows/res/icons/stop.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: trunk/netsurf/windows/res/icons/stop_g.png
URL: http://source.netsurf-browser.org/trunk/netsurf/windows/res/icons/stop_g....
==============================================================================
Binary file - no diff available.
Propchange: trunk/netsurf/windows/res/icons/stop_g.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: trunk/netsurf/windows/res/icons/stop_h.png
URL: http://source.netsurf-browser.org/trunk/netsurf/windows/res/icons/stop_h....
==============================================================================
Binary file - no diff available.
Propchange: trunk/netsurf/windows/res/icons/stop_h.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
13 years, 7 months
r9940 vince - in /trunk/netsurf: ./ Docs/ desktop/ utils/ windows/ windows/res/
by netsurf@semichrome.net
Author: vince
Date: Sat Jan 30 18:36:02 2010
New Revision: 9940
URL: http://source.netsurf-browser.org?rev=9940&view=rev
Log:
Add Windows frontend
Added:
trunk/netsurf/Docs/BUILDING-Windows
- copied unchanged from r9939, branches/MarkieB/windows/Docs/BUILDING-Windows
trunk/netsurf/utils/utsname.h
- copied unchanged from r9939, branches/MarkieB/windows/utils/utsname.h
trunk/netsurf/windows/
- copied from r9939, branches/MarkieB/windows/windows/
Modified:
trunk/netsurf/Makefile
trunk/netsurf/Makefile.defaults
trunk/netsurf/Makefile.resources
trunk/netsurf/Makefile.sources
trunk/netsurf/desktop/gui.h
trunk/netsurf/desktop/netsurf.c
trunk/netsurf/utils/config.h
trunk/netsurf/utils/filename.c
trunk/netsurf/utils/useragent.c
trunk/netsurf/utils/utils.c
trunk/netsurf/utils/utils.h
trunk/netsurf/windows/res/ (props changed)
Modified: trunk/netsurf/Makefile
URL: http://source.netsurf-browser.org/trunk/netsurf/Makefile?rev=9940&r1=9939...
==============================================================================
--- trunk/netsurf/Makefile (original)
+++ trunk/netsurf/Makefile Sat Jan 30 18:36:02 2010
@@ -93,7 +93,9 @@
ifneq ($(TARGET),beos)
ifneq ($(TARGET),amiga)
ifneq ($(TARGET),framebuffer)
- $(error Unknown TARGET "$(TARGET)", should either be "riscos", "gtk", "beos", "amiga", or "framebuffer")
+ ifneq ($(TARGET),windows)
+ $(error Unknown TARGET "$(TARGET)", should either be "riscos", "gtk", "beos", "amiga", "framebuffer" or "windows")
+ endif
endif
endif
endif
@@ -162,8 +164,20 @@
PKG_CONFIG :=
#endif
else
- # Building for GTK, Amiga, or Framebuffer
- PKG_CONFIG := pkg-config
+ ifeq ($(TARGET),windows)
+ ifneq ($(HOST),windows)
+ # Set Mingw defaults
+ MINGW_PREFIX ?= i586-mingw32msvc-
+ MINGW_INSTALL_ENV ?= /usr/i586-mingw32msvc/
+
+ # mingw cross-compile
+ CC := $(MINGW_PREFIX)gcc
+ PKG_CONFIG := $(MINGW_INSTALL_ENV)/bin/pkg-config
+ endif
+ else
+ # Building for GTK, Amiga, Framebuffer
+ PKG_CONFIG := pkg-config
+ endif
endif
endif
@@ -435,13 +449,42 @@
CFLAGS += $(GTKCFLAGS)
LDFLAGS += $(GTKLDFLAGS)
- # ----------------------------------------------------------------------------
+ # ---------------------------------------------------------------------------
# Windows flag setup
- # ----------------------------------------------------------------------------
+ # ---------------------------------------------------------------------------
ifeq ($(HOST),Windows_NT)
CFLAGS += -U__STRICT_ANSI__
endif
+endif
+
+# ----------------------------------------------------------------------------
+# Windows target setup
+# ----------------------------------------------------------------------------
+ifeq ($(TARGET),windows)
+ NETSURF_FEATURE_NSSVG_CFLAGS := -DWITH_NSSVG
+ NETSURF_FEATURE_ROSPRITE_CFLAGS := -DWITH_NSSPRITE
+ NETSURF_FEATURE_BMP_CFLAGS := -DWITH_BMP
+ NETSURF_FEATURE_GIF_CFLAGS := -DWITH_GIF
+ NETSURF_FEATURE_PNG_CFLAGS := -DWITH_PNG
+ $(eval $(call feature_enabled,BMP,-DWITH_BMP,-lnsbmp,NetSurf BMP decoder))
+ $(eval $(call feature_enabled,GIF,-DWITH_GIF,-lnsgif,NetSurf GIF decoder))
+ $(eval $(call feature_enabled,PNG,-DWITH_PNG,-lpng,PNG support))
+ $(eval $(call feature_enabled,NSSVG,-DWITH_NS_SVG,-lsvgtiny,SVG rendering))
+ $(eval $(call feature_enabled,MNG,,-llcms -ljpeg,MNG additional support))
+
+ LDFLAGS += -L${MINGW_INSTALL_ENV}/lib $(shell $(PKG_CONFIG) --libs zlib \
+ libxml-2.0 libcurl libhubbub libparserutils libcss libwapcaplet) \
+ -lparserutils -lssl -lcrypto -lregex -liconv -lcss -lwapcaplet \
+ -lgdi32 -lcomctl32 -lws2_32 -lmsimg32 -mwindows
+ CFLAGS += -U__STRICT_ANSI__ -mwin32
+ WSCFLAGS := -std=c99 \
+ $(WARNFLAGS) -I. -I/${MINGW_INSTALL_ENV}/include \
+ -DCURL_STATICLIB \
+ $(shell $(PKG_CONFIG) --cflags libcurl libhubbub zlib libparserutils \
+ libxml-2.0) -g
+ CFLAGS += $(WSCFLAGS)
+ LDFLAGS += $(WSCFLAGS)
endif
# ----------------------------------------------------------------------------
@@ -554,6 +597,9 @@
$(Q)$(CC) -o $(EXETARGET:,ff8=,e1f) $(OBJECTS) $(LDFLAGS)
$(Q)$(ELF2AIF) $(EXETARGET:,ff8=,e1f) $(EXETARGET)
$(Q)$(RM) $(EXETARGET:,ff8=,e1f)
+endif
+ifeq ($(TARGET),windows)
+ $(Q)$(TOUCH) windows/res/preferences
endif
ifeq ($(TARGET),gtk)
$(Q)$(TOUCH) gtk/res/toolbarIndices
Modified: trunk/netsurf/Makefile.defaults
URL: http://source.netsurf-browser.org/trunk/netsurf/Makefile.defaults?rev=994...
==============================================================================
--- trunk/netsurf/Makefile.defaults (original)
+++ trunk/netsurf/Makefile.defaults Sat Jan 30 18:36:02 2010
@@ -229,6 +229,34 @@
endif
+# ----------------------------------------------------------------------------
+# windows-specific options
+# ----------------------------------------------------------------------------
+ifeq ($(TARGET),windows)
+
+ # Enable NetSurf's use of librosprite for displaying RISC OS Sprites
+ # Valid options: YES, NO, AUTO
+ NETSURF_USE_ROSPRITE := NO
+
+ # Enable NetSurf's use of libsvgtiny for displaying SVGs
+ # Valid options: YES, NO
+ NETSURF_USE_NSSVG := NO
+
+ # Force using glibc internal iconv implementation instead of external libiconv
+ # Valid options: YES, NO
+ NETSURF_USE_LIBICONV_PLUG := NO
+
+ # mng support does not currently build on windows
+ NETSURF_USE_MNG := NO
+
+ # no pdf support
+ NETSURF_USE_HARU_PDF := NO
+
+ # Optimisation levels
+ CFLAGS += -O2 -Wuninitialized
+
+endif
+
# Include any local configuration
-include Makefile.config
Modified: trunk/netsurf/Makefile.resources
URL: http://source.netsurf-browser.org/trunk/netsurf/Makefile.resources?rev=99...
==============================================================================
--- trunk/netsurf/Makefile.resources (original)
+++ trunk/netsurf/Makefile.resources Sat Jan 30 18:36:02 2010
@@ -62,7 +62,16 @@
$(eval $(foreach V,$(filter FB_IMAGE_%,$(.VARIABLES)),$(call convert_image,$($(V)),$(OBJROOT)/$(patsubst FB_IMAGE_%,%,$(V)).c,$(patsubst FB_IMAGE_%,%,$(V)))))
+# End of framebuffer resource definitions
+endif
+ifeq ($(TARGET),windows)
-# End of framebuffer resource definitions
-endif
+$(OBJROOT)/windows_resource.o: windows/res/resource.rc
+ $(VQ)echo " WINDRES: compiling windows resources"
+ ${Q}$(MINGW_PREFIX)windres $< -O coff -o $@
+
+S_RESOURCES := windows_resource.o
+
+# End of windows resource definitions
+endif
Modified: trunk/netsurf/Makefile.sources
URL: http://source.netsurf-browser.org/trunk/netsurf/Makefile.sources?rev=9940...
==============================================================================
--- trunk/netsurf/Makefile.sources (original)
+++ trunk/netsurf/Makefile.sources Sat Jan 30 18:36:02 2010
@@ -65,6 +65,12 @@
$(addprefix dialogs/,gtk_options.c gtk_about.c gtk_source.c)
S_GTK := $(addprefix gtk/,$(S_GTK)) $(addprefix utils/,container.c)
# code in utils/container.ch is non-universal it seems
+
+# S_WINDOWS are sources purely for the windows build
+S_WINDOWS := about.c bitmap.c download.c filetype.c findfile.c font.c \
+ gui.c history.c hotlist.c localhistory.c login.c misc.c plot.c \
+ prefs.c schedule.c thumbnail.c tree.c
+S_WINDOWS := $(addprefix windows/,$(S_WINDOWS))
# S_BEOS are sources purely for the BeOS build
S_BEOS := beos_about.cpp beos_bitmap.cpp beos_fetch_rsrc.cpp \
@@ -162,6 +168,11 @@
EXETARGET := nsfb$(SUBTARGET)
endif
+ifeq ($(TARGET),windows)
+SOURCES := $(S_COMMON) $(S_IMAGE) $(S_BROWSER) $(S_WINDOWS) $(S_RESOURCES)
+EXETARGET := NetSurf.exe
+endif
+
ifeq ($(SOURCES),)
$(error Unable to build NetSurf, could not determine set of sources to build)
endif
Modified: trunk/netsurf/desktop/gui.h
URL: http://source.netsurf-browser.org/trunk/netsurf/desktop/gui.h?rev=9940&r1...
==============================================================================
--- trunk/netsurf/desktop/gui.h (original)
+++ trunk/netsurf/desktop/gui.h Sat Jan 30 18:36:02 2010
@@ -58,6 +58,7 @@
#include "desktop/browser.h"
#include "desktop/search.h"
+void gui_stdout(void);
void gui_init(int argc, char** argv);
void gui_init2(int argc, char** argv);
void gui_multitask(void);
Modified: trunk/netsurf/desktop/netsurf.c
URL: http://source.netsurf-browser.org/trunk/netsurf/desktop/netsurf.c?rev=994...
==============================================================================
--- trunk/netsurf/desktop/netsurf.c (original)
+++ trunk/netsurf/desktop/netsurf.c Sat Jan 30 18:36:02 2010
@@ -23,11 +23,13 @@
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
-#include <sys/utsname.h>
+
#include <libxml/encoding.h>
#include <libxml/globals.h>
#include <libxml/xmlversion.h>
+
#include "utils/config.h"
+#include "utils/utsname.h"
#include "content/fetch.h"
#include "content/fetchcache.h"
#include "content/urldb.h"
@@ -83,32 +85,38 @@
{
struct utsname utsname;
+#ifdef HAVE_SIGPIPE
/* Ignore SIGPIPE - this is necessary as OpenSSL can generate these
* and the default action is to terminate the app. There's no easy
* way of determining the cause of the SIGPIPE (other than using
* sigaction() and some mechanism for getting the file descriptor
* out of libcurl). However, we expect nothing else to generate a
* SIGPIPE, anyway, so may as well just ignore them all. */
+
signal(SIGPIPE, SIG_IGN);
+#endif
#if !((defined(__SVR4) && defined(__sun)) || defined(__NetBSD__) || \
- defined(__OpenBSD__))
+ defined(__OpenBSD__) || defined(_WIN32))
stdout = stderr;
#endif
if ((argc > 1) && (argv[1][0] == '-') && (argv[1][1] == 'v') && (argv[1][2] == 0)) {
- int argcmv;
- verbose_log = true;
- for (argcmv = 2; argcmv < argc; argcmv++) {
- argv[argcmv - 1] = argv[argcmv];
- }
- argc--;
+ int argcmv;
+ verbose_log = true;
+ for (argcmv = 2; argcmv < argc; argcmv++) {
+ argv[argcmv - 1] = argv[argcmv];
+ }
+ argc--;
+
+#ifndef HAVE_STDOUT
+ gui_stdout();
+#endif
}
#ifdef _MEMDEBUG_H_
memdebug_memdebug("memdump");
#endif
-
LOG(("version '%s'", netsurf_version));
if (uname(&utsname) < 0)
LOG(("Failed to extract machine information"));
Modified: trunk/netsurf/utils/config.h
URL: http://source.netsurf-browser.org/trunk/netsurf/utils/config.h?rev=9940&r...
==============================================================================
--- trunk/netsurf/utils/config.h (original)
+++ trunk/netsurf/utils/config.h Sat Jan 30 18:36:02 2010
@@ -26,7 +26,7 @@
#define HAVE_STRNDUP
#if defined(__FreeBSD__) || (defined(__SRV4) && defined(__sun)) || \
defined(__APPLE__) || defined(__HAIKU__) || defined(__BEOS__) \
- || defined(__OpenBSD__)
+ || defined(__OpenBSD__) || defined(_WIN32)
/* FreeBSD and Solaris do not have this function, so
* we implement it ourselves in util.c
*/
@@ -35,10 +35,30 @@
#endif
#define HAVE_STRCASESTR
-#if !(defined(_GNU_SOURCE) || defined(__NetBSD__) || defined(__OpenBSD__)) \
- || defined(riscos) || defined(__APPLE__)
+#if (!(defined(_GNU_SOURCE) || defined(__NetBSD__) || defined(__OpenBSD__)) \
+ || defined(riscos) || defined(__APPLE__) || defined(_WIN32))
#undef HAVE_STRCASESTR
char *strcasestr(const char *haystack, const char *needle);
+#endif
+
+#define HAVE_UTSNAME
+#if (defined(_WIN32))
+#undef HAVE_UTSNAME
+#endif
+
+#define HAVE_MKDIR
+#if (defined(_WIN32))
+#undef HAVE_MKDIR
+#endif
+
+#define HAVE_SIGPIPE
+#if (defined(_WIN32))
+#undef HAVE_SIGPIPE
+#endif
+
+#define HAVE_STDOUT
+#if (defined(_WIN32))
+#undef HAVE_STDOUT
#endif
#define HAVE_STRCHRNUL
Modified: trunk/netsurf/utils/filename.c
URL: http://source.netsurf-browser.org/trunk/netsurf/utils/filename.c?rev=9940...
==============================================================================
--- trunk/netsurf/utils/filename.c (original)
+++ trunk/netsurf/utils/filename.c Sat Jan 30 18:36:02 2010
@@ -32,6 +32,8 @@
#include <errno.h>
#include <sys/stat.h>
#include <unistd.h>
+
+#include "utils/config.h"
#include "utils/filename.h"
#include "utils/log.h"
#include "utils/url.h"
@@ -181,13 +183,13 @@
for (start = directory; *start != '\0'; start++) {
if (*start == '/') {
*start = '\0';
- mkdir(directory, S_IRWXU);
+ nsmkdir(directory, S_IRWXU);
*start = '/';
}
}
LOG(("Temporary directory location: %s", directory));
- mkdir(directory, S_IRWXU);
+ nsmkdir(directory, S_IRWXU);
free(directory);
@@ -481,7 +483,7 @@
new_dir->prefix[8] = '/';
if (!is_dir(filename_directory)) {
- if (!mkdir(filename_directory, S_IRWXU))
+ if (!nsmkdir(filename_directory, S_IRWXU))
return new_dir;
/* the user has probably deleted the parent directory
@@ -508,7 +510,7 @@
last_1[0] = '\0';
if (!is_dir(filename_directory)) {
- if (mkdir(filename_directory, S_IRWXU)) {
+ if (nsmkdir(filename_directory, S_IRWXU)) {
LOG(("Failed to create directory '%s'",
filename_directory));
return NULL;
Modified: trunk/netsurf/utils/useragent.c
URL: http://source.netsurf-browser.org/trunk/netsurf/utils/useragent.c?rev=994...
==============================================================================
--- trunk/netsurf/utils/useragent.c (original)
+++ trunk/netsurf/utils/useragent.c Sat Jan 30 18:36:02 2010
@@ -17,10 +17,11 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include <sys/utsname.h>
#include <stdio.h>
#include <stdlib.h>
+#include "utils/config.h"
+#include "utils/utsname.h"
#include "desktop/netsurf.h"
#include "utils/log.h"
#include "utils/useragent.h"
Modified: trunk/netsurf/utils/utils.c
URL: http://source.netsurf-browser.org/trunk/netsurf/utils/utils.c?rev=9940&r1...
==============================================================================
--- trunk/netsurf/utils/utils.c (original)
+++ trunk/netsurf/utils/utils.c Sat Jan 30 18:36:02 2010
@@ -463,3 +463,17 @@
}
#endif
+
+#ifndef HAVE_UTSNAME
+#include "utils/utsname.h"
+
+int uname(struct utsname *buf) {
+ strcpy(buf->sysname,"windows");
+ strcpy(buf->nodename,"nodename");
+ strcpy(buf->release,"release");
+ strcpy(buf->version,"version");
+ strcpy(buf->machine,"pc");
+
+ return 0;
+}
+#endif
Modified: trunk/netsurf/utils/utils.h
URL: http://source.netsurf-browser.org/trunk/netsurf/utils/utils.h?rev=9940&r1...
==============================================================================
--- trunk/netsurf/utils/utils.h (original)
+++ trunk/netsurf/utils/utils.h Sat Jan 30 18:36:02 2010
@@ -72,6 +72,11 @@
void (*cancel)(query_id, enum query_response res, void *pw);
} query_callback;
+#ifdef HAVE_MKDIR
+#define nsmkdir(dir, mode) mkdir((dir), (mode))
+#else
+#define nsmkdir(dir, mode) mkdir((dir))
+#endif
char * strip(char * const s);
int whitespace(const char * str);
13 years, 7 months
r9939 vince - in /branches/MarkieB/windows: desktop/gui.h desktop/netsurf.c utils/config.h utils/useragent.c windows/gui.c
by netsurf@semichrome.net
Author: vince
Date: Sat Jan 30 18:28:48 2010
New Revision: 9939
URL: http://source.netsurf-browser.org?rev=9939&view=rev
Log:
final jmb review cleanups
Modified:
branches/MarkieB/windows/desktop/gui.h
branches/MarkieB/windows/desktop/netsurf.c
branches/MarkieB/windows/utils/config.h
branches/MarkieB/windows/utils/useragent.c
branches/MarkieB/windows/windows/gui.c
Modified: branches/MarkieB/windows/desktop/gui.h
URL: http://source.netsurf-browser.org/branches/MarkieB/windows/desktop/gui.h?...
==============================================================================
--- branches/MarkieB/windows/desktop/gui.h (original)
+++ branches/MarkieB/windows/desktop/gui.h Sat Jan 30 18:28:48 2010
@@ -58,6 +58,7 @@
#include "desktop/browser.h"
#include "desktop/search.h"
+void gui_stdout(void);
void gui_init(int argc, char** argv);
void gui_init2(int argc, char** argv);
void gui_multitask(void);
Modified: branches/MarkieB/windows/desktop/netsurf.c
URL: http://source.netsurf-browser.org/branches/MarkieB/windows/desktop/netsur...
==============================================================================
--- branches/MarkieB/windows/desktop/netsurf.c (original)
+++ branches/MarkieB/windows/desktop/netsurf.c Sat Jan 30 18:28:48 2010
@@ -18,22 +18,18 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifdef _WIN32
-#include <windows.h>
-#include <shellapi.h>
-#include "windows.h"
-#endif
-
#include <locale.h>
#include <signal.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
-#include "utils/utsname.h"
+
#include <libxml/encoding.h>
#include <libxml/globals.h>
#include <libxml/xmlversion.h>
+
#include "utils/config.h"
+#include "utils/utsname.h"
#include "content/fetch.h"
#include "content/fetchcache.h"
#include "content/urldb.h"
@@ -89,7 +85,7 @@
{
struct utsname utsname;
-#ifndef _WIN32
+#ifdef HAVE_SIGPIPE
/* Ignore SIGPIPE - this is necessary as OpenSSL can generate these
* and the default action is to terminate the app. There's no easy
* way of determining the cause of the SIGPIPE (other than using
@@ -112,13 +108,9 @@
argv[argcmv - 1] = argv[argcmv];
}
argc--;
-#ifdef _WIN32
- /* mwindows compile flag normally invalidates stdout unless
- already redirected */
- if (_get_osfhandle(fileno(stdout)) == -1) {
- AllocConsole();
- freopen("CONOUT$", "w", stdout);
- }
+
+#ifndef HAVE_STDOUT
+ gui_stdout();
#endif
}
Modified: branches/MarkieB/windows/utils/config.h
URL: http://source.netsurf-browser.org/branches/MarkieB/windows/utils/config.h...
==============================================================================
--- branches/MarkieB/windows/utils/config.h (original)
+++ branches/MarkieB/windows/utils/config.h Sat Jan 30 18:28:48 2010
@@ -51,6 +51,16 @@
#undef HAVE_MKDIR
#endif
+#define HAVE_SIGPIPE
+#if (defined(_WIN32))
+#undef HAVE_SIGPIPE
+#endif
+
+#define HAVE_STDOUT
+#if (defined(_WIN32))
+#undef HAVE_STDOUT
+#endif
+
#define HAVE_STRCHRNUL
/* For some reason, UnixLib defines this unconditionally.
* Assume we're using UnixLib if building for RISC OS. */
Modified: branches/MarkieB/windows/utils/useragent.c
URL: http://source.netsurf-browser.org/branches/MarkieB/windows/utils/useragen...
==============================================================================
--- branches/MarkieB/windows/utils/useragent.c (original)
+++ branches/MarkieB/windows/utils/useragent.c Sat Jan 30 18:28:48 2010
@@ -17,11 +17,11 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "utils/utsname.h"
-
#include <stdio.h>
#include <stdlib.h>
+#include "utils/config.h"
+#include "utils/utsname.h"
#include "desktop/netsurf.h"
#include "utils/log.h"
#include "utils/useragent.h"
Modified: branches/MarkieB/windows/windows/gui.c
URL: http://source.netsurf-browser.org/branches/MarkieB/windows/windows/gui.c?...
==============================================================================
--- branches/MarkieB/windows/windows/gui.c (original)
+++ branches/MarkieB/windows/windows/gui.c Sat Jan 30 18:28:48 2010
@@ -2390,3 +2390,13 @@
LOG(("calling browser_window_create"));
bw = browser_window_create(addr, 0, 0, true, false);
}
+
+void gui_stdout(void)
+{
+ /* mwindows compile flag normally invalidates stdout unless
+ already redirected */
+ if (_get_osfhandle(fileno(stdout)) == -1) {
+ AllocConsole();
+ freopen("CONOUT$", "w", stdout);
+ }
+}
13 years, 7 months
r9938 vince - in /branches/MarkieB/windows: utils/config.h utils/filename.c utils/utils.c utils/utils.h utils/utsname.h windows/gui.c windows/res/back.bmp
by netsurf@semichrome.net
Author: vince
Date: Sat Jan 30 18:00:10 2010
New Revision: 9938
URL: http://source.netsurf-browser.org?rev=9938&view=rev
Log:
implement review feedback from jmb
Modified:
branches/MarkieB/windows/utils/config.h
branches/MarkieB/windows/utils/filename.c
branches/MarkieB/windows/utils/utils.c
branches/MarkieB/windows/utils/utils.h
branches/MarkieB/windows/utils/utsname.h
branches/MarkieB/windows/windows/gui.c
branches/MarkieB/windows/windows/res/back.bmp
Modified: branches/MarkieB/windows/utils/config.h
URL: http://source.netsurf-browser.org/branches/MarkieB/windows/utils/config.h...
==============================================================================
--- branches/MarkieB/windows/utils/config.h (original)
+++ branches/MarkieB/windows/utils/config.h Sat Jan 30 18:00:10 2010
@@ -39,6 +39,16 @@
|| defined(riscos) || defined(__APPLE__) || defined(_WIN32))
#undef HAVE_STRCASESTR
char *strcasestr(const char *haystack, const char *needle);
+#endif
+
+#define HAVE_UTSNAME
+#if (defined(_WIN32))
+#undef HAVE_UTSNAME
+#endif
+
+#define HAVE_MKDIR
+#if (defined(_WIN32))
+#undef HAVE_MKDIR
#endif
#define HAVE_STRCHRNUL
Modified: branches/MarkieB/windows/utils/filename.c
URL: http://source.netsurf-browser.org/branches/MarkieB/windows/utils/filename...
==============================================================================
--- branches/MarkieB/windows/utils/filename.c (original)
+++ branches/MarkieB/windows/utils/filename.c Sat Jan 30 18:00:10 2010
@@ -21,11 +21,6 @@
*
* A maximum of 2^24 files can be allocated at any point in time.
*/
-#ifdef _WIN32
-#define ns_mkdir(dir, mode) mkdir((dir))
-#else
-#define ns_mkdir(dir, mode) mkdir((dir), (mode))
-#endif
#include <assert.h>
#include <sys/types.h>
@@ -37,6 +32,8 @@
#include <errno.h>
#include <sys/stat.h>
#include <unistd.h>
+
+#include "utils/config.h"
#include "utils/filename.h"
#include "utils/log.h"
#include "utils/url.h"
@@ -186,13 +183,13 @@
for (start = directory; *start != '\0'; start++) {
if (*start == '/') {
*start = '\0';
- ns_mkdir(directory, S_IRWXU);
+ nsmkdir(directory, S_IRWXU);
*start = '/';
}
}
LOG(("Temporary directory location: %s", directory));
- ns_mkdir(directory, S_IRWXU);
+ nsmkdir(directory, S_IRWXU);
free(directory);
@@ -486,7 +483,7 @@
new_dir->prefix[8] = '/';
if (!is_dir(filename_directory)) {
- if (!ns_mkdir(filename_directory, S_IRWXU))
+ if (!nsmkdir(filename_directory, S_IRWXU))
return new_dir;
/* the user has probably deleted the parent directory
@@ -513,7 +510,7 @@
last_1[0] = '\0';
if (!is_dir(filename_directory)) {
- if (ns_mkdir(filename_directory, S_IRWXU)) {
+ if (nsmkdir(filename_directory, S_IRWXU)) {
LOG(("Failed to create directory '%s'",
filename_directory));
return NULL;
@@ -524,4 +521,3 @@
return new_dir;
}
-#undef ns_mkdir
Modified: branches/MarkieB/windows/utils/utils.c
URL: http://source.netsurf-browser.org/branches/MarkieB/windows/utils/utils.c?...
==============================================================================
--- branches/MarkieB/windows/utils/utils.c (original)
+++ branches/MarkieB/windows/utils/utils.c Sat Jan 30 18:00:10 2010
@@ -464,7 +464,7 @@
#endif
-#ifdef _WIN32
+#ifndef HAVE_UTSNAME
#include "utils/utsname.h"
int uname(struct utsname *buf) {
Modified: branches/MarkieB/windows/utils/utils.h
URL: http://source.netsurf-browser.org/branches/MarkieB/windows/utils/utils.h?...
==============================================================================
--- branches/MarkieB/windows/utils/utils.h (original)
+++ branches/MarkieB/windows/utils/utils.h Sat Jan 30 18:00:10 2010
@@ -72,6 +72,11 @@
void (*cancel)(query_id, enum query_response res, void *pw);
} query_callback;
+#ifdef HAVE_MKDIR
+#define nsmkdir(dir, mode) mkdir((dir), (mode))
+#else
+#define nsmkdir(dir, mode) mkdir((dir))
+#endif
char * strip(char * const s);
int whitespace(const char * str);
Modified: branches/MarkieB/windows/utils/utsname.h
URL: http://source.netsurf-browser.org/branches/MarkieB/windows/utils/utsname....
==============================================================================
--- branches/MarkieB/windows/utils/utsname.h (original)
+++ branches/MarkieB/windows/utils/utsname.h Sat Jan 30 18:00:10 2010
@@ -19,7 +19,9 @@
#ifndef _NETSURF_UTILS_UTSNAME_H_
#define _NETSURF_UTILS_UTSNAME_H_
-#ifdef _WIN32
+#ifdef HAVE_UTSNAME
+#include <sys/utsname.h>
+#else
/* from posix spec */
struct utsname {
char sysname[65]; /* Operating system name (e.g., "Linux") */
@@ -32,8 +34,6 @@
int uname(struct utsname *buf);
-#else
-#include <sys/utsname.h>
#endif
#endif
Modified: branches/MarkieB/windows/windows/gui.c
URL: http://source.netsurf-browser.org/branches/MarkieB/windows/windows/gui.c?...
==============================================================================
--- branches/MarkieB/windows/windows/gui.c (original)
+++ branches/MarkieB/windows/windows/gui.c Sat Jan 30 18:00:10 2010
@@ -289,6 +289,7 @@
}
w = w->next;
}
+
if (match == false) { /* during initial window creation */
w = window_list;
while (w != NULL) {
@@ -300,12 +301,14 @@
}
}
- if ((msg == WM_LBUTTONUP) || (msg == WM_LBUTTONDOWN) ||
+ if ((msg == WM_LBUTTONUP) ||
+ (msg == WM_LBUTTONDOWN) ||
(msg == WM_MOUSEMOVE)) {
int x,y;
x = GET_X_LPARAM(lparam);
y = GET_Y_LPARAM(lparam);
- if ((w != NULL) && (x > w->ntoolbuttons * w->toolbuttondimension)
+ if ((w != NULL) &&
+ (x > w->ntoolbuttons * w->toolbuttondimension)
&& (y < w->voffset)) {
if (msg == WM_LBUTTONDOWN)
SetFocus(w->urlbar);
@@ -498,27 +501,17 @@
*/
static void nsws_window_urlbar_create(struct gui_window *w)
{
- HWND hwnd = CreateWindow("EDIT", "", WS_CHILD | WS_VISIBLE |
- ES_AUTOHSCROLL | ES_OEMCONVERT,
- w->toolbuttondimension * w->ntoolbuttons + 4, 10,
- w->urlbarwidth - 8, w->toolbuttondimension - 12,
- w->main, (HMENU) NSWS_ID_URLBAR, hinstance, NULL);
- HFONT font = CreateFont(14, /* height */
- 7, /* width */
- 0, /* escapement*/
- 0, /* orientation */
- 300, /* weight */
- FALSE, /* italic */
- FALSE, /* underline */
- FALSE, /* strike */
- DEFAULT_CHARSET, /* for locale */
- OUT_TT_PRECIS, /* general 'best match' */
- CLIP_DEFAULT_PRECIS,
- DEFAULT_QUALITY,
- FF_SWISS | DEFAULT_PITCH,
- NULL /* name of font face */
- );
- SendMessage(hwnd, WM_SETFONT, (WPARAM) font, MAKELONG(0, TRUE));
+ HWND hwnd = CreateWindow("EDIT",
+ "",
+ WS_CHILD | WS_VISIBLE | ES_AUTOHSCROLL | ES_OEMCONVERT,
+ w->toolbuttondimension * w->ntoolbuttons + 4,
+ 10,
+ w->urlbarwidth - 8,
+ w->toolbuttondimension - 12,
+ w->main,
+ (HMENU) NSWS_ID_URLBAR,
+ hinstance,
+ NULL);
/*urlproc = (FARPROC) SetWindowLong(hwnd, GWL_WNDPROC, (DWORD)
nsws_window_url_callback);*/
w->urlbar = hwnd;
@@ -553,7 +546,8 @@
/**
* creation of toolbar
*/
-static void nsws_window_toolbar_create(struct gui_window *w)
+static void
+nsws_window_toolbar_create(struct gui_window *w)
{
unsigned int listid = 0;
char imagepath[PATH_MAX];
Modified: branches/MarkieB/windows/windows/res/back.bmp
URL: http://source.netsurf-browser.org/branches/MarkieB/windows/windows/res/ba...
==============================================================================
Binary files - no diff available.
13 years, 7 months