Tuesday, 31 March 2015

Re: Google Books do not show pages any longer

On 31 Mar 2015, Harriet Bazley wrote:
> On 31 Mar 2015 as I do recall,
> Roger Darlington wrote:

>> On 18 Feb 2015, Harriet Bazley wrote:

> [snip]

>>> For example, https://books.google.co.uk/books?id=VL5wUgW0RssC&pg=PA24
>>> The intended display is hidden as
>>
>>> .viewport div img {display:none;}
>>> </style><div style="height:853px;width:575px;position:relative;margin-
>>> bottom:4px">
>>> <style type=text/css>.html_page_image {
>>> background-image:url("https://books.google.co.uk/books?id=VL5wUgW0RssC
>>> &ie=ISO-8859-1&pg=PA24&img=1&zoom=3&hl=en&sig=ACfU3U1veGpmwlalmSlRUhFW
>>> AAUiHFXutw");
>>> width:575px;height:853px; top:0px;left:0px;position:relative}</style>
>>
>>> Click on *that*, and you can see the page, annoying though the workaround
>>> is....
>>
>>
>> I am puzzled by this Hilary.
>>
>> Firefox on Windows7 has no such trouble displaying google book pages
>> without any rigmarole about finding some other link hidden deep inside
>> it and clicking on that instead.
>>
>> Maybe Firefox ingnores display:none and background display and instead
>> gets straight on with the proper business of displaying it?

> Much more likely that it is Firefox that supports the complicated
> obfuscation they are using to make the content of the book invisible to
> search engines/impossible to save out of Windows browsers (or whatever the
> purpose of this CSS may be), and Netsurf that ignores it.

Let's hope that Netsurf can find a fludge fix for this problem soon,
if they can't do a proper fix quickly.



--

Cheers
Roger
A proton is for life, not just for Christmas

Re: Revenge of the disc cache

On Tue, 31 Mar 2015 23:12:04 +0100, Vincent Sanders wrote:

> In an attempt to address this I have recently reworked the handling of
> small files within the cache. There are now a small number of
> relatively large files into which all small objects are placed. This
> has resulted in the majority of objects (>70%) being held in these blocks
> rather than in separate files on disk.
>
> The resulting cache directories have a correspondingly smaller number
> of files and directories within them and should (I hope) exhibit
> greatly superior performance.

There's something not quite right, as I'm not getting the "m"
directory or any contents created, resulting in things like this:
(4.286992) content/fs_backing_store.c get_store_entry 844: url:http://www.google.co.uk/images/icons/product/chrome-48.png
(4.287125) content/fs_backing_store.c fetch 1845: retriving cache data for url:http://www.google.co.uk/images/icons/product/chrome-48.png
(4.287197) content/fs_backing_store.c fetch 1870: Created new heap allocation 0x55ff93a0
(4.287266) content/fs_backing_store.c store_open 1058: opening PROGDIR:Users/chris/Cache/m/O/Y/6/BW/Y/OQZTNMA
(4.287462) content/fs_backing_store.c store_read_file 1786: Open failed
(4.287533) content/fs_backing_store.c entry_release_alloc 1713: freeing 0x55ff93a0

I have "d" and things in "d".

pread/pwrite() do not seem to be working here either, they just return
-1?
(4.303433) content/fs_backing_store.c fetch 1870: Created new heap allocation 0x53a517c8
(4.303736) content/fs_backing_store.c store_open 1058: opening PROGDIR:Users/chris/Cache/mblk/A
(4.304096) content/fs_backing_store.c store_read_block 1757: Read -1 of 506 bytes into 0x53a517c8 from 0x19000 block 100
(4.304178) content/fs_backing_store.c entry_release_alloc 1713: freeing 0x53a517c8

(10.389859) content/fs_backing_store.c store_open 1058: opening PROGDIR:Users/chris/Cache/dblk/A
(10.390208) content/fs_backing_store.c store_write_block 1609: Wrote -1 of 5430 bytes from 0x534893f8 at 0x252000 block 297

I have those two files but they are both 0 bytes.

Any ideas?

Chris

Revenge of the disc cache

The disc cache has proved problematic on some operating systems where
disc operations are slow.

After a great deal of testing and benchmarking it has been determined
the principle slowdown on many of these platforms comes from the
system overheads creating the forest of directories and small files
that hold the cached data.

This overhead when coupled with the very slow synchronous write out of
some operating systems (like RISC OS) causes the "slow writer" message
and cache disablement to occur.

In an attempt to address this I have recently reworked the handling of
small files within the cache. There are now a small number of
relatively large files into which all small objects are placed. This
has resulted in the majority of objects (>70%) being held in these blocks
rather than in separate files on disk.

The resulting cache directories have a correspondingly smaller number
of files and directories within them and should (I hope) exhibit
greatly superior performance.

Of course all this is theoretical and it may not help at all, my
previous attempts at improving this situation have not been very
successful!

There is one drawback, the new scheme has changed the cache layout in
an incompatible way. While this will not be an issue at run time and
the cache will reinitialise itself at first start of CI builds after
#2688 it will leave the entire contents of any old cache behind and
never expire data from it. Therefore I advise the removal of the
contents of the NetSurf cache before running any of these CI builds.


--
Regards Vincent
http://www.kyllikki.org/

unreadably narrow column in rendering of page

These pages from local newspaper takes ages in the fetching-processing
stage, and then finally displays its text in a pane that is too narrow
to read.
http://www.centralsomersetgazette.co.uk/Just-doctor-ordered/story-26229361-detail/story.html
http://www.centralsomersetgazette.co.uk/Street-schoolgirl-gains-place-national-theatre/story-26181050-detail/story.html

Dunno if the fault is Netsurf or the designer of the page.

The wife (voice teacher for pupils in stories) is not impressed.

Netsurf #2644 on Iyonix (RiscOS 5.18).

--
Jim Nagel www.archivemag.co.uk

Re: Google Books do not show pages any longer

On 31 Mar 2015 as I do recall,
Roger Darlington wrote:

> On 18 Feb 2015, Harriet Bazley wrote:

[snip]

> > For example, https://books.google.co.uk/books?id=VL5wUgW0RssC&pg=PA24
> > The intended display is hidden as
>
> > .viewport div img {display:none;}
> > </style><div style="height:853px;width:575px;position:relative;margin-
> > bottom:4px">
> > <style type=text/css>.html_page_image {
> > background-image:url("https://books.google.co.uk/books?id=VL5wUgW0RssC
> > &ie=ISO-8859-1&pg=PA24&img=1&zoom=3&hl=en&sig=ACfU3U1veGpmwlalmSlRUhFW
> > AAUiHFXutw");
> > width:575px;height:853px; top:0px;left:0px;position:relative}</style>
>
> > Click on *that*, and you can see the page, annoying though the workaround
> > is....
>
>
> I am puzzled by this Hilary.
>
> Firefox on Windows7 has no such trouble displaying google book pages
> without any rigmarole about finding some other link hidden deep inside
> it and clicking on that instead.
>
> Maybe Firefox ingnores display:none and background display and instead
> gets straight on with the proper business of displaying it?

Much more likely that it is Firefox that supports the complicated
obfuscation they are using to make the content of the book invisible to
search engines/impossible to save out of Windows browsers (or whatever the
purpose of this CSS may be), and Netsurf that ignores it.

--
Harriet Bazley == Loyaulte me lie ==

We are the knights who say "NI!"

Monday, 30 March 2015

Re: Google Books do not show pages any longer

On 18 Feb 2015, Harriet Bazley wrote:
> On 17 Feb 2015 as I do recall,
> Roger Darlington wrote:

>>
>> I suppose someone knows that Google Books does not show the pages any
>> longer in any version of Netsurf I have. One 2 years old, NS 3.2, and
>> a test build from today.
>>
>> It used to work fine, but Google must have put some spanners in their
>> works.
>>
> I think it's some kind of copy protection. The links to the images are still
> *there* in the source code, but specified as 'background'. The thing to
> do is to search for the string ".viewport".

> For example, https://books.google.co.uk/books?id=VL5wUgW0RssC&pg=PA24
> The intended display is hidden as

> .viewport div img {display:none;}
> </style><div style="height:853px;width:575px;position:relative;margin-
> bottom:4px">
> <style type=text/css>.html_page_image {
> background-image:url("https://books.google.co.uk/books?id=VL5wUgW0RssC
> &ie=ISO-8859-1&pg=PA24&img=1&zoom=3&hl=en&sig=ACfU3U1veGpmwlalmSlRUhFW
> AAUiHFXutw");
> width:575px;height:853px; top:0px;left:0px;position:relative}</style>

> Click on *that*, and you can see the page, annoying though the workaround
> is....


I am puzzled by this Hilary.

Firefox on Windows7 has no such trouble displaying google book pages
without any rigmarole about finding some other link hidden deep inside
it and clicking on that instead.

Maybe Firefox ingnores display:none and background display and instead
gets straight on with the proper business of displaying it?



--

Cheers
Roger
The more information you have, the more likely it is to be wrong

Re: JavaScript

In message <CAC85+4L83aiXwPEhZsqrq-oRS6kPeAWDEihZnw_UmWmgH1YOJw@mail.g
mail.com>
on 30 Mar 2015 David Feugey <dfeugey@ascinfo.fr> wrote:

> ... but nothing about JavaScript support. Just "work in progress".

I take you point about lack of detail, but I'm only a user rather than
a developer, so am not in a position to know what has been done but
hasn't been listed on the support web pages.

I do recall having a conversation with one of the developers at the
Wakefield show, possibly two years ago, who said that one aspect of
providing JS support involved working through a very large number of
"bindings" in order to check they worked correctly.


Regards

Andrew
--
Andrew Pinder

Re: BBC News

In article <mpro.nm1cfo01a6ts900oj.pittdj@pittdj.co.uk>,
David Pitt <pittdj@pittdj.co.uk> wrote:

[Snip]

> JavaScript is required for the progressive jpegs,

Head/desk.

[Snip]

--

www.timil.com

web sites * multimedia * training

Re: BBC News

On 30 Mar 2015 Dave Symes <dave@triffid.co.uk> wrote:

> In article <75868bac54.pnyoung@pnyoung.ormail.co.uk>,
> Peter Young <pnyoung@ormail.co.uk> wrote:
>> On 30 Mar 2015 Tony Moore <old_coaster@yahoo.co.uk> wrote:

>>> According to http://www.bbc.com/news/blogs-the-editors-32016166
>>> published by the BBC, on 23 March 2015

>>> Our new "responsive" design [of the BBC News website], which we've
>>> just launched for desktop computer, aims to make sure the site looks
>>> great whichever device or screen size you are on - mobile, tablet or
>>> desktop.

>>> However, http://www.bbc.co.uk/news , displayed by NetSurf #2655, on a
>>> RiscPC, seems to be a version for mobile, and looks far from 'great'.

>>> Do others see the same mess?

>> Yes, a horrible mess! I think this may be the same problem as the one
>> I reported in the "Malformed site" thread, starting on 19 February,
>> 2015, in that the mess I saw there is similar to the mess on the BBC
>> site. That was a CSS problem, and now happens 100% of the time.

>> "In the interests of product improvement, we reserve the right to foul
>> it up at any time".

>> Best wishes,

>> Peter.

> It even looks toilet solids in Firefox.

Doesn't look too bad in Windows Chrome, but I still prefer the
original look.

Best wishes,

Peter.

--
Peter Young (zfc Re) and family
Prestbury, Cheltenham, Glos. GL52, England
http://pnyoung.orpheusweb.co.uk
pnyoung@ormail.co.uk

Re: BBC News

Tony Moore, on 30 Mar, wrote:

> According to http://www.bbc.com/news/blogs-the-editors-32016166 published
> by the BBC, on 23 March 2015
>
> Our new "responsive" design [of the BBC News website], which we've
> just launched for desktop computer, aims to make sure the site looks
> great whichever device or screen size you are on - mobile, tablet or
> desktop.

This works well here on the desktop and iPad versions of Safari, the intent
seems reasonable and appears well implemented in that context.

> However, http://www.bbc.co.uk/news , displayed by NetSurf #2655, on a
> RiscPC, seems to be a version for mobile, and looks far from 'great'.

This helps, (a bit) http://www.bbc.co.uk/?dzf=news

> Do others see the same mess?

It certainly goes wrong in NetSurf and the real mobile version goes even
more wrong, http://m.bbc.co.uk/news

JavaScript is required for the progressive jpegs, a problem for NetSurf
which gets stuck with low resolution versions.

Users can have their say :-

http://www.bbc.co.uk/news/blogs-the-editors-31989823

https://ecustomeropinions.com/survey/survey.php?sid=264941693

--
David Pitt

Re: BBC News

In article <75868bac54.pnyoung@pnyoung.ormail.co.uk>,
Peter Young <pnyoung@ormail.co.uk> wrote:
> On 30 Mar 2015 Tony Moore <old_coaster@yahoo.co.uk> wrote:

> > According to http://www.bbc.com/news/blogs-the-editors-32016166
> > published by the BBC, on 23 March 2015

> > Our new "responsive" design [of the BBC News website], which we've
> > just launched for desktop computer, aims to make sure the site looks
> > great whichever device or screen size you are on - mobile, tablet or
> > desktop.

> > However, http://www.bbc.co.uk/news , displayed by NetSurf #2655, on a
> > RiscPC, seems to be a version for mobile, and looks far from 'great'.

> > Do others see the same mess?

> Yes, a horrible mess! I think this may be the same problem as the one
> I reported in the "Malformed site" thread, starting on 19 February,
> 2015, in that the mess I saw there is similar to the mess on the BBC
> site. That was a CSS problem, and now happens 100% of the time.

> "In the interests of product improvement, we reserve the right to foul
> it up at any time".

> Best wishes,

> Peter.

It even looks toilet solids in Firefox.

Dave

--

Dave Triffid

Re: BBC News

In message <b98f81ac54.old_coaster@old_coaster.yahoo.co.uk>
Tony Moore <old_coaster@yahoo.co.uk> wrote:

> According to http://www.bbc.com/news/blogs-the-editors-32016166
> published by the BBC, on 23 March 2015
>
> Our new "responsive" design [of the BBC News website], which we've
> just launched for desktop computer, aims to make sure the site looks
> great whichever device or screen size you are on - mobile, tablet or
> desktop.
>
> However, http://www.bbc.co.uk/news , displayed by NetSurf #2655, on a
> RiscPC, seems to be a version for mobile, and looks far from 'great'.
>
> Do others see the same mess?
>
> Tony
>
>
>
>
Yes.
(System details: NS 3.3 [10-Mar-15], RasPi B @ 900MHz, RO 5.21 [RC12,
12-Jan-15]).


--
George

Re: BBC News

On 30 Mar 2015 Tony Moore <old_coaster@yahoo.co.uk> wrote:

> According to http://www.bbc.com/news/blogs-the-editors-32016166
> published by the BBC, on 23 March 2015

> Our new "responsive" design [of the BBC News website], which we've
> just launched for desktop computer, aims to make sure the site looks
> great whichever device or screen size you are on - mobile, tablet or
> desktop.

> However, http://www.bbc.co.uk/news , displayed by NetSurf #2655, on a
> RiscPC, seems to be a version for mobile, and looks far from 'great'.

> Do others see the same mess?

Yes, a horrible mess! I think this may be the same problem as the one
I reported in the "Malformed site" thread, starting on 19 February,
2015, in that the mess I saw there is similar to the mess on the BBC
site. That was a CSS problem, and now happens 100% of the time.

"In the interests of product improvement, we reserve the right to foul
it up at any time".

Best wishes,

Peter.

--
Peter Young (zfc Re) and family
Prestbury, Cheltenham, Glos. GL52, England
http://pnyoung.orpheusweb.co.uk
pnyoung@ormail.co.uk

Re: BBC News

In article <b98f81ac54.old_coaster@old_coaster.yahoo.co.uk>,
Tony Moore <old_coaster@yahoo.co.uk> wrote:
> Do others see the same mess?

Yes. Also the pages loaded from NewsUK look the same mess.

--
Chris Johnson

Re: BBC News

On 30 March 2015 15:24:09 BST, Tony Moore <old_coaster@yahoo.co.uk> wrote:
>According to http://www.bbc.com/news/blogs-the-editors-32016166
>published by the BBC, on 23 March 2015
>
> Our new "responsive" design [of the BBC News website], which we've
> just launched for desktop computer, aims to make sure the site looks
> great whichever device or screen size you are on - mobile, tablet or
> desktop.
>
>However, http://www.bbc.co.uk/news , displayed by NetSurf #2655, on a
>RiscPC, seems to be a version for mobile, and looks far from 'great'.
>
>Do others see the same mess?

Yes, saw this on the day it launched. I was going to whinge about it on the blog but couldn't get the page to load, and then promptly forgot.

I don't know how the site picks the layout, if it's using the user-agent field then it must be assuming NetSurf is a mobile browser.

Chris

BBC News

According to http://www.bbc.com/news/blogs-the-editors-32016166
published by the BBC, on 23 March 2015

Our new "responsive" design [of the BBC News website], which we've
just launched for desktop computer, aims to make sure the site looks
great whichever device or screen size you are on - mobile, tablet or
desktop.

However, http://www.bbc.co.uk/news , displayed by NetSurf #2655, on a
RiscPC, seems to be a version for mobile, and looks far from 'great'.

Do others see the same mess?

Tony

Sunday, 29 March 2015

Re: JavaScript

Cool, exactly what I need :) Thanks John!
Hope to get/find more examples... I don't have complex needs, so
NetSurf could be OK for this.
Bye, David

2015-03-29 21:57 GMT+02:00 John Rickman Iyonix <rickman@argonet.co.uk>:
> David Feugey wrote
>
>> Hi. I worked on several appliances since 2000, and I'm now switching back
>> to RISC OS. As I have total control on the applications, I would like to
>> try to provide client appliances for these applications.
>
>> I know that NetSurf has only a limited support of JavaScript. But what can
>> we do exactly? Do you have examples of working code? The more code I'll
>> get, the more modern will be my interfaces, and the more chance I'll have
>> to convince my clients :)
>
>> Nota: I work only with web standards, but if I can narrow my choices to be
>> compatible with NetSurf, why not.
>
>> Thanks for the help, David
>
> I did a bit of testing to see what JS was supported a while ago.
> The following link shows waht I discovered.
>
> http://rickman.orpheusweb.co.uk/testing/index.html
>
>
> john
>
>
>
>
> --
> John Rickman - http://rickman.orpheusweb.co.uk/lynx
> I could have been someone - SMcG
>



--
Mobile : 06 76 67 91 60

Re: JavaScript

... but nothing about JavaScript support. Just "work in progress".

2015-03-29 17:54 GMT+02:00 Andrew Pinder <Andrew.Pinder@tiscali.co.uk>:
> In message <CAC85+4JSSvqQ8TmKNfYKLiczPapgU7x95Mw9PFSs1CUY3=WNsg@mail.g
> mail.com>
> on 29 Mar 2015 David Feugey <dfeugey@ascinfo.fr> wrote:
>
>> Hi. I worked on several appliances since 2000, and I'm now switching back
>> to RISC OS. As I have total control on the applications, I would like to
>> try to provide client appliances for these applications.
>
>> I know that NetSurf has only a limited support of JavaScript. But what can
>> we do exactly? Do you have examples of working code? The more code I'll
>> get, the more modern will be my interfaces, and the more chance I'll have
>> to convince my clients :)
>
>> Nota: I work only with web standards, but if I can narrow my choices to be
>> compatible with NetSurf, why not.
>
> Sounds good :-)
>
> Hopefully a developer will be along to give more complete answers, but
> you will find a summary of features at http://www.netsurf-browser.org/
> and more detail at
> http://www.netsurf-browser.org/documentation/progress.html
>
>
> Regards
>
> Andrew
> --
> Andrew Pinder
>



--
Mobile : 06 76 67 91 60

Re: JavaScript

David Feugey wrote

> Hi. I worked on several appliances since 2000, and I'm now switching back
> to RISC OS. As I have total control on the applications, I would like to
> try to provide client appliances for these applications.

> I know that NetSurf has only a limited support of JavaScript. But what can
> we do exactly? Do you have examples of working code? The more code I'll
> get, the more modern will be my interfaces, and the more chance I'll have
> to convince my clients :)

> Nota: I work only with web standards, but if I can narrow my choices to be
> compatible with NetSurf, why not.

> Thanks for the help, David

I did a bit of testing to see what JS was supported a while ago.
The following link shows waht I discovered.

http://rickman.orpheusweb.co.uk/testing/index.html


john




--
John Rickman - http://rickman.orpheusweb.co.uk/lynx
I could have been someone - SMcG

Re: JavaScript

On Sun, Mar 29, 2015 at 05:53:19PM +0200, David Feugey wrote:
> Sorry. The mailing list seems not to like messages from Gmail. Let's try again.

It seemed to arrive just fine...

B.

Re: JavaScript

In message <CAC85+4JSSvqQ8TmKNfYKLiczPapgU7x95Mw9PFSs1CUY3=WNsg@mail.g
mail.com>
on 29 Mar 2015 David Feugey <dfeugey@ascinfo.fr> wrote:

> Hi. I worked on several appliances since 2000, and I'm now switching back
> to RISC OS. As I have total control on the applications, I would like to
> try to provide client appliances for these applications.

> I know that NetSurf has only a limited support of JavaScript. But what can
> we do exactly? Do you have examples of working code? The more code I'll
> get, the more modern will be my interfaces, and the more chance I'll have
> to convince my clients :)

> Nota: I work only with web standards, but if I can narrow my choices to be
> compatible with NetSurf, why not.

Sounds good :-)

Hopefully a developer will be along to give more complete answers, but
you will find a summary of features at http://www.netsurf-browser.org/
and more detail at
http://www.netsurf-browser.org/documentation/progress.html


Regards

Andrew
--
Andrew Pinder

Re: JavaScript

Sorry. The mailing list seems not to like messages from Gmail. Let's try again.

I worked on several appliances since 2000, and I'm now switching back
to RISC OS. As I have total control on the applications, I would like
to try to provide client appliances for these applications.

I know that NetSurf has only a limited support of JavaScript. But what
can we do exactly? Do you have examples of working code? The more code
I'll get, the more modern will be my interfaces, and the more chance
I'll have to convince my clients :)

Nota: I work only with web standards, but if I can narrow my choices
to be compatible with NetSurf, why not.

Thanks for the help, David


2015-03-29 17:40 GMT+02:00 David Feugey <dfeugey@ascinfo.fr>:
> Hi. I worked on several appliances since 2000, and I'm now switching back to
> RISC OS. As I have total control on the applications, I would like to try to
> provide client appliances for these applications.
>
> I know that NetSurf has only a limited support of JavaScript. But what can
> we do exactly? Do you have examples of working code? The more code I'll get,
> the more modern will be my interfaces, and the more chance I'll have to
> convince my clients :)
>
> Nota: I work only with web standards, but if I can narrow my choices to be
> compatible with NetSurf, why not.
>
> Thanks for the help, David



--
Mobile : 06 76 67 91 60

JavaScript

Hi. I worked on several appliances since 2000, and I'm now switching back to RISC OS. As I have total control on the applications, I would like to try to provide client appliances for these applications.

I know that NetSurf has only a limited support of JavaScript. But what can we do exactly? Do you have examples of working code? The more code I'll get, the more modern will be my interfaces, and the more chance I'll have to convince my clients :)

Nota: I work only with web standards, but if I can narrow my choices to be compatible with NetSurf, why not.

Thanks for the help, David

Saturday, 28 March 2015

Re: Google Books hasn't worked for months now on NS

In article <afe056ab54.rogerarm@rogerarm.freeuk.com>,
Roger Darlington <rogerarm@freeuk.com> wrote:

> You wouldn't have thought Google would have changed the code so that
> it doesn't actually do anything on Netsurf now - didn't they donate
> some money to Netsurf once? Perhaps its time for them to now donate
> some code for it that enables it to read Google Book pages :-)

You'll probably find the only way they will donate something will be if
they are allowed access to it to track peoples behaviour. Note the recent
revelation that they hacked into Safari. One reason I don't use Chrome.

--
Stuart Winsor

Tools With A Mission
sending tools across the world
http://www.twam.co.uk/

Google Books hasn't worked for months now on NS

Has anyone else noticed. On NS 3.2 Google Books just puts up blank
pages of the books.

on the latest NS 3.3 the outline of the page is not even shown, but
the page number is. The page itself is still invisible.

But following further links the following 'page' from a typical Google
Book results in this, typically
https://books.google.co.uk/books?id=RR89AAAAIAAJ&printsec=frontcover&ie=ISO-8859
-1
Click above to find out.

Can this be fixed easily? I guess not.

You wouldn't have thought Google would have changed the code so that
it doesn't actually do anything on Netsurf now - didn't they donate
some money to Netsurf once? Perhaps its time for them to now donate
some code for it that enables it to read Google Book pages :-)



--

Cheers
Roger
Yesterday never goes.

Friday, 27 March 2015

Re: KEY_* to NETSURF_KEY_* change

On Tue, Mar 24, 2015 at 08:25:56PM +0100, Witold Filipczyk wrote:
> Here is with the NS_ prefix.

Applied, thanks for that.

--
Regards Vincent
http://www.kyllikki.org/

Re: Some noobie questions

On Thu, Mar 26, 2015 at 20:48:30 -0400, Jesse Nicholson wrote:
> I've been downloading the libs linked on the website such as libCSS/ hubbub
> and so on, but as you note, there isn't an API reference (not complaining,
> just saying). So I thought I'd just ask here to see if such functionality
> exists. Thanks for your time.

Currently, as the libraries are more meant for internal use than external use,
there is no official API documentation but we do tend to write
code-documentation into the headers so you could extract it from there
relatively easily.

Our CI extracts the documentation from the NetSurf project but not from our
libraries currently. Perhaps we might look at that in the future.

We do have an IRC channel though -- #netsurf on Freenode. If you join that,
please be aware that we're mostly UK based and we all have day jobs so
responses might be slow and constrained in when they occur.

D.

--
Daniel Silverstone http://www.netsurf-browser.org/
PGP mail accepted and encouraged. Key Id: 3CCE BABE 206C 3B69

Thursday, 26 March 2015

Some noobie questions

Hi All,

I've been scouring the interwebs for far too long trying to find an existing library to enable me to parse web pages (html) and then use CSS selectors against the DOM to pick out elements and modify/remove them. Basically, I'm looking for the functionality provided by queryselector/queryselectorall.

I've been downloading the libs linked on the website such as libCSS/ hubbub and so on, but as you note, there isn't an API reference (not complaining, just saying). So I thought I'd just ask here to see if such functionality exists. Thanks for your time.

--
-JN

#2674 page layout rendering

http://www.amateurphotographer.co.uk/reviews/lenses/canon-ef-11-24mm-f4l-usm-review?utm_campaign=20150323-qap-x-nwl-tw-amateurphotographer-24-03-2015&utm_medium=email&utm_source=newsletter&utm_campaign=20150323_QAP-X_NWL_TW_AmateurPhotographer&utm_medium=email&utm_source=Eloqua

Errors in page layout rendering.

Tuesday, 24 March 2015

Re: KEY_* to NETSURF_KEY_* change

diff --git a/amiga/clipboard.c b/amiga/clipboard.c
index c95a9a3..054496d 100644
--- a/amiga/clipboard.c
+++ b/amiga/clipboard.c
@@ -286,9 +286,9 @@ void ami_drag_selection(struct gui_window *g)
{
iffh = ami_clipboard_init_internal(1);

- browser_window_key_press(g->bw, KEY_COPY_SELECTION);
+ browser_window_key_press(g->bw, NS_KEY_COPY_SELECTION);
browser_window_mouse_click(gwin->gw->bw, BROWSER_MOUSE_PRESS_1, x, y);
- browser_window_key_press(gwin->gw->bw, KEY_PASTE);
+ browser_window_key_press(gwin->gw->bw, NS_KEY_PASTE);

ami_clipboard_free_internal(iffh);
iffh = old_iffh;
diff --git a/amiga/context_menu.c b/amiga/context_menu.c
index 970490e..81a0620 100644
--- a/amiga/context_menu.c
+++ b/amiga/context_menu.c
@@ -940,25 +940,25 @@ HOOKF(uint32, ami_context_menu_hook, Object *, item, APTR)
break;

case CMID_SELCUT:
- browser_window_key_press(gwin->gw->bw, KEY_CUT_SELECTION);
+ browser_window_key_press(gwin->gw->bw, NS_KEY_CUT_SELECTION);
break;

case CMID_SELCOPY:
- browser_window_key_press(gwin->gw->bw, KEY_COPY_SELECTION);
- browser_window_key_press(gwin->gw->bw, KEY_CLEAR_SELECTION);
+ browser_window_key_press(gwin->gw->bw, NS_KEY_COPY_SELECTION);
+ browser_window_key_press(gwin->gw->bw, NS_KEY_CLEAR_SELECTION);
break;

case CMID_SELPASTE:
- browser_window_key_press(gwin->gw->bw, KEY_PASTE);
+ browser_window_key_press(gwin->gw->bw, NS_KEY_PASTE);
break;

case CMID_SELALL:
- browser_window_key_press(gwin->gw->bw, KEY_SELECT_ALL);
+ browser_window_key_press(gwin->gw->bw, NS_KEY_SELECT_ALL);
gui_start_selection(gwin->gw);
break;

case CMID_SELCLEAR:
- browser_window_key_press(gwin->gw->bw, KEY_CLEAR_SELECTION);
+ browser_window_key_press(gwin->gw->bw, NS_KEY_CLEAR_SELECTION);
break;

case CMID_SELSAVE:
@@ -1013,7 +1013,7 @@ static uint32 ami_context_menu_hook_tree(struct Hook *hook, Object *item, APTR r
switch(itemid)
{
case CMID_TREE_LAUNCH:
- tree_keypress(tree, KEY_CR);
+ tree_keypress(tree, NS_KEY_CR);
break;

case CMID_TREE_EDITFOLDER:
@@ -1049,7 +1049,7 @@ static uint32 ami_context_menu_hook_tree(struct Hook *hook, Object *item, APTR r
break;

case CMID_TREE_DELETE:
- tree_keypress(tree, KEY_DELETE_RIGHT);
+ tree_keypress(tree, NS_KEY_DELETE_RIGHT);
break;
}
}
diff --git a/amiga/gui.c b/amiga/gui.c
index 238a4ad..49c1252 100644
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -1125,82 +1125,82 @@ int ami_key_to_nskey(ULONG keycode, struct InputEvent *ie)
case RAWKEY_CRSRUP:
if(ie->ie_Qualifier & IEQUALIFIER_RSHIFT)
{
- nskey = KEY_PAGE_UP;
+ nskey = NS_KEY_PAGE_UP;
}
else if(ie->ie_Qualifier & IEQUALIFIER_RALT)
{
- nskey = KEY_TEXT_START;
+ nskey = NS_KEY_TEXT_START;
}
- else nskey = KEY_UP;
+ else nskey = NS_KEY_UP;
break;
case RAWKEY_CRSRDOWN:
if(ie->ie_Qualifier & IEQUALIFIER_RSHIFT)
{
- nskey = KEY_PAGE_DOWN;
+ nskey = NS_KEY_PAGE_DOWN;
}
else if(ie->ie_Qualifier & IEQUALIFIER_RALT)
{
- nskey = KEY_TEXT_END;
+ nskey = NS_KEY_TEXT_END;
}
- else nskey = KEY_DOWN;
+ else nskey = NS_KEY_DOWN;
break;
case RAWKEY_CRSRLEFT:
if(ie->ie_Qualifier & IEQUALIFIER_RSHIFT)
{
- nskey = KEY_LINE_START;
+ nskey = NS_KEY_LINE_START;
}
else if(ie->ie_Qualifier & IEQUALIFIER_RALT)
{
- nskey = KEY_WORD_LEFT;
+ nskey = NS_KEY_WORD_LEFT;
}
- else nskey = KEY_LEFT;
+ else nskey = NS_KEY_LEFT;
break;
case RAWKEY_CRSRRIGHT:
if(ie->ie_Qualifier & IEQUALIFIER_RSHIFT)
{
- nskey = KEY_LINE_END;
+ nskey = NS_KEY_LINE_END;
}
else if(ie->ie_Qualifier & IEQUALIFIER_RALT)
{
- nskey = KEY_WORD_RIGHT;
+ nskey = NS_KEY_WORD_RIGHT;
}
- else nskey = KEY_RIGHT;
+ else nskey = NS_KEY_RIGHT;
break;
case RAWKEY_ESC:
- nskey = KEY_ESCAPE;
+ nskey = NS_KEY_ESCAPE;
break;
case RAWKEY_PAGEUP:
- nskey = KEY_PAGE_UP;
+ nskey = NS_KEY_PAGE_UP;
break;
case RAWKEY_PAGEDOWN:
- nskey = KEY_PAGE_DOWN;
+ nskey = NS_KEY_PAGE_DOWN;
break;
case RAWKEY_HOME:
- nskey = KEY_TEXT_START;
+ nskey = NS_KEY_TEXT_START;
break;
case RAWKEY_END:
- nskey = KEY_TEXT_END;
+ nskey = NS_KEY_TEXT_END;
break;
case RAWKEY_BACKSPACE:
if(ie->ie_Qualifier & IEQUALIFIER_RSHIFT)
{
- nskey = KEY_DELETE_LINE_START;
+ nskey = NS_KEY_DELETE_LINE_START;
}
- else nskey = KEY_DELETE_LEFT;
+ else nskey = NS_KEY_DELETE_LEFT;
break;
case RAWKEY_DEL:
if(ie->ie_Qualifier & IEQUALIFIER_RSHIFT)
{
- nskey = KEY_DELETE_LINE_END;
+ nskey = NS_KEY_DELETE_LINE_END;
}
- else nskey = KEY_DELETE_RIGHT;
+ else nskey = NS_KEY_DELETE_RIGHT;
break;
case RAWKEY_TAB:
if(ie->ie_Qualifier & IEQUALIFIER_RSHIFT)
{
- nskey = KEY_SHIFT_TAB;
+ nskey = NS_KEY_SHIFT_TAB;
}
- else nskey = KEY_TAB;
+ else nskey = NS_KEY_TAB;
break;
case RAWKEY_F5:
case RAWKEY_HELP:
@@ -1215,22 +1215,22 @@ int ami_key_to_nskey(ULONG keycode, struct InputEvent *ie)
if(ie->ie_Qualifier & IEQUALIFIER_RCOMMAND) {
switch(nskey) {
case 'a':
- nskey = KEY_SELECT_ALL;
+ nskey = NS_KEY_SELECT_ALL;
break;
case 'c':
- nskey = KEY_COPY_SELECTION;
+ nskey = NS_KEY_COPY_SELECTION;
break;
case 'v':
- nskey = KEY_PASTE;
+ nskey = NS_KEY_PASTE;
break;
case 'x':
- nskey = KEY_CUT_SELECTION;
+ nskey = NS_KEY_CUT_SELECTION;
break;
case 'y':
- nskey = KEY_REDO;
+ nskey = NS_KEY_REDO;
break;
case 'z':
- nskey = KEY_UNDO;
+ nskey = NS_KEY_UNDO;
break;
}
}
@@ -2375,55 +2375,55 @@ static void ami_handle_msg(void)
{
switch(nskey)
{
- case KEY_UP:
+ case NS_KEY_UP:
ami_gui_scroll_internal(gwin, 0, -NSA_KBD_SCROLL_PX);
break;

- case KEY_DOWN:
+ case NS_KEY_DOWN:
ami_gui_scroll_internal(gwin, 0, +NSA_KBD_SCROLL_PX);
break;

- case KEY_LEFT:
+ case NS_KEY_LEFT:
ami_gui_scroll_internal(gwin, -NSA_KBD_SCROLL_PX, 0);
break;

- case KEY_RIGHT:
+ case NS_KEY_RIGHT:
ami_gui_scroll_internal(gwin, +NSA_KBD_SCROLL_PX, 0);
break;

- case KEY_PAGE_UP:
+ case NS_KEY_PAGE_UP:
ami_gui_scroll_internal(gwin, 0, SCROLL_PAGE_UP);
break;

- case KEY_PAGE_DOWN:
+ case NS_KEY_PAGE_DOWN:
ami_gui_scroll_internal(gwin, 0, SCROLL_PAGE_DOWN);
break;

- case KEY_LINE_START: // page left
+ case NS_KEY_LINE_START: // page left
ami_gui_scroll_internal(gwin, SCROLL_PAGE_UP, 0);
break;

- case KEY_LINE_END: // page right
+ case NS_KEY_LINE_END: // page right
ami_gui_scroll_internal(gwin, SCROLL_PAGE_DOWN, 0);
break;

- case KEY_TEXT_START: // home
+ case NS_KEY_TEXT_START: // home
ami_gui_scroll_internal(gwin, SCROLL_TOP, SCROLL_TOP);
break;

- case KEY_TEXT_END: // end
+ case NS_KEY_TEXT_END: // end
ami_gui_scroll_internal(gwin, SCROLL_BOTTOM, SCROLL_BOTTOM);
break;

- case KEY_WORD_RIGHT: // alt+right
+ case NS_KEY_WORD_RIGHT: // alt+right
ami_change_tab(gwin, 1);
break;

- case KEY_WORD_LEFT: // alt+left
+ case NS_KEY_WORD_LEFT: // alt+left
ami_change_tab(gwin, -1);
break;

- case KEY_DELETE_LEFT: // backspace
+ case NS_KEY_DELETE_LEFT: // backspace
ami_gui_history(gwin, true);
break;

@@ -2436,9 +2436,9 @@ static void ami_handle_msg(void)
ami_help_open(AMI_HELP_GUI, scrn);
break;
}
- } else if(nskey == KEY_COPY_SELECTION) {
+ } else if(nskey == NS_KEY_COPY_SELECTION) {
/* if we've copied a selection we need to clear it - style guide rules */
- browser_window_key_press(gwin->gw->bw, KEY_CLEAR_SELECTION);
+ browser_window_key_press(gwin->gw->bw, NS_KEY_CLEAR_SELECTION);
}
}
break;
diff --git a/amiga/menu.c b/amiga/menu.c
index fbb6af3..a34aa1d 100644
--- a/amiga/menu.c
+++ b/amiga/menu.c
@@ -240,7 +240,7 @@ HOOKF(void, ami_menu_item_edit_cut, APTR, window, struct IntuiMessage *)
struct gui_window_2 *gwin;
GetAttr(WINDOW_UserData, (Object *)window, (ULONG *)&gwin);

- browser_window_key_press(gwin->gw->bw, KEY_CUT_SELECTION);
+ browser_window_key_press(gwin->gw->bw, NS_KEY_CUT_SELECTION);
}

HOOKF(void, ami_menu_item_edit_copy, APTR, window, struct IntuiMessage *)
@@ -250,8 +250,8 @@ HOOKF(void, ami_menu_item_edit_copy, APTR, window, struct IntuiMessage *)
GetAttr(WINDOW_UserData, (Object *)window, (ULONG *)&gwin);

if(browser_window_can_select(gwin->gw->bw)) {
- browser_window_key_press(gwin->gw->bw, KEY_COPY_SELECTION);
- browser_window_key_press(gwin->gw->bw, KEY_CLEAR_SELECTION);
+ browser_window_key_press(gwin->gw->bw, NS_KEY_COPY_SELECTION);
+ browser_window_key_press(gwin->gw->bw, NS_KEY_CLEAR_SELECTION);
}
else if((bm = content_get_bitmap(browser_window_get_content(gwin->gw->bw)))) {
/** @todo It should be checked that the lifetime of
@@ -274,7 +274,7 @@ HOOKF(void, ami_menu_item_edit_paste, APTR, window, struct IntuiMessage *)
struct gui_window_2 *gwin;
GetAttr(WINDOW_UserData, (Object *)window, (ULONG *)&gwin);

- browser_window_key_press(gwin->gw->bw, KEY_PASTE);
+ browser_window_key_press(gwin->gw->bw, NS_KEY_PASTE);
}

HOOKF(void, ami_menu_item_edit_selectall, APTR, window, struct IntuiMessage *)
@@ -282,7 +282,7 @@ HOOKF(void, ami_menu_item_edit_selectall, APTR, window, struct IntuiMessage *)
struct gui_window_2 *gwin;
GetAttr(WINDOW_UserData, (Object *)window, (ULONG *)&gwin);

- browser_window_key_press(gwin->gw->bw, KEY_SELECT_ALL);
+ browser_window_key_press(gwin->gw->bw, NS_KEY_SELECT_ALL);
gui_start_selection(gwin->gw);
}

@@ -291,7 +291,7 @@ HOOKF(void, ami_menu_item_edit_clearsel, APTR, window, struct IntuiMessage *)
struct gui_window_2 *gwin;
GetAttr(WINDOW_UserData, (Object *)window, (ULONG *)&gwin);

- browser_window_key_press(gwin->gw->bw, KEY_CLEAR_SELECTION);
+ browser_window_key_press(gwin->gw->bw, NS_KEY_CLEAR_SELECTION);
}

HOOKF(void, ami_menu_item_edit_undo, APTR, window, struct IntuiMessage *)
@@ -299,7 +299,7 @@ HOOKF(void, ami_menu_item_edit_undo, APTR, window, struct IntuiMessage *)
struct gui_window_2 *gwin;
GetAttr(WINDOW_UserData, (Object *)window, (ULONG *)&gwin);

- browser_window_key_press(gwin->gw->bw, KEY_UNDO);
+ browser_window_key_press(gwin->gw->bw, NS_KEY_UNDO);
}

HOOKF(void, ami_menu_item_edit_redo, APTR, window, struct IntuiMessage *)
@@ -307,7 +307,7 @@ HOOKF(void, ami_menu_item_edit_redo, APTR, window, struct IntuiMessage *)
struct gui_window_2 *gwin;
GetAttr(WINDOW_UserData, (Object *)window, (ULONG *)&gwin);

- browser_window_key_press(gwin->gw->bw, KEY_REDO);
+ browser_window_key_press(gwin->gw->bw, NS_KEY_REDO);
}

HOOKF(void, ami_menu_item_browser_find, APTR, window, struct IntuiMessage *)
diff --git a/amiga/tree.c b/amiga/tree.c
index cba5375..fdfd690 100644
--- a/amiga/tree.c
+++ b/amiga/tree.c
@@ -1197,9 +1197,9 @@ BOOL ami_tree_event(struct treeview_window *twin)
GetAttr(WINDOW_InputEvent,twin->objects[OID_MAIN],(ULONG *)&ie);
nskey = ami_key_to_nskey(storage, ie);
tree_keypress(twin->tree, nskey);
- if(nskey == KEY_COPY_SELECTION) {
+ if(nskey == NS_KEY_COPY_SELECTION) {
/* if we've copied a selection we need to clear it - style guide rules */
- tree_keypress(twin->tree, KEY_CLEAR_SELECTION);
+ tree_keypress(twin->tree, NS_KEY_CLEAR_SELECTION);
}
break;

@@ -1386,13 +1386,13 @@ BOOL ami_tree_event(struct treeview_window *twin)
switch(twin->type)
{
case AMI_TREE_HISTORY:
- global_history_keypress(KEY_DELETE_LEFT);
+ global_history_keypress(NS_KEY_DELETE_LEFT);
break;
case AMI_TREE_COOKIES:
- cookie_manager_keypress(KEY_DELETE_LEFT);
+ cookie_manager_keypress(NS_KEY_DELETE_LEFT);
break;
case AMI_TREE_HOTLIST:
- hotlist_keypress(KEY_DELETE_LEFT);
+ hotlist_keypress(NS_KEY_DELETE_LEFT);
break;
}
ami_tree_update_buttons(twin);
@@ -1402,13 +1402,13 @@ BOOL ami_tree_event(struct treeview_window *twin)
switch(twin->type)
{
case AMI_TREE_HISTORY:
- global_history_keypress(KEY_SELECT_ALL);
+ global_history_keypress(NS_KEY_SELECT_ALL);
break;
case AMI_TREE_COOKIES:
- cookie_manager_keypress(KEY_SELECT_ALL);
+ cookie_manager_keypress(NS_KEY_SELECT_ALL);
break;
case AMI_TREE_HOTLIST:
- hotlist_keypress(KEY_SELECT_ALL);
+ hotlist_keypress(NS_KEY_SELECT_ALL);
break;
}
ami_tree_update_buttons(twin);
@@ -1418,13 +1418,13 @@ BOOL ami_tree_event(struct treeview_window *twin)
switch(twin->type)
{
case AMI_TREE_HISTORY:
- global_history_keypress(KEY_CLEAR_SELECTION);
+ global_history_keypress(NS_KEY_CLEAR_SELECTION);
break;
case AMI_TREE_COOKIES:
- cookie_manager_keypress(KEY_CLEAR_SELECTION);
+ cookie_manager_keypress(NS_KEY_CLEAR_SELECTION);
break;
case AMI_TREE_HOTLIST:
- hotlist_keypress(KEY_CLEAR_SELECTION);
+ hotlist_keypress(NS_KEY_CLEAR_SELECTION);
break;
}
ami_tree_update_buttons(twin);
diff --git a/atari/ctxmenu.c b/atari/ctxmenu.c
index 907e65d..643ee29 100644
--- a/atari/ctxmenu.c
+++ b/atari/ctxmenu.c
@@ -209,19 +209,19 @@ void context_popup(struct gui_window * gw, short x, short y)

switch( choice ){
case POP_CTX_COPY_SEL:
- browser_window_key_press(gw->browser->bw, KEY_COPY_SELECTION);
+ browser_window_key_press(gw->browser->bw, NS_KEY_COPY_SELECTION);
break;

case POP_CTX_CUT_SEL:
- browser_window_key_press(gw->browser->bw, KEY_CUT_SELECTION);
+ browser_window_key_press(gw->browser->bw, NS_KEY_CUT_SELECTION);
break;

case POP_CTX_PASTE_SEL:
- browser_window_key_press(gw->browser->bw, KEY_PASTE);
+ browser_window_key_press(gw->browser->bw, NS_KEY_PASTE);
break;

case POP_CTX_SELECT_ALL:
- browser_window_key_press(gw->browser->bw, KEY_SELECT_ALL);
+ browser_window_key_press(gw->browser->bw, NS_KEY_SELECT_ALL);
break;

case POP_CTX_SAVE_AS:
diff --git a/atari/deskmenu.c b/atari/deskmenu.c
index c151ef5..54bbd17 100644
--- a/atari/deskmenu.c
+++ b/atari/deskmenu.c
@@ -323,21 +323,21 @@ static void __CDECL menu_quit(short item, short title, void *data)
static void __CDECL menu_cut(short item, short title, void *data)
{
if( input_window != NULL )
- browser_window_key_press( input_window->browser->bw, KEY_CUT_SELECTION);
+ browser_window_key_press( input_window->browser->bw, NS_KEY_CUT_SELECTION);
}

static void __CDECL menu_copy(short item, short title, void *data)
{
LOG(("%s", __FUNCTION__));
if( input_window != NULL )
- browser_window_key_press( input_window->browser->bw, KEY_COPY_SELECTION);
+ browser_window_key_press( input_window->browser->bw, NS_KEY_COPY_SELECTION);
}

static void __CDECL menu_paste(short item, short title, void *data)
{
LOG(("%s", __FUNCTION__));
if( input_window != NULL )
- browser_window_key_press( input_window->browser->bw, KEY_PASTE);
+ browser_window_key_press( input_window->browser->bw, NS_KEY_PASTE);
}

static void __CDECL menu_find(short item, short title, void *data)
diff --git a/atari/hotlist.c b/atari/hotlist.c
index 0324c3b..04f6306 100644
--- a/atari/hotlist.c
+++ b/atari/hotlist.c
@@ -159,7 +159,7 @@ static short handle_event(GUIWIN *win, EVMULT_OUT *ev_out, short msg[8])
break;

case TOOLBAR_HOTLIST_DELETE:
- hotlist_keypress(KEY_DELETE_LEFT);
+ hotlist_keypress(NS_KEY_DELETE_LEFT);
break;

case TOOLBAR_HOTLIST_EDIT:
diff --git a/atari/misc.c b/atari/misc.c
index 8cb2855..0f34a82 100755
--- a/atari/misc.c
+++ b/atari/misc.c
@@ -297,19 +297,19 @@ long nkc_to_input_key(short nkc, long * ucs4_out)
else if( (nkc & NKF_CTRL) == NKF_CTRL ) {
switch ( ascii ) {
case 'A':
- ik = KEY_SELECT_ALL;
+ ik = NS_KEY_SELECT_ALL;
break;

case 'C':
- ik = KEY_COPY_SELECTION;
+ ik = NS_KEY_COPY_SELECTION;
break;

case 'X':
- ik = KEY_CUT_SELECTION;
+ ik = NS_KEY_CUT_SELECTION;
break;

case 'V':
- ik = KEY_PASTE;
+ ik = NS_KEY_PASTE;
break;

default:
@@ -320,23 +320,23 @@ long nkc_to_input_key(short nkc, long * ucs4_out)
else if( (nkc & NKF_SHIFT) != 0 ) {
switch( ascii ) {
case NK_TAB:
- ik = KEY_SHIFT_TAB;
+ ik = NS_KEY_SHIFT_TAB;
break;

case NK_LEFT:
- ik = KEY_LINE_START;
+ ik = NS_KEY_LINE_START;
break;

case NK_RIGHT:
- ik = KEY_LINE_END;
+ ik = NS_KEY_LINE_END;
break;

case NK_UP:
- ik = KEY_PAGE_UP;
+ ik = NS_KEY_PAGE_UP;
break;

case NK_DOWN:
- ik = KEY_PAGE_DOWN;
+ ik = NS_KEY_PAGE_DOWN;
break;

default:
@@ -348,64 +348,64 @@ long nkc_to_input_key(short nkc, long * ucs4_out)
switch( ascii ) {

case NK_INS:
- ik = KEY_PASTE;
+ ik = NS_KEY_PASTE;
break;

case NK_BS:
- ik = KEY_DELETE_LEFT;
+ ik = NS_KEY_DELETE_LEFT;
break;

case NK_DEL:
- ik = KEY_DELETE_RIGHT;
+ ik = NS_KEY_DELETE_RIGHT;
break;

case NK_TAB:
- ik = KEY_TAB;
+ ik = NS_KEY_TAB;
break;


case NK_ENTER:
- ik = KEY_NL;
+ ik = NS_KEY_NL;
break;

case NK_RET:
- ik = KEY_CR;
+ ik = NS_KEY_CR;
break;

case NK_ESC:
- ik = KEY_ESCAPE;
+ ik = NS_KEY_ESCAPE;
break;

case NK_CLRHOME:
- ik = KEY_TEXT_START;
+ ik = NS_KEY_TEXT_START;
break;

case NK_RIGHT:
- ik = KEY_RIGHT;
+ ik = NS_KEY_RIGHT;
break;

case NK_LEFT:
- ik = KEY_LEFT;
+ ik = NS_KEY_LEFT;
break;

case NK_UP:
- ik = KEY_UP;
+ ik = NS_KEY_UP;
break;

case NK_UNDO:
- ik = KEY_UNDO;
+ ik = NS_KEY_UNDO;
break;

case NK_DOWN:
- ik = KEY_DOWN;
+ ik = NS_KEY_DOWN;
break;

case NK_M_PGUP:
- ik = KEY_PAGE_UP;
+ ik = NS_KEY_PAGE_UP;
break;

case NK_M_PGDOWN:
- ik = KEY_PAGE_DOWN;
+ ik = NS_KEY_PAGE_DOWN;
break;

default:
diff --git a/atari/rootwin.c b/atari/rootwin.c
index a35f179..bd4891e 100755
--- a/atari/rootwin.c
+++ b/atari/rootwin.c
@@ -512,7 +512,7 @@ void window_set_focus(struct s_gui_win_root *rootwin,
/*
ta = toolbar_get_textarea(rootwin->toolbar,
URL_INPUT_TEXT_AREA);
- textarea_keypress(ta, KEY_SELECT_ALL);
+ textarea_keypress(ta, NS_KEY_SELECT_ALL);
*/
break;

@@ -1287,51 +1287,51 @@ static bool on_content_keypress(struct gui_window *gw, unsigned short nkc)
struct gemtk_wm_scroll_info_s *slid = gemtk_wm_get_scroll_info(w);

switch( ik ) {
- case KEY_LINE_START:
+ case NS_KEY_LINE_START:
gemtk_wm_scroll(w, GEMTK_WM_HSLIDER, -(g.g_w/slid->x_unit_px),
false);
r = true;
break;

- case KEY_LINE_END:
+ case NS_KEY_LINE_END:
gemtk_wm_scroll(w, GEMTK_WM_HSLIDER, (g.g_w/slid->x_unit_px),
false);
r = true;
break;

- case KEY_PAGE_UP:
+ case NS_KEY_PAGE_UP:
gemtk_wm_scroll(w, GEMTK_WM_VSLIDER, -(g.g_h/slid->y_unit_px),
false);
r = true;
break;

- case KEY_PAGE_DOWN:
+ case NS_KEY_PAGE_DOWN:
gemtk_wm_scroll(w, GEMTK_WM_VSLIDER, (g.g_h/slid->y_unit_px),
false);
r = true;
break;

- case KEY_RIGHT:
+ case NS_KEY_RIGHT:
gemtk_wm_scroll(w, GEMTK_WM_HSLIDER, -1, false);
r = true;
break;

- case KEY_LEFT:
+ case NS_KEY_LEFT:
gemtk_wm_scroll(w, GEMTK_WM_HSLIDER, 1, false);
r = true;
break;

- case KEY_UP:
+ case NS_KEY_UP:
gemtk_wm_scroll(w, GEMTK_WM_VSLIDER, -1, false);
r = true;
break;

- case KEY_DOWN:
+ case NS_KEY_DOWN:
gemtk_wm_scroll(w, GEMTK_WM_VSLIDER, 1, false);
r = true;
break;

- case KEY_TEXT_START:
+ case NS_KEY_TEXT_START:
window_scroll_by(gw->root, 0, 0);
r = true;
break;
diff --git a/atari/toolbar.c b/atari/toolbar.c
index 56d49de..90eec95 100644
--- a/atari/toolbar.c
+++ b/atari/toolbar.c
@@ -696,7 +696,7 @@ bool toolbar_key_input(struct s_toolbar *tb, short nkc)
ret = textarea_keypress(tb->url.textarea, ucs4);
}
}
- else if (ik == KEY_CR || ik == KEY_NL) {
+ else if (ik == NS_KEY_CR || ik == NS_KEY_NL) {
nsurl *url;
char tmp_url[PATH_MAX];
if ( textarea_get_text( tb->url.textarea, tmp_url, PATH_MAX) > 0 ) {
@@ -713,7 +713,7 @@ bool toolbar_key_input(struct s_toolbar *tb, short nkc)
ret = true;
}
}
- else if (ik == KEY_COPY_SELECTION) {
+ else if (ik == NS_KEY_COPY_SELECTION) {
// copy whole text
char * text;
int len;
@@ -725,7 +725,7 @@ bool toolbar_key_input(struct s_toolbar *tb, short nkc)
free( text );
}
}
- else if ( ik == KEY_PASTE) {
+ else if ( ik == NS_KEY_PASTE) {
char * clip = scrap_txt_read();
if ( clip != NULL ){
int clip_length = strlen( clip );
@@ -744,9 +744,9 @@ bool toolbar_key_input(struct s_toolbar *tb, short nkc)
free( clip );
}
}
- else if (ik == KEY_ESCAPE) {
- textarea_keypress( tb->url.textarea, KEY_SELECT_ALL );
- textarea_keypress( tb->url.textarea, KEY_DELETE_LEFT );
+ else if (ik == NS_KEY_ESCAPE) {
+ textarea_keypress( tb->url.textarea, NS_KEY_SELECT_ALL );
+ textarea_keypress( tb->url.textarea, NS_KEY_DELETE_LEFT );
}
else {
ret = textarea_keypress( tb->url.textarea, ik );
diff --git a/beos/scaffolding.cpp b/beos/scaffolding.cpp
index 04b4261..3975022 100644
--- a/beos/scaffolding.cpp
+++ b/beos/scaffolding.cpp
@@ -961,17 +961,17 @@ void nsbeos_scaffolding_dispatch_event(nsbeos_scaffolding *scaffold, BMessage *m
break;
}
case B_COPY:
- browser_window_key_press(bw, KEY_COPY_SELECTION);
+ browser_window_key_press(bw, NS_KEY_COPY_SELECTION);
break;
case B_CUT:
- browser_window_key_press(bw, KEY_CUT_SELECTION);
+ browser_window_key_press(bw, NS_KEY_CUT_SELECTION);
break;
case B_PASTE:
- browser_window_key_press(bw, KEY_PASTE);
+ browser_window_key_press(bw, NS_KEY_PASTE);
break;
case B_SELECT_ALL:
LOG(("Selecting all text"));
- browser_window_key_press(bw, KEY_SELECT_ALL);
+ browser_window_key_press(bw, NS_KEY_SELECT_ALL);
break;
case B_NETPOSITIVE_BACK:
case BROWSER_NAVIGATE_BACK:
diff --git a/beos/window.cpp b/beos/window.cpp
index a507d6f..bfa1028 100644
--- a/beos/window.cpp
+++ b/beos/window.cpp
@@ -772,24 +772,24 @@ void nsbeos_window_keypress_event(BView *view, gui_window *g, BMessage *event)
nskey = (uint32_t)byte;
else {
switch (byte) {
- case B_BACKSPACE: nskey = KEY_DELETE_LEFT; break;
- case B_TAB: nskey = KEY_TAB; break;
+ case B_BACKSPACE: nskey = NS_KEY_DELETE_LEFT; break;
+ case B_TAB: nskey = NS_KEY_TAB; break;
/*case XK_Linefeed: return QKlinefeed;*/
case B_ENTER: nskey = (uint32_t)10; break;
case B_ESCAPE: nskey = (uint32_t)'\033'; break;
case B_SPACE: nskey = (uint32_t)' '; break;
- case B_DELETE: nskey = KEY_DELETE_RIGHT; break;
+ case B_DELETE: nskey = NS_KEY_DELETE_RIGHT; break;
/*
- case B_INSERT: nskey = KEYSYM("insert"); break;
+ case B_INSERT: nskey = NS_KEYSYM("insert"); break;
*/
- case B_HOME: nskey = KEY_LINE_START; break; // XXX ?
- case B_END: nskey = KEY_LINE_END; break; // XXX ?
- case B_PAGE_UP: nskey = KEY_PAGE_UP; break;
- case B_PAGE_DOWN: nskey = KEY_PAGE_DOWN; break;
- case B_LEFT_ARROW: nskey = KEY_LEFT; break;
- case B_RIGHT_ARROW: nskey = KEY_RIGHT; break;
- case B_UP_ARROW: nskey = KEY_UP; break;
- case B_DOWN_ARROW: nskey = KEY_DOWN; break;
+ case B_HOME: nskey = NS_KEY_LINE_START; break; // XXX ?
+ case B_END: nskey = NS_KEY_LINE_END; break; // XXX ?
+ case B_PAGE_UP: nskey = NS_KEY_PAGE_UP; break;
+ case B_PAGE_DOWN: nskey = NS_KEY_PAGE_DOWN; break;
+ case B_LEFT_ARROW: nskey = NS_KEY_LEFT; break;
+ case B_RIGHT_ARROW: nskey = NS_KEY_RIGHT; break;
+ case B_UP_ARROW: nskey = NS_KEY_UP; break;
+ case B_DOWN_ARROW: nskey = NS_KEY_DOWN; break;
/*
case B_FUNCTION_KEY:
switch (scancode) {
diff --git a/cocoa/BookmarksController.m b/cocoa/BookmarksController.m
index 5d3de74..8c3a952 100644
--- a/cocoa/BookmarksController.m
+++ b/cocoa/BookmarksController.m
@@ -202,7 +202,7 @@ static const char *cocoa_hotlist_path( void )

- (IBAction) deleteSelected: (id) sender;
{
- hotlist_keypress(KEY_DELETE_LEFT);
+ hotlist_keypress(NS_KEY_DELETE_LEFT);
}

- (IBAction) addFolder: (id) sender;
diff --git a/cocoa/BrowserView.m b/cocoa/BrowserView.m
index e9d6ddd..ba0116c 100644
--- a/cocoa/BrowserView.m
+++ b/cocoa/BrowserView.m
@@ -311,80 +311,80 @@ static browser_mouse_state cocoa_mouse_flags_for_event( NSEvent *evt )

- (void) moveLeft: (id)sender;
{
- if (browser_window_key_press( browser, KEY_LEFT )) return;
+ if (browser_window_key_press( browser, NS_KEY_LEFT )) return;
[self scrollHorizontal: -[[self enclosingScrollView] horizontalLineScroll]];
}

- (void) moveRight: (id)sender;
{
- if (browser_window_key_press( browser, KEY_RIGHT )) return;
+ if (browser_window_key_press( browser, NS_KEY_RIGHT )) return;
[self scrollHorizontal: [[self enclosingScrollView] horizontalLineScroll]];
}

- (void) moveUp: (id)sender;
{
- if (browser_window_key_press( browser, KEY_UP )) return;
+ if (browser_window_key_press( browser, NS_KEY_UP )) return;
[self scrollVertical: -[[self enclosingScrollView] lineScroll]];
}

- (void) moveDown: (id)sender;
{
- if (browser_window_key_press( browser, KEY_DOWN )) return;
+ if (browser_window_key_press( browser, NS_KEY_DOWN )) return;
[self scrollVertical: [[self enclosingScrollView] lineScroll]];
}

- (void) deleteBackward: (id)sender;
{
- if (!browser_window_key_press( browser, KEY_DELETE_LEFT )) {
+ if (!browser_window_key_press( browser, NS_KEY_DELETE_LEFT )) {
[NSApp sendAction: @selector( goBack: ) to: nil from: self];
}
}

- (void) deleteForward: (id)sender;
{
- browser_window_key_press( browser, KEY_DELETE_RIGHT );
+ browser_window_key_press( browser, NS_KEY_DELETE_RIGHT );
}

- (void) cancelOperation: (id)sender;
{
- browser_window_key_press( browser, KEY_ESCAPE );
+ browser_window_key_press( browser, NS_KEY_ESCAPE );
}

- (void) scrollPageUp: (id)sender;
{
- if (browser_window_key_press( browser, KEY_PAGE_UP )) return;
+ if (browser_window_key_press( browser, NS_KEY_PAGE_UP )) return;
[self scrollVertical: -[self pageScroll]];
}

- (void) scrollPageDown: (id)sender;
{
- if (browser_window_key_press( browser, KEY_PAGE_DOWN )) return;
+ if (browser_window_key_press( browser, NS_KEY_PAGE_DOWN )) return;
[self scrollVertical: [self pageScroll]];
}

- (void) insertTab: (id)sender;
{
- browser_window_key_press( browser, KEY_TAB );
+ browser_window_key_press( browser, NS_KEY_TAB );
}

- (void) insertBacktab: (id)sender;
{
- browser_window_key_press( browser, KEY_SHIFT_TAB );
+ browser_window_key_press( browser, NS_KEY_SHIFT_TAB );
}

- (void) moveToBeginningOfLine: (id)sender;
{
- browser_window_key_press( browser, KEY_LINE_START );
+ browser_window_key_press( browser, NS_KEY_LINE_START );
}

- (void) moveToEndOfLine: (id)sender;
{
- browser_window_key_press( browser, KEY_LINE_END );
+ browser_window_key_press( browser, NS_KEY_LINE_END );
}

- (void) moveToBeginningOfDocument: (id)sender;
{
- if (browser_window_key_press( browser, KEY_TEXT_START )) return;
+ if (browser_window_key_press( browser, NS_KEY_TEXT_START )) return;
}

- (void) scrollToBeginningOfDocument: (id) sender;
@@ -396,7 +396,7 @@ static browser_mouse_state cocoa_mouse_flags_for_event( NSEvent *evt )

- (void) moveToEndOfDocument: (id)sender;
{
- browser_window_key_press( browser, KEY_TEXT_END );
+ browser_window_key_press( browser, NS_KEY_TEXT_END );
}

- (void) scrollToEndOfDocument: (id) sender;
@@ -408,27 +408,27 @@ static browser_mouse_state cocoa_mouse_flags_for_event( NSEvent *evt )

- (void) insertNewline: (id)sender;
{
- browser_window_key_press( browser, KEY_NL );
+ browser_window_key_press( browser, NS_KEY_NL );
}

- (void) selectAll: (id)sender;
{
- browser_window_key_press( browser, KEY_SELECT_ALL );
+ browser_window_key_press( browser, NS_KEY_SELECT_ALL );
}

- (void) copy: (id) sender;
{
- browser_window_key_press( browser, KEY_COPY_SELECTION );
+ browser_window_key_press( browser, NS_KEY_COPY_SELECTION );
}

- (void) cut: (id) sender;
{
- browser_window_key_press( browser, KEY_CUT_SELECTION );
+ browser_window_key_press( browser, NS_KEY_CUT_SELECTION );
}

- (void) paste: (id) sender;
{
- browser_window_key_press( browser, KEY_PASTE );
+ browser_window_key_press( browser, NS_KEY_PASTE );
}

- (BOOL) acceptsFirstResponder;
diff --git a/cocoa/TreeView.m b/cocoa/TreeView.m
index ec6f1d5..cabd4e9 100644
--- a/cocoa/TreeView.m
+++ b/cocoa/TreeView.m
@@ -121,102 +121,102 @@

- (void) moveLeft: (id)sender;
{
- [tree keyPress: KEY_LEFT];
+ [tree keyPress: NS_KEY_LEFT];
}

- (void) moveRight: (id)sender;
{
- [tree keyPress: KEY_RIGHT];
+ [tree keyPress: NS_KEY_RIGHT];
}

- (void) moveUp: (id)sender;
{
- [tree keyPress: KEY_UP];
+ [tree keyPress: NS_KEY_UP];
}

- (void) moveDown: (id)sender;
{
- [tree keyPress: KEY_DOWN];
+ [tree keyPress: NS_KEY_DOWN];
}

- (void) deleteBackward: (id)sender;
{
- [tree keyPress: KEY_DELETE_LEFT];
+ [tree keyPress: NS_KEY_DELETE_LEFT];
}

- (void) deleteForward: (id)sender;
{
- [tree keyPress: KEY_DELETE_RIGHT];
+ [tree keyPress: NS_KEY_DELETE_RIGHT];
}

- (void) cancelOperation: (id)sender;
{
- [tree keyPress: KEY_ESCAPE];
+ [tree keyPress: NS_KEY_ESCAPE];
}

- (void) scrollPageUp: (id)sender;
{
- [tree keyPress: KEY_PAGE_UP];
+ [tree keyPress: NS_KEY_PAGE_UP];
}

- (void) scrollPageDown: (id)sender;
{
- [tree keyPress: KEY_PAGE_DOWN];
+ [tree keyPress: NS_KEY_PAGE_DOWN];
}

- (void) insertTab: (id)sender;
{
- [tree keyPress: KEY_TAB];
+ [tree keyPress: NS_KEY_TAB];
}

- (void) insertBacktab: (id)sender;
{
- [tree keyPress: KEY_SHIFT_TAB];
+ [tree keyPress: NS_KEY_SHIFT_TAB];
}

- (void) moveToBeginningOfLine: (id)sender;
{
- [tree keyPress: KEY_LINE_START];
+ [tree keyPress: NS_KEY_LINE_START];
}

- (void) moveToEndOfLine: (id)sender;
{
- [tree keyPress: KEY_LINE_END];
+ [tree keyPress: NS_KEY_LINE_END];
}

- (void) moveToBeginningOfDocument: (id)sender;
{
- [tree keyPress: KEY_TEXT_START];
+ [tree keyPress: NS_KEY_TEXT_START];
}

- (void) moveToEndOfDocument: (id)sender;
{
- [tree keyPress: KEY_TEXT_END];
+ [tree keyPress: NS_KEY_TEXT_END];
}

- (void) insertNewline: (id)sender;
{
- [tree keyPress: KEY_NL];
+ [tree keyPress: NS_KEY_NL];
}

- (void) selectAll: (id)sender;
{
- [tree keyPress: KEY_SELECT_ALL];
+ [tree keyPress: NS_KEY_SELECT_ALL];
}

- (void) copy: (id) sender;
{
- [tree keyPress: KEY_COPY_SELECTION];
+ [tree keyPress: NS_KEY_COPY_SELECTION];
}

- (void) cut: (id) sender;
{
- [tree keyPress: KEY_CUT_SELECTION];
+ [tree keyPress: NS_KEY_CUT_SELECTION];
}

- (void) paste: (id) sender;
{
- [tree keyPress: KEY_PASTE];
+ [tree keyPress: NS_KEY_PASTE];
}

//MARK: -
diff --git a/desktop/textarea.c b/desktop/textarea.c
index 573da1d..d2b5a28 100644
--- a/desktop/textarea.c
+++ b/desktop/textarea.c
@@ -2448,10 +2448,10 @@ bool textarea_keypress(struct textarea *ta, uint32_t key)
caret += byte_delta;

} else switch (key) {
- case KEY_SELECT_ALL:
+ case NS_KEY_SELECT_ALL:
textarea_select(ta, 0, ta->show->len - 1, true);
return true;
- case KEY_COPY_SELECTION:
+ case NS_KEY_COPY_SELECTION:
if (ta->sel_start != -1) {
if (!textarea_replace_text(ta,
ta->sel_start, ta->sel_end,
@@ -2459,7 +2459,7 @@ bool textarea_keypress(struct textarea *ta, uint32_t key)
return false;
}
break;
- case KEY_DELETE_LEFT:
+ case NS_KEY_DELETE_LEFT:
if (readonly)
break;
if (ta->sel_start != -1) {
@@ -2480,7 +2480,7 @@ bool textarea_keypress(struct textarea *ta, uint32_t key)
}
caret += byte_delta;
break;
- case KEY_DELETE_RIGHT:
+ case NS_KEY_DELETE_RIGHT:
if (readonly)
break;
if (ta->sel_start != -1) {
@@ -2503,8 +2503,8 @@ bool textarea_keypress(struct textarea *ta, uint32_t key)
}
caret += byte_delta;
break;
- case KEY_CR:
- case KEY_NL:
+ case NS_KEY_CR:
+ case NS_KEY_NL:
if (readonly)
break;

@@ -2527,7 +2527,7 @@ bool textarea_keypress(struct textarea *ta, uint32_t key)
}
caret += byte_delta;
break;
- case KEY_PASTE:
+ case NS_KEY_PASTE:
{
char *clipboard = NULL;
size_t clipboard_length;
@@ -2562,7 +2562,7 @@ bool textarea_keypress(struct textarea *ta, uint32_t key)
free(clipboard);
}
break;
- case KEY_CUT_SELECTION:
+ case NS_KEY_CUT_SELECTION:
if (readonly)
break;
if (ta->sel_start != -1) {
@@ -2577,11 +2577,11 @@ bool textarea_keypress(struct textarea *ta, uint32_t key)
textarea_reset_selection(ta);
}
break;
- case KEY_ESCAPE:
- /* Fall through to KEY_CLEAR_SELECTION */
- case KEY_CLEAR_SELECTION:
+ case NS_KEY_ESCAPE:
+ /* Fall through to NS_KEY_CLEAR_SELECTION */
+ case NS_KEY_CLEAR_SELECTION:
return textarea_clear_selection(ta);
- case KEY_LEFT:
+ case NS_KEY_LEFT:
if (readonly)
break;
if (caret > 0)
@@ -2590,7 +2590,7 @@ bool textarea_keypress(struct textarea *ta, uint32_t key)
textarea_clear_selection(ta);
}
break;
- case KEY_RIGHT:
+ case NS_KEY_RIGHT:
if (readonly)
break;
if (caret < ta->show->len - 1)
@@ -2600,7 +2600,7 @@ bool textarea_keypress(struct textarea *ta, uint32_t key)
textarea_clear_selection(ta);
}
break;
- case KEY_UP:
+ case NS_KEY_UP:
if (readonly)
break;
if (ta->sel_start != -1) {
@@ -2620,7 +2620,7 @@ bool textarea_keypress(struct textarea *ta, uint32_t key)
textarea_set_caret_xy(ta, x, y, false);

return true;
- case KEY_DOWN:
+ case NS_KEY_DOWN:
if (readonly)
break;
if (ta->sel_start != -1) {
@@ -2640,7 +2640,7 @@ bool textarea_keypress(struct textarea *ta, uint32_t key)
textarea_set_caret_xy(ta, x, y, false);

return true;
- case KEY_PAGE_UP:
+ case NS_KEY_PAGE_UP:
if (!(ta->flags & TEXTAREA_MULTILINE))
break;
y = ta->vis_height - 2 * ta->border_width -
@@ -2648,7 +2648,7 @@ bool textarea_keypress(struct textarea *ta, uint32_t key)
ta->line_height;
textarea_scroll(ta, 0, -y);
return true;
- case KEY_PAGE_DOWN:
+ case NS_KEY_PAGE_DOWN:
if (!(ta->flags & TEXTAREA_MULTILINE))
break;
y = ta->vis_height - 2 * ta->border_width -
@@ -2656,7 +2656,7 @@ bool textarea_keypress(struct textarea *ta, uint32_t key)
ta->line_height;
textarea_scroll(ta, 0, y);
return true;
- case KEY_LINE_START:
+ case NS_KEY_LINE_START:
if (readonly)
break;
caret -= ta->caret_pos.byte_off;
@@ -2664,7 +2664,7 @@ bool textarea_keypress(struct textarea *ta, uint32_t key)
textarea_clear_selection(ta);
}
break;
- case KEY_LINE_END:
+ case NS_KEY_LINE_END:
if (readonly)
break;

@@ -2679,7 +2679,7 @@ bool textarea_keypress(struct textarea *ta, uint32_t key)
textarea_clear_selection(ta);
}
break;
- case KEY_TEXT_START:
+ case NS_KEY_TEXT_START:
if (readonly)
break;
caret = 0;
@@ -2687,7 +2687,7 @@ bool textarea_keypress(struct textarea *ta, uint32_t key)
textarea_clear_selection(ta);
}
break;
- case KEY_TEXT_END:
+ case NS_KEY_TEXT_END:
if (readonly)
break;
caret = ta->show->len - 1;
@@ -2695,7 +2695,7 @@ bool textarea_keypress(struct textarea *ta, uint32_t key)
textarea_clear_selection(ta);
}
break;
- case KEY_WORD_LEFT:
+ case NS_KEY_WORD_LEFT:
if (readonly)
break;
if (caret == 0)
@@ -2715,7 +2715,7 @@ bool textarea_keypress(struct textarea *ta, uint32_t key)
textarea_clear_selection(ta);
}
break;
- case KEY_WORD_RIGHT:
+ case NS_KEY_WORD_RIGHT:
if (readonly)
break;
if (strchr(sep, ta->show->data[caret]) != NULL &&
@@ -2738,7 +2738,7 @@ bool textarea_keypress(struct textarea *ta, uint32_t key)
textarea_clear_selection(ta);
}
break;
- case KEY_DELETE_LINE:
+ case NS_KEY_DELETE_LINE:
if (readonly)
break;
if (ta->sel_start != -1) {
@@ -2771,7 +2771,7 @@ bool textarea_keypress(struct textarea *ta, uint32_t key)
}
caret += byte_delta;
break;
- case KEY_DELETE_LINE_END:
+ case NS_KEY_DELETE_LINE_END:
if (readonly)
break;
if (ta->sel_start != -1) {
@@ -2793,7 +2793,7 @@ bool textarea_keypress(struct textarea *ta, uint32_t key)
}
caret += byte_delta;
break;
- case KEY_DELETE_LINE_START:
+ case NS_KEY_DELETE_LINE_START:
if (readonly)
break;
if (ta->sel_start != -1) {
@@ -2814,7 +2814,7 @@ bool textarea_keypress(struct textarea *ta, uint32_t key)
}
caret += byte_delta;
break;
- case KEY_UNDO:
+ case NS_KEY_UNDO:
if (!textarea_undo(ta, false, &caret, &r)) {
/* We consume the UNDO, even if we can't act
* on it. */
@@ -2825,7 +2825,7 @@ bool textarea_keypress(struct textarea *ta, uint32_t key)
}
redraw = true;
break;
- case KEY_REDO:
+ case NS_KEY_REDO:
if (!textarea_undo(ta, true, &caret, &r)) {
/* We consume the REDO, even if we can't act
* on it. */
diff --git a/desktop/textinput.h b/desktop/textinput.h
index 123bf5d..a1dce97 100644
--- a/desktop/textinput.h
+++ b/desktop/textinput.h
@@ -30,44 +30,44 @@ struct browser_window;

enum input_key {

- KEY_SELECT_ALL = 1,
- KEY_COPY_SELECTION = 3,
+ NS_KEY_SELECT_ALL = 1,
+ NS_KEY_COPY_SELECTION = 3,

- KEY_DELETE_LEFT = 8,
- KEY_TAB = 9,
+ NS_KEY_DELETE_LEFT = 8,
+ NS_KEY_TAB = 9,

- KEY_NL = 10,
- KEY_SHIFT_TAB = 11,
- KEY_CR = 13,
+ NS_KEY_NL = 10,
+ NS_KEY_SHIFT_TAB = 11,
+ NS_KEY_CR = 13,

- KEY_DELETE_LINE = 21,
- KEY_PASTE = 22,
- KEY_CUT_SELECTION = 24,
- KEY_CLEAR_SELECTION = 26,
+ NS_KEY_DELETE_LINE = 21,
+ NS_KEY_PASTE = 22,
+ NS_KEY_CUT_SELECTION = 24,
+ NS_KEY_CLEAR_SELECTION = 26,

- KEY_ESCAPE = 27,
+ NS_KEY_ESCAPE = 27,

/* cursor movement keys */
- KEY_LEFT = 28,
- KEY_RIGHT,
- KEY_UP,
- KEY_DOWN,
-
- KEY_DELETE_RIGHT = 127,
-
- KEY_LINE_START = 128,
- KEY_LINE_END,
- KEY_TEXT_START,
- KEY_TEXT_END,
- KEY_WORD_LEFT,
- KEY_WORD_RIGHT,
- KEY_PAGE_UP,
- KEY_PAGE_DOWN,
- KEY_DELETE_LINE_END,
- KEY_DELETE_LINE_START,
-
- KEY_UNDO,
- KEY_REDO
+ NS_KEY_LEFT = 28,
+ NS_KEY_RIGHT,
+ NS_KEY_UP,
+ NS_KEY_DOWN,
+
+ NS_KEY_DELETE_RIGHT = 127,
+
+ NS_KEY_LINE_START = 128,
+ NS_KEY_LINE_END,
+ NS_KEY_TEXT_START,
+ NS_KEY_TEXT_END,
+ NS_KEY_WORD_LEFT,
+ NS_KEY_WORD_RIGHT,
+ NS_KEY_PAGE_UP,
+ NS_KEY_PAGE_DOWN,
+ NS_KEY_DELETE_LINE_END,
+ NS_KEY_DELETE_LINE_START,
+
+ NS_KEY_UNDO,
+ NS_KEY_REDO
};


diff --git a/desktop/treeview.c b/desktop/treeview.c
index 89abfb2..65a36d7 100644
--- a/desktop/treeview.c
+++ b/desktop/treeview.c
@@ -2663,7 +2663,7 @@ static bool treeview_keyboard_navigation(treeview *tree, uint32_t key,
redraw = treeview_clear_selection(tree, rect);

switch (key) {
- case KEY_LEFT:
+ case NS_KEY_LEFT:
if (ns.curr != NULL &&
ns.curr->parent != NULL &&
ns.curr->parent->type != TREE_NODE_ROOT) {
@@ -2676,7 +2676,7 @@ static bool treeview_keyboard_navigation(treeview *tree, uint32_t key,
}
break;

- case KEY_RIGHT:
+ case NS_KEY_RIGHT:
if (ns.curr != NULL) {
if (!(ns.curr->flags & TV_NFLAGS_EXPANDED)) {
/* Toggle node to expanded */
@@ -2702,14 +2702,14 @@ static bool treeview_keyboard_navigation(treeview *tree, uint32_t key,
}
break;

- case KEY_UP:
+ case NS_KEY_UP:
if (ns.prev != NULL) {
/* Step to previous node */
ns.prev->flags |= TV_NFLAGS_SELECTED;
}
break;

- case KEY_DOWN:
+ case NS_KEY_DOWN:
if (ns.next != NULL) {
/* Step to next node */
ns.next->flags |= TV_NFLAGS_SELECTED;
@@ -2745,11 +2745,11 @@ bool treeview_keypress(treeview *tree, uint32_t key)
/* Pass to textarea, if editing in progress */
if (tree->edit.textarea != NULL) {
switch (key) {
- case KEY_ESCAPE:
+ case NS_KEY_ESCAPE:
treeview_edit_cancel(tree, true);
return true;
- case KEY_NL:
- case KEY_CR:
+ case NS_KEY_NL:
+ case NS_KEY_CR:
treeview_edit_done(tree);
return true;
default:
@@ -2759,14 +2759,14 @@ bool treeview_keypress(treeview *tree, uint32_t key)

/* Keypress to be handled by treeview */
switch (key) {
- case KEY_SELECT_ALL:
+ case NS_KEY_SELECT_ALL:
redraw = treeview_select_all(tree, &r);
break;
- case KEY_COPY_SELECTION:
+ case NS_KEY_COPY_SELECTION:
treeview_copy_selection(tree);
break;
- case KEY_DELETE_LEFT:
- case KEY_DELETE_RIGHT:
+ case NS_KEY_DELETE_LEFT:
+ case NS_KEY_DELETE_RIGHT:
redraw = treeview_delete_selection(tree, &r);

if (tree->flags & TREEVIEW_DEL_EMPTY_DIRS) {
@@ -2782,18 +2782,18 @@ bool treeview_keypress(treeview *tree, uint32_t key)
}
}
break;
- case KEY_CR:
- case KEY_NL:
+ case NS_KEY_CR:
+ case NS_KEY_NL:
treeview_launch_selection(tree);
break;
- case KEY_ESCAPE:
- case KEY_CLEAR_SELECTION:
+ case NS_KEY_ESCAPE:
+ case NS_KEY_CLEAR_SELECTION:
redraw = treeview_clear_selection(tree, &r);
break;
- case KEY_LEFT:
- case KEY_RIGHT:
- case KEY_UP:
- case KEY_DOWN:
+ case NS_KEY_LEFT:
+ case NS_KEY_RIGHT:
+ case NS_KEY_UP:
+ case NS_KEY_DOWN:
redraw = treeview_keyboard_navigation(tree, key, &r);
break;
default:
diff --git a/framebuffer/fbtk/event.c b/framebuffer/fbtk/event.c
index 5fffb16..58a5391 100644
--- a/framebuffer/fbtk/event.c
+++ b/framebuffer/fbtk/event.c
@@ -314,27 +314,27 @@ fbtk_keycode_to_ucs4(int code, fbtk_modifier_type mods)
} else if (mods & FBTK_MOD_LCTRL || mods & FBTK_MOD_RCTRL) {
switch (code) {
case NSFB_KEY_a:
- ucs4 = KEY_SELECT_ALL;
+ ucs4 = NS_KEY_SELECT_ALL;
break;

case NSFB_KEY_c:
- ucs4 = KEY_COPY_SELECTION;
+ ucs4 = NS_KEY_COPY_SELECTION;
break;

case NSFB_KEY_u:
- ucs4 = KEY_DELETE_LINE;
+ ucs4 = NS_KEY_DELETE_LINE;
break;

case NSFB_KEY_v:
- ucs4 = KEY_PASTE;
+ ucs4 = NS_KEY_PASTE;
break;

case NSFB_KEY_x:
- ucs4 = KEY_CUT_SELECTION;
+ ucs4 = NS_KEY_CUT_SELECTION;
break;

case NSFB_KEY_z:
- ucs4 = KEY_CLEAR_SELECTION;
+ ucs4 = NS_KEY_CLEAR_SELECTION;
break;
default:
break;
diff --git a/framebuffer/gui.c b/framebuffer/gui.c
index fab655e..31ff2b7 100644
--- a/framebuffer/gui.c
+++ b/framebuffer/gui.c
@@ -821,19 +821,19 @@ fb_browser_window_input(fbtk_widget_t *widget, fbtk_callback_info *cbi)
switch (cbi->event->value.keycode) {

case NSFB_KEY_DELETE:
- browser_window_key_press(gw->bw, KEY_DELETE_RIGHT);
+ browser_window_key_press(gw->bw, NS_KEY_DELETE_RIGHT);
break;

case NSFB_KEY_PAGEUP:
if (browser_window_key_press(gw->bw,
- KEY_PAGE_UP) == false)
+ NS_KEY_PAGE_UP) == false)
widget_scroll_y(gw, -fbtk_get_height(
gw->browser), false);
break;

case NSFB_KEY_PAGEDOWN:
if (browser_window_key_press(gw->bw,
- KEY_PAGE_DOWN) == false)
+ NS_KEY_PAGE_DOWN) == false)
widget_scroll_y(gw, fbtk_get_height(
gw->browser), false);
break;
@@ -843,21 +843,21 @@ fb_browser_window_input(fbtk_widget_t *widget, fbtk_callback_info *cbi)
modifier & FBTK_MOD_LCTRL) {
/* CTRL held */
if (browser_window_key_press(gw->bw,
- KEY_LINE_END) == false)
+ NS_KEY_LINE_END) == false)
widget_scroll_x(gw, INT_MAX, true);

} else if (modifier & FBTK_MOD_RSHIFT ||
modifier & FBTK_MOD_LSHIFT) {
/* SHIFT held */
if (browser_window_key_press(gw->bw,
- KEY_WORD_RIGHT) == false)
+ NS_KEY_WORD_RIGHT) == false)
widget_scroll_x(gw, fbtk_get_width(
gw->browser), false);

} else {
/* no modifier */
if (browser_window_key_press(gw->bw,
- KEY_RIGHT) == false)
+ NS_KEY_RIGHT) == false)
widget_scroll_x(gw, 100, false);
}
break;
@@ -867,34 +867,34 @@ fb_browser_window_input(fbtk_widget_t *widget, fbtk_callback_info *cbi)
modifier & FBTK_MOD_LCTRL) {
/* CTRL held */
if (browser_window_key_press(gw->bw,
- KEY_LINE_START) == false)
+ NS_KEY_LINE_START) == false)
widget_scroll_x(gw, 0, true);

} else if (modifier & FBTK_MOD_RSHIFT ||
modifier & FBTK_MOD_LSHIFT) {
/* SHIFT held */
if (browser_window_key_press(gw->bw,
- KEY_WORD_LEFT) == false)
+ NS_KEY_WORD_LEFT) == false)
widget_scroll_x(gw, -fbtk_get_width(
gw->browser), false);

} else {
/* no modifier */
if (browser_window_key_press(gw->bw,
- KEY_LEFT) == false)
+ NS_KEY_LEFT) == false)
widget_scroll_x(gw, -100, false);
}
break;

case NSFB_KEY_UP:
if (browser_window_key_press(gw->bw,
- KEY_UP) == false)
+ NS_KEY_UP) == false)
widget_scroll_y(gw, -100, false);
break;

case NSFB_KEY_DOWN:
if (browser_window_key_press(gw->bw,
- KEY_DOWN) == false)
+ NS_KEY_DOWN) == false)
widget_scroll_y(gw, 100, false);
break;

@@ -922,21 +922,21 @@ fb_browser_window_input(fbtk_widget_t *widget, fbtk_callback_info *cbi)
(modifier & FBTK_MOD_RSHIFT ||
modifier & FBTK_MOD_LSHIFT)) {
/* Z pressed with CTRL and SHIFT held */
- browser_window_key_press(gw->bw, KEY_REDO);
+ browser_window_key_press(gw->bw, NS_KEY_REDO);
break;

} else if (cbi->event->value.keycode == NSFB_KEY_z &&
(modifier & FBTK_MOD_RCTRL ||
modifier & FBTK_MOD_LCTRL)) {
/* Z pressed with CTRL held */
- browser_window_key_press(gw->bw, KEY_UNDO);
+ browser_window_key_press(gw->bw, NS_KEY_UNDO);
break;

} else if (cbi->event->value.keycode == NSFB_KEY_y &&
(modifier & FBTK_MOD_RCTRL ||
modifier & FBTK_MOD_LCTRL)) {
/* Y pressed with CTRL held */
- browser_window_key_press(gw->bw, KEY_REDO);
+ browser_window_key_press(gw->bw, NS_KEY_REDO);
break;
}
/* Z or Y pressed but not undo or redo;
diff --git a/gtk/cookies.c b/gtk/cookies.c
index 35470ce..62ae4f7 100644
--- a/gtk/cookies.c
+++ b/gtk/cookies.c
@@ -161,26 +161,26 @@ void nsgtk_cookies_destroy(void)
/* edit menu */
MENUHANDLER(delete_selected)
{
- cookie_manager_keypress(KEY_DELETE_LEFT);
+ cookie_manager_keypress(NS_KEY_DELETE_LEFT);
return TRUE;
}

MENUHANDLER(delete_all)
{
- cookie_manager_keypress(KEY_SELECT_ALL);
- cookie_manager_keypress(KEY_DELETE_LEFT);
+ cookie_manager_keypress(NS_KEY_SELECT_ALL);
+ cookie_manager_keypress(NS_KEY_DELETE_LEFT);
return TRUE;
}

MENUHANDLER(select_all)
{
- cookie_manager_keypress(KEY_SELECT_ALL);
+ cookie_manager_keypress(NS_KEY_SELECT_ALL);
return TRUE;
}

MENUHANDLER(clear_selection)
{
- cookie_manager_keypress(KEY_CLEAR_SELECTION);
+ cookie_manager_keypress(NS_KEY_CLEAR_SELECTION);
return TRUE;
}

diff --git a/gtk/gui.c b/gtk/gui.c
index e652287..e119540 100644
--- a/gtk/gui.c
+++ b/gtk/gui.c
@@ -812,69 +812,69 @@ uint32_t gtk_gui_gdkkey_to_nskey(GdkEventKey *key)
switch (key->keyval) {

case GDK_KEY(Tab):
- return KEY_TAB;
+ return NS_KEY_TAB;

case GDK_KEY(BackSpace):
if (key->state & GDK_SHIFT_MASK)
- return KEY_DELETE_LINE_START;
+ return NS_KEY_DELETE_LINE_START;
else
- return KEY_DELETE_LEFT;
+ return NS_KEY_DELETE_LEFT;
case GDK_KEY(Delete):
if (key->state & GDK_SHIFT_MASK)
- return KEY_DELETE_LINE_END;
+ return NS_KEY_DELETE_LINE_END;
else
- return KEY_DELETE_RIGHT;
+ return NS_KEY_DELETE_RIGHT;
case GDK_KEY(Linefeed): return 13;
case GDK_KEY(Return): return 10;
- case GDK_KEY(Left): return KEY_LEFT;
- case GDK_KEY(Right): return KEY_RIGHT;
- case GDK_KEY(Up): return KEY_UP;
- case GDK_KEY(Down): return KEY_DOWN;
+ case GDK_KEY(Left): return NS_KEY_LEFT;
+ case GDK_KEY(Right): return NS_KEY_RIGHT;
+ case GDK_KEY(Up): return NS_KEY_UP;
+ case GDK_KEY(Down): return NS_KEY_DOWN;
case GDK_KEY(Home):
if (key->state & GDK_CONTROL_MASK)
- return KEY_TEXT_START;
+ return NS_KEY_TEXT_START;
else
- return KEY_LINE_START;
+ return NS_KEY_LINE_START;
case GDK_KEY(End):
if (key->state & GDK_CONTROL_MASK)
- return KEY_TEXT_END;
+ return NS_KEY_TEXT_END;
else
- return KEY_LINE_END;
+ return NS_KEY_LINE_END;
case GDK_KEY(Page_Up):
- return KEY_PAGE_UP;
+ return NS_KEY_PAGE_UP;
case GDK_KEY(Page_Down):
- return KEY_PAGE_DOWN;
+ return NS_KEY_PAGE_DOWN;
case 'a':
if (key->state & GDK_CONTROL_MASK)
- return KEY_SELECT_ALL;
+ return NS_KEY_SELECT_ALL;
return gdk_keyval_to_unicode(key->keyval);
case 'u':
if (key->state & GDK_CONTROL_MASK)
- return KEY_DELETE_LINE;
+ return NS_KEY_DELETE_LINE;
return gdk_keyval_to_unicode(key->keyval);
case 'c':
if (key->state & GDK_CONTROL_MASK)
- return KEY_COPY_SELECTION;
+ return NS_KEY_COPY_SELECTION;
return gdk_keyval_to_unicode(key->keyval);
case 'v':
if (key->state & GDK_CONTROL_MASK)
- return KEY_PASTE;
+ return NS_KEY_PASTE;
return gdk_keyval_to_unicode(key->keyval);
case 'x':
if (key->state & GDK_CONTROL_MASK)
- return KEY_CUT_SELECTION;
+ return NS_KEY_CUT_SELECTION;
return gdk_keyval_to_unicode(key->keyval);
case 'Z':
case 'y':
if (key->state & GDK_CONTROL_MASK)
- return KEY_REDO;
+ return NS_KEY_REDO;
return gdk_keyval_to_unicode(key->keyval);
case 'z':
if (key->state & GDK_CONTROL_MASK)
- return KEY_UNDO;
+ return NS_KEY_UNDO;
return gdk_keyval_to_unicode(key->keyval);
case GDK_KEY(Escape):
- return KEY_ESCAPE;
+ return NS_KEY_ESCAPE;

/* Modifiers - do nothing for now */
case GDK_KEY(Shift_L):
diff --git a/gtk/history.c b/gtk/history.c
index 2cf1438..96209d1 100644
--- a/gtk/history.c
+++ b/gtk/history.c
@@ -197,26 +197,26 @@ MENUHANDLER(export)
/* edit menu */
MENUHANDLER(delete_selected)
{
- global_history_keypress(KEY_DELETE_LEFT);
+ global_history_keypress(NS_KEY_DELETE_LEFT);
return TRUE;
}

MENUHANDLER(delete_all)
{
- global_history_keypress(KEY_SELECT_ALL);
- global_history_keypress(KEY_DELETE_LEFT);
+ global_history_keypress(NS_KEY_SELECT_ALL);
+ global_history_keypress(NS_KEY_DELETE_LEFT);
return TRUE;
}

MENUHANDLER(select_all)
{
- global_history_keypress(KEY_SELECT_ALL);
+ global_history_keypress(NS_KEY_SELECT_ALL);
return TRUE;
}

MENUHANDLER(clear_selection)
{
- global_history_keypress(KEY_CLEAR_SELECTION);
+ global_history_keypress(NS_KEY_CLEAR_SELECTION);
return TRUE;
}

@@ -259,6 +259,6 @@ MENUHANDLER(collapse_addresses)

MENUHANDLER(launch)
{
- global_history_keypress(KEY_CR);
+ global_history_keypress(NS_KEY_CR);
return TRUE;
}
diff --git a/gtk/hotlist.c b/gtk/hotlist.c
index 0c98bd9..d09595a 100644
--- a/gtk/hotlist.c
+++ b/gtk/hotlist.c
@@ -222,19 +222,19 @@ MENUHANDLER(edit_selected)

MENUHANDLER(delete_selected)
{
- hotlist_keypress(KEY_DELETE_LEFT);
+ hotlist_keypress(NS_KEY_DELETE_LEFT);
return TRUE;
}

MENUHANDLER(select_all)
{
- hotlist_keypress(KEY_SELECT_ALL);
+ hotlist_keypress(NS_KEY_SELECT_ALL);
return TRUE;
}

MENUHANDLER(clear_selection)
{
- hotlist_keypress(KEY_CLEAR_SELECTION);
+ hotlist_keypress(NS_KEY_CLEAR_SELECTION);
return TRUE;
}

@@ -277,6 +277,6 @@ MENUHANDLER(collapse_addresses)

MENUHANDLER(launch)
{
- hotlist_keypress(KEY_CR);
+ hotlist_keypress(NS_KEY_CR);
return TRUE;
}
diff --git a/gtk/scaffolding.c b/gtk/scaffolding.c
index 85d6149..cff9630 100644
--- a/gtk/scaffolding.c
+++ b/gtk/scaffolding.c
@@ -1029,7 +1029,7 @@ MULTIHANDLER(cut)
if (GTK_IS_EDITABLE (focused))
gtk_editable_cut_clipboard (GTK_EDITABLE(g->url_bar));
else
- browser_window_key_press(bw, KEY_CUT_SELECTION);
+ browser_window_key_press(bw, NS_KEY_CUT_SELECTION);

return TRUE;
}
@@ -1043,7 +1043,7 @@ MULTIHANDLER(copy)
if (GTK_IS_EDITABLE (focused))
gtk_editable_copy_clipboard(GTK_EDITABLE(g->url_bar));
else
- browser_window_key_press(bw, KEY_COPY_SELECTION);
+ browser_window_key_press(bw, NS_KEY_COPY_SELECTION);

return TRUE;
}
@@ -1057,7 +1057,7 @@ MULTIHANDLER(paste)
if (GTK_IS_EDITABLE (focused))
gtk_editable_paste_clipboard (GTK_EDITABLE (focused));
else
- browser_window_key_press(bw, KEY_PASTE);
+ browser_window_key_press(bw, NS_KEY_PASTE);

return TRUE;
}
@@ -1083,7 +1083,7 @@ MULTIHANDLER(selectall)
gtk_editable_select_region(GTK_EDITABLE(g->url_bar), 0, -1);
} else {
LOG(("Selecting all document text"));
- browser_window_key_press(bw, KEY_SELECT_ALL);
+ browser_window_key_press(bw, NS_KEY_SELECT_ALL);
}

return TRUE;
diff --git a/render/box_textarea.c b/render/box_textarea.c
index b129f12..bc92f72 100644
--- a/render/box_textarea.c
+++ b/render/box_textarea.c
@@ -43,14 +43,14 @@ bool box_textarea_keypress(html_content *html, struct box *box, uint32_t key)

if (gadget->type != GADGET_TEXTAREA) {
switch (key) {
- case KEY_NL:
- case KEY_CR:
+ case NS_KEY_NL:
+ case NS_KEY_CR:
if (form)
form_submit(content_get_url(c), html->bw,
form, 0);
return true;

- case KEY_TAB:
+ case NS_KEY_TAB:
{
struct form_control *next_input;
/* Find next text entry field that is actually
@@ -71,7 +71,7 @@ bool box_textarea_keypress(html_content *html, struct box *box, uint32_t key)
}
return true;

- case KEY_SHIFT_TAB:
+ case NS_KEY_SHIFT_TAB:
{
struct form_control *prev_input;
/* Find previous text entry field that is actually
diff --git a/render/html_interaction.c b/render/html_interaction.c
index 4d2234f..ebf4d40 100644
--- a/render/html_interaction.c
+++ b/render/html_interaction.c
@@ -1048,19 +1048,19 @@ bool html_keypress(struct content *c, uint32_t key)
}

switch (key) {
- case KEY_COPY_SELECTION:
+ case NS_KEY_COPY_SELECTION:
selection_copy_to_clipboard(sel);
return true;

- case KEY_CLEAR_SELECTION:
+ case NS_KEY_CLEAR_SELECTION:
selection_clear(sel, true);
return true;

- case KEY_SELECT_ALL:
+ case NS_KEY_SELECT_ALL:
selection_select_all(sel);
return true;

- case KEY_ESCAPE:
+ case NS_KEY_ESCAPE:
if (selection_defined(sel)) {
selection_clear(sel, true);
return true;
diff --git a/render/textplain.c b/render/textplain.c
index 9a63da1..19be683 100644
--- a/render/textplain.c
+++ b/render/textplain.c
@@ -743,19 +743,19 @@ bool textplain_keypress(struct content *c, uint32_t key)
struct selection *sel = &text->sel;

switch (key) {
- case KEY_COPY_SELECTION:
+ case NS_KEY_COPY_SELECTION:
selection_copy_to_clipboard(sel);
return true;

- case KEY_CLEAR_SELECTION:
+ case NS_KEY_CLEAR_SELECTION:
selection_clear(sel, true);
return true;

- case KEY_SELECT_ALL:
+ case NS_KEY_SELECT_ALL:
selection_select_all(sel);
return true;

- case KEY_ESCAPE:
+ case NS_KEY_ESCAPE:
if (selection_defined(sel)) {
selection_clear(sel, true);
return true;
diff --git a/riscos/cookies.c b/riscos/cookies.c
index b5e97f7..cd7ada9 100644
--- a/riscos/cookies.c
+++ b/riscos/cookies.c
@@ -190,7 +190,7 @@ void ro_gui_cookies_toolbar_click(button_bar_action action)
{
switch (action) {
case TOOLBAR_BUTTON_DELETE:
- cookie_manager_keypress(KEY_DELETE_LEFT);
+ cookie_manager_keypress(NS_KEY_DELETE_LEFT);
break;

case TOOLBAR_BUTTON_EXPAND:
@@ -329,13 +329,13 @@ bool ro_gui_cookies_menu_select(wimp_w w, wimp_i i, wimp_menu *menu,
cookie_manager_contract(false);
return true;
case TREE_SELECTION_DELETE:
- cookie_manager_keypress(KEY_DELETE_LEFT);
+ cookie_manager_keypress(NS_KEY_DELETE_LEFT);
return true;
case TREE_SELECT_ALL:
- cookie_manager_keypress(KEY_SELECT_ALL);
+ cookie_manager_keypress(NS_KEY_SELECT_ALL);
return true;
case TREE_CLEAR_SELECTION:
- cookie_manager_keypress(KEY_CLEAR_SELECTION);
+ cookie_manager_keypress(NS_KEY_CLEAR_SELECTION);
return true;
case TOOLBAR_BUTTONS:
ro_toolbar_set_display_buttons(cookies_window.toolbar,
diff --git a/riscos/global_history.c b/riscos/global_history.c
index e81d6b0..d46b6b5 100644
--- a/riscos/global_history.c
+++ b/riscos/global_history.c
@@ -199,7 +199,7 @@ void ro_gui_global_history_toolbar_click(button_bar_action action)
{
switch (action) {
case TOOLBAR_BUTTON_DELETE:
- global_history_keypress(KEY_DELETE_LEFT);
+ global_history_keypress(NS_KEY_DELETE_LEFT);
break;

case TOOLBAR_BUTTON_EXPAND:
@@ -219,7 +219,7 @@ void ro_gui_global_history_toolbar_click(button_bar_action action)
break;

case TOOLBAR_BUTTON_LAUNCH:
- global_history_keypress(KEY_CR);
+ global_history_keypress(NS_KEY_CR);
break;

default:
@@ -356,16 +356,16 @@ bool ro_gui_global_history_menu_select(wimp_w w, wimp_i i, wimp_menu *menu,
global_history_contract(false);
return true;
case TREE_SELECTION_LAUNCH:
- global_history_keypress(KEY_CR);
+ global_history_keypress(NS_KEY_CR);
return true;
case TREE_SELECTION_DELETE:
- global_history_keypress(KEY_DELETE_LEFT);
+ global_history_keypress(NS_KEY_DELETE_LEFT);
return true;
case TREE_SELECT_ALL:
- global_history_keypress(KEY_SELECT_ALL);
+ global_history_keypress(NS_KEY_SELECT_ALL);
return true;
case TREE_CLEAR_SELECTION:
- global_history_keypress(KEY_CLEAR_SELECTION);
+ global_history_keypress(NS_KEY_CLEAR_SELECTION);
return true;
case TOOLBAR_BUTTONS:
ro_toolbar_set_display_buttons(global_history_window.toolbar,
diff --git a/riscos/hotlist.c b/riscos/hotlist.c
index 00f9196..bf3d62d 100644
--- a/riscos/hotlist.c
+++ b/riscos/hotlist.c
@@ -257,7 +257,7 @@ void ro_gui_hotlist_toolbar_click(button_bar_action action)
{
switch (action) {
case TOOLBAR_BUTTON_DELETE:
- hotlist_keypress(KEY_DELETE_LEFT);
+ hotlist_keypress(NS_KEY_DELETE_LEFT);
ro_toolbar_update_all_hotlists();
break;

@@ -278,7 +278,7 @@ void ro_gui_hotlist_toolbar_click(button_bar_action action)
break;

case TOOLBAR_BUTTON_LAUNCH:
- hotlist_keypress(KEY_CR);
+ hotlist_keypress(NS_KEY_CR);
break;

case TOOLBAR_BUTTON_CREATE:
@@ -425,17 +425,17 @@ bool ro_gui_hotlist_menu_select(wimp_w w, wimp_i i, wimp_menu *menu,
hotlist_edit_selection();
return true;
case TREE_SELECTION_LAUNCH:
- hotlist_keypress(KEY_CR);
+ hotlist_keypress(NS_KEY_CR);
return true;
case TREE_SELECTION_DELETE:
- hotlist_keypress(KEY_DELETE_LEFT);
+ hotlist_keypress(NS_KEY_DELETE_LEFT);
ro_toolbar_update_all_hotlists();
return true;
case TREE_SELECT_ALL:
- hotlist_keypress(KEY_SELECT_ALL);
+ hotlist_keypress(NS_KEY_SELECT_ALL);
return true;
case TREE_CLEAR_SELECTION:
- hotlist_keypress(KEY_CLEAR_SELECTION);
+ hotlist_keypress(NS_KEY_CLEAR_SELECTION);
return true;
case TOOLBAR_BUTTONS:
ro_toolbar_set_display_buttons(hotlist_window.toolbar,
diff --git a/riscos/treeview.c b/riscos/treeview.c
index d33704c..47d94e6 100644
--- a/riscos/treeview.c
+++ b/riscos/treeview.c
@@ -1127,35 +1127,35 @@ static bool ro_treeview_keypress(wimp_key *key)
/* cursor movement keys */
case wimp_KEY_HOME:
case wimp_KEY_CONTROL | wimp_KEY_LEFT:
- c = KEY_LINE_START;
+ c = NS_KEY_LINE_START;
break;
case wimp_KEY_END:
if (os_version >= RISCOS5)
- c = KEY_LINE_END;
+ c = NS_KEY_LINE_END;
else
- c = KEY_DELETE_RIGHT;
+ c = NS_KEY_DELETE_RIGHT;
break;
- case wimp_KEY_CONTROL | wimp_KEY_RIGHT: c = KEY_LINE_END; break;
- case wimp_KEY_CONTROL | wimp_KEY_UP: c = KEY_TEXT_START; break;
- case wimp_KEY_CONTROL | wimp_KEY_DOWN: c = KEY_TEXT_END; break;
- case wimp_KEY_SHIFT | wimp_KEY_LEFT: c = KEY_WORD_LEFT ; break;
- case wimp_KEY_SHIFT | wimp_KEY_RIGHT: c = KEY_WORD_RIGHT; break;
- case wimp_KEY_SHIFT | wimp_KEY_UP: c = KEY_PAGE_UP; break;
- case wimp_KEY_SHIFT | wimp_KEY_DOWN: c = KEY_PAGE_DOWN; break;
- case wimp_KEY_LEFT: c = KEY_LEFT; break;
- case wimp_KEY_RIGHT: c = KEY_RIGHT; break;
- case wimp_KEY_UP: c = KEY_UP; break;
- case wimp_KEY_DOWN: c = KEY_DOWN; break;
+ case wimp_KEY_CONTROL | wimp_KEY_RIGHT: c = NS_KEY_LINE_END; break;
+ case wimp_KEY_CONTROL | wimp_KEY_UP: c = NS_KEY_TEXT_START; break;
+ case wimp_KEY_CONTROL | wimp_KEY_DOWN: c = NS_KEY_TEXT_END; break;
+ case wimp_KEY_SHIFT | wimp_KEY_LEFT: c = NS_KEY_WORD_LEFT ; break;
+ case wimp_KEY_SHIFT | wimp_KEY_RIGHT: c = NS_KEY_WORD_RIGHT; break;
+ case wimp_KEY_SHIFT | wimp_KEY_UP: c = NS_KEY_PAGE_UP; break;
+ case wimp_KEY_SHIFT | wimp_KEY_DOWN: c = NS_KEY_PAGE_DOWN; break;
+ case wimp_KEY_LEFT: c = NS_KEY_LEFT; break;
+ case wimp_KEY_RIGHT: c = NS_KEY_RIGHT; break;
+ case wimp_KEY_UP: c = NS_KEY_UP; break;
+ case wimp_KEY_DOWN: c = NS_KEY_DOWN; break;

/* editing */
case wimp_KEY_CONTROL | wimp_KEY_END:
- c = KEY_DELETE_LINE_END;
+ c = NS_KEY_DELETE_LINE_END;
break;
case wimp_KEY_DELETE:
if (ro_gui_ctrl_pressed())
- c = KEY_DELETE_LINE_START;
+ c = NS_KEY_DELETE_LINE_START;
else if (os_version < RISCOS5)
- c = KEY_DELETE_LEFT;
+ c = NS_KEY_DELETE_LEFT;
break;

default:
diff --git a/riscos/window.c b/riscos/window.c
index 759c0c2..3b82da8 100644
--- a/riscos/window.c
+++ b/riscos/window.c
@@ -1779,42 +1779,42 @@ bool ro_gui_window_keypress(wimp_key *key)
/* cursor movement keys */
case wimp_KEY_HOME:
case wimp_KEY_CONTROL | wimp_KEY_LEFT:
- c = KEY_LINE_START;
+ c = NS_KEY_LINE_START;
break;
case wimp_KEY_END:
if (os_version >= RISCOS5)
- c = KEY_LINE_END;
+ c = NS_KEY_LINE_END;
else
- c = KEY_DELETE_RIGHT;
+ c = NS_KEY_DELETE_RIGHT;
break;
- case wimp_KEY_CONTROL | wimp_KEY_RIGHT: c = KEY_LINE_END; break;
- case wimp_KEY_CONTROL | wimp_KEY_UP: c = KEY_TEXT_START; break;
- case wimp_KEY_CONTROL | wimp_KEY_DOWN: c = KEY_TEXT_END; break;
- case wimp_KEY_SHIFT | wimp_KEY_LEFT: c = KEY_WORD_LEFT ; break;
- case wimp_KEY_SHIFT | wimp_KEY_RIGHT: c = KEY_WORD_RIGHT; break;
- case wimp_KEY_SHIFT | wimp_KEY_UP: c = KEY_PAGE_UP; break;
- case wimp_KEY_SHIFT | wimp_KEY_DOWN: c = KEY_PAGE_DOWN; break;
- case wimp_KEY_LEFT: c = KEY_LEFT; break;
- case wimp_KEY_RIGHT: c = KEY_RIGHT; break;
- case wimp_KEY_UP: c = KEY_UP; break;
- case wimp_KEY_DOWN: c = KEY_DOWN; break;
+ case wimp_KEY_CONTROL | wimp_KEY_RIGHT: c = NS_KEY_LINE_END; break;
+ case wimp_KEY_CONTROL | wimp_KEY_UP: c = NS_KEY_TEXT_START; break;
+ case wimp_KEY_CONTROL | wimp_KEY_DOWN: c = NS_KEY_TEXT_END; break;
+ case wimp_KEY_SHIFT | wimp_KEY_LEFT: c = NS_KEY_WORD_LEFT ; break;
+ case wimp_KEY_SHIFT | wimp_KEY_RIGHT: c = NS_KEY_WORD_RIGHT; break;
+ case wimp_KEY_SHIFT | wimp_KEY_UP: c = NS_KEY_PAGE_UP; break;
+ case wimp_KEY_SHIFT | wimp_KEY_DOWN: c = NS_KEY_PAGE_DOWN; break;
+ case wimp_KEY_LEFT: c = NS_KEY_LEFT; break;
+ case wimp_KEY_RIGHT: c = NS_KEY_RIGHT; break;
+ case wimp_KEY_UP: c = NS_KEY_UP; break;
+ case wimp_KEY_DOWN: c = NS_KEY_DOWN; break;

/* editing */
case wimp_KEY_CONTROL | wimp_KEY_END:
- c = KEY_DELETE_LINE_END;
+ c = NS_KEY_DELETE_LINE_END;
break;
case wimp_KEY_DELETE:
if (ro_gui_ctrl_pressed())
- c = KEY_DELETE_LINE_START;
+ c = NS_KEY_DELETE_LINE_START;
else if (os_version < RISCOS5)
- c = KEY_DELETE_LEFT;
+ c = NS_KEY_DELETE_LEFT;
break;

case wimp_KEY_F8:
- c = KEY_UNDO;
+ c = NS_KEY_UNDO;
break;
case wimp_KEY_F9:
- c = KEY_REDO;
+ c = NS_KEY_REDO;
break;

default:
@@ -2593,7 +2593,7 @@ static void ro_gui_window_paste_cb(void *pw)
{
struct browser_window *bw = pw;

- browser_window_key_press(bw, KEY_PASTE);
+ browser_window_key_press(bw, NS_KEY_PASTE);
}


@@ -2732,8 +2732,8 @@ bool ro_gui_window_menu_select(wimp_w w, wimp_i i, wimp_menu *menu,
break;

case COOKIES_DELETE:
- cookie_manager_keypress(KEY_SELECT_ALL);
- cookie_manager_keypress(KEY_DELETE_LEFT);
+ cookie_manager_keypress(NS_KEY_SELECT_ALL);
+ cookie_manager_keypress(NS_KEY_DELETE_LEFT);
break;

/* page actions */
@@ -2882,19 +2882,19 @@ bool ro_gui_window_menu_select(wimp_w w, wimp_i i, wimp_menu *menu,
}
break;
case BROWSER_SELECTION_COPY:
- browser_window_key_press(bw, KEY_COPY_SELECTION);
+ browser_window_key_press(bw, NS_KEY_COPY_SELECTION);
break;
case BROWSER_SELECTION_CUT:
- browser_window_key_press(bw, KEY_CUT_SELECTION);
+ browser_window_key_press(bw, NS_KEY_CUT_SELECTION);
break;
case BROWSER_SELECTION_PASTE:
ro_gui_selection_prepare_paste(w, ro_gui_window_paste_cb, bw);
break;
case BROWSER_SELECTION_ALL:
- browser_window_key_press(bw, KEY_SELECT_ALL);
+ browser_window_key_press(bw, NS_KEY_SELECT_ALL);
break;
case BROWSER_SELECTION_CLEAR:
- browser_window_key_press(bw, KEY_CLEAR_SELECTION);
+ browser_window_key_press(bw, NS_KEY_CLEAR_SELECTION);
break;

/* navigation actions */
diff --git a/windows/drawable.c b/windows/drawable.c
index 7726d6a..6b708bf 100644
--- a/windows/drawable.c
+++ b/windows/drawable.c
@@ -227,49 +227,49 @@ nsws_drawable_key(struct gui_window *gw, HWND hwnd, WPARAM wparam)

switch(wparam) {
case VK_LEFT:
- i = KEY_LEFT;
+ i = NS_KEY_LEFT;
if (shift)
SendMessage(hwnd, WM_HSCROLL,
MAKELONG(SB_LINELEFT, 0), 0);
break;

case VK_RIGHT:
- i = KEY_RIGHT;
+ i = NS_KEY_RIGHT;
if (shift)
SendMessage(hwnd, WM_HSCROLL,
MAKELONG(SB_LINERIGHT, 0), 0);
break;

case VK_UP:
- i = KEY_UP;
+ i = NS_KEY_UP;
if (shift)
SendMessage(hwnd, WM_VSCROLL,
MAKELONG(SB_LINEUP, 0), 0);
break;

case VK_DOWN:
- i = KEY_DOWN;
+ i = NS_KEY_DOWN;
if (shift)
SendMessage(hwnd, WM_VSCROLL,
MAKELONG(SB_LINEDOWN, 0), 0);
break;

case VK_HOME:
- i = KEY_LINE_START;
+ i = NS_KEY_LINE_START;
if (shift)
SendMessage(hwnd, WM_HSCROLL,
MAKELONG(SB_PAGELEFT, 0), 0);
break;

case VK_END:
- i = KEY_LINE_END;
+ i = NS_KEY_LINE_END;
if (shift)
SendMessage(hwnd, WM_HSCROLL,
MAKELONG(SB_PAGERIGHT, 0), 0);
break;

case VK_DELETE:
- i = KEY_DELETE_RIGHT;
+ i = NS_KEY_DELETE_RIGHT;
break;

case VK_NEXT:
diff --git a/windows/window.c b/windows/window.c
index 3ea2afd..18add45 100644
--- a/windows/window.c
+++ b/windows/window.c
@@ -911,7 +911,7 @@ nsws_window_command(HWND hwnd,
if (GetFocus() == gw->urlbar) {
SendMessage(gw->urlbar, WM_CUT, 0, 0);
} else if (gw->bw != NULL) {
- browser_window_key_press(gw->bw, KEY_CUT_SELECTION);
+ browser_window_key_press(gw->bw, NS_KEY_CUT_SELECTION);
}
break;

@@ -922,7 +922,7 @@ nsws_window_command(HWND hwnd,
if (GetFocus() == gw->urlbar) {
SendMessage(gw->urlbar, WM_COPY, 0, 0);
} else if (gw->bw != NULL) {
- browser_window_key_press(gw->bw, KEY_COPY_SELECTION);
+ browser_window_key_press(gw->bw, NS_KEY_COPY_SELECTION);
}
break;

@@ -938,7 +938,7 @@ nsws_window_command(HWND hwnd,
if (GetFocus() == gw->urlbar)
SendMessage(gw->urlbar, WM_PASTE, 0, 0);
else
- browser_window_key_press(gw->bw, KEY_PASTE);
+ browser_window_key_press(gw->bw, NS_KEY_PASTE);
break;
}

@@ -946,14 +946,14 @@ nsws_window_command(HWND hwnd,
if (GetFocus() == gw->urlbar)
SendMessage(gw->urlbar, WM_CUT, 0, 0);
else
- browser_window_key_press(gw->bw, KEY_DELETE_RIGHT);
+ browser_window_key_press(gw->bw, NS_KEY_DELETE_RIGHT);
break;

case IDM_EDIT_SELECT_ALL:
if (GetFocus() == gw->urlbar)
SendMessage(gw->urlbar, EM_SETSEL, 0, -1);
else
- browser_window_key_press(gw->bw, KEY_SELECT_ALL);
+ browser_window_key_press(gw->bw, NS_KEY_SELECT_ALL);
break;

case IDM_EDIT_SEARCH:
Here is with the NS_ prefix.