edbrowse-dev - development list for edbrowse
 help / color / mirror / Atom feed
* [Edbrowse-dev] Javascript support
@ 2013-12-22 22:26 Karl Dahlke
  2013-12-23  9:26 ` Adam Thompson
  0 siblings, 1 reply; 11+ messages in thread
From: Karl Dahlke @ 2013-12-22 22:26 UTC (permalink / raw)
  To: Edbrowse-dev

Hi Adam and all.
It seems to me you are spot on,
assumingf we want to take a few expedient steps,
rather than a complete rewrite.
When I think about string operations a complete rewrite is really tempting,
but I know that would take to long.
Our friend over at debian is tapping his foot.

At this point I have to pat myself on the back, at least a little,
since my design is based on encapsulation.
I built jsdom.c and jsloc.c as a layer between edbrowse and the js engine,
so that only these files need be touched.
The rest of edbrowse knows nothing about javascript.
So that's a couple thousand lines of code, not prohibitive.

In fact, my original eb.h did not reference jsapi.h or anything javascript at all.
I used void * for blind pointers to pass around js related structures.
So an edbrowse buffer or context structure would contain a member
void *js
for all its javascript stuff, without knowing or caring what it meant.
The semantics were all in js*.c.
But at some point, and I don't remember when or why,

#include <jsapi.h>

was moved out of js*.c and into eb.h, so everyone could see
and possibly muck with the javascript api.
But still I don't think they do, not for the most part.
It just means we can refer to jscontext * instead of void *,
and the code is more readable,
yet still I think it is all encapsulated in js*.c.

The quick way, if there is such a thing,
is to
cp jsdom.c jsdom.C
cp jslod.c jsloc.C
Making the endings capital C instead of small c.
Then call the c++ functions instead of the original functions.
We can do this before the upgrade, since moz185 has the c++ interface.
The new calls will likely return a pointer to an object, not a structure,
but object structure it's all the same.
I can't pass that around amonst the other c functions in edbrowse.
In other words, go back to void * as it was before.
Keep all the js headers and classes in js*.C, as it was before.
Then when you can compile
cc -c js*.C   (that's capital C)
switch the Makefile over to use those files
and not the original js*.c, which we'll keep around for a while
until we know what we're doing.

So the first step might be to see if we canpt put

#include <jsapi.h>

back into jsdom.c and jsloc.c, and out of eb.h as it once was.
Then make files with capital C instead of small c.
gcc does the right thing based on the suffix.
Then access the new api, which is probably not radically different
from the old just creates objects and calls object methods instead of functions.

I might be oversimplifying this terribly, I really don't know.
I have bookmarked the documentation for all the smjs functions,
is this updated to reflect the new c++ interface?

And finally the question is who has time for all this?
I don't know but I hope someone does,
edbrowse is too valuable to die on the vine.
I might, depending on how my life goes,
but the first thing I have to do is learn c++,
which I have religiously avoided for 30 years.
Truly, for 30 years.
Maybe it's time.
But if any of you know c++ better than me, which wouldn't be hard to do,
then you're a step ahead.

Karl Dahlke

^ permalink raw reply	[flat|nested] 11+ messages in thread
* [Edbrowse-dev] Javascript support
@ 2013-12-23 14:29 Karl Dahlke
  0 siblings, 0 replies; 11+ messages in thread
From: Karl Dahlke @ 2013-12-23 14:29 UTC (permalink / raw)
  To: Edbrowse-dev

> Agreed, though I'd probably use cpp as the file suffix
> and provide a js.h to isolate datatypes etc,


Yes to both. I forgot about the cpp suffix.

URLs

This one is out of date, obviously,
but you may be able to back up a directory and find source
for the various versions of sm js.
I use to build from source, before it was routinely bundled
in linux distros.

ftp://ftp.mozilla.org/pub/mozilla.org/js/js-1.5.tar.gz

Documentation on the web here.

http://developer.mozilla.org/en/docs/Category:JSAPI_Reference

But that brings up another question ...
in the short run, just to keep things alive,
what if we built a static library libmoz185.a from its source,
put that binary in the edbrowse project,
and made a linked version of edbrowse with that.
That is not a long term solution, but it might keep debian going for a while.
I would have to ask Jean what he thought of this idea.
Course it would be better to go forward with jsdom.cpp and jsloc.cpp.

Those are new files so you could work on those locally,
and when they are ready for beta test we'll add them to the project.

Other patches that lay the foundation for this work,
such as js.h or changes to eb.h,
should be sent to me and Chris.
eklhad@comcast.net
chris@the-brannons.com
Chris is the maintainer of edbrowse at this time.

Thanks for all your hard work.

Karl Dahlke

^ permalink raw reply	[flat|nested] 11+ messages in thread
* [Edbrowse-dev]  html unicode translations in edbrowse
@ 2013-12-18 18:45 Karl Dahlke
  2013-12-21 18:00 ` [Edbrowse-dev] Javascript support MENGUAL Jean-Philippe
  0 siblings, 1 reply; 11+ messages in thread
From: Karl Dahlke @ 2013-12-18 18:45 UTC (permalink / raw)
  To: Edbrowse-dev

> I use speakup with espeak which seems to handle most things,

As I understand it it works well with 8859-1,
which covers many western languages,
but that would not include the high unicodes,
so yes that would leave you out in the cold regarding
alpha beta gamma and my other math symbols.
And I do appreciate this feedback; that's why I posted.

On the other side, edbrowse renders these according to my taste,
and in english, hard coded,
so some of my French edbrowse users may not be thrilled with the word alpha.
Who knows how that sounds on a french synthesizer.
So there's no clear right answere here;
maybe we'll just leave edbrowse be for a while until we have
a clear plan, or maybe a switch to turn these on or off.

Karl Dahlke

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2014-01-08 12:51 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-12-22 22:26 [Edbrowse-dev] Javascript support Karl Dahlke
2013-12-23  9:26 ` Adam Thompson
2013-12-23 14:26   ` Chris Brannon
2013-12-24  9:25     ` Adam Thompson
  -- strict thread matches above, loose matches on Subject: below --
2013-12-23 14:29 Karl Dahlke
2013-12-18 18:45 [Edbrowse-dev] html unicode translations in edbrowse Karl Dahlke
2013-12-21 18:00 ` [Edbrowse-dev] Javascript support MENGUAL Jean-Philippe
2013-12-22 15:42   ` Chris Brannon
2013-12-22 16:48     ` Adam Thompson
2013-12-22 18:36       ` Chris Brannon
2013-12-22 19:10         ` Adam Thompson
2014-01-08 12:50   ` Adam Thompson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).