#1 2014-06-16 01:22:59

win2014
Member
Registered: 2014-06-10
Posts: 31

How to register a delphi class to SynSM?

Is there any demo about that?
I had look for this, but found nothing.

Offline

#2 2014-06-16 08:33:38

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,660
Website

Re: How to register a delphi class to SynSM?

What do you call "register a Delphi class"?
Access a TObject properties and methods from JavaScript?

Offline

#3 2014-06-16 09:06:35

win2014
Member
Registered: 2014-06-10
Posts: 31

Re: How to register a delphi class to SynSM?

e.g. I defines a type TMyClass = class; in delphi code, then I want use this type in js:
var mycl = new TMyClass();
In delphi-javascript wrap, it could be very easy.

Offline

#4 2014-06-16 18:27:11

tueddy
Member
Registered: 2010-08-03
Posts: 11

Re: How to register a delphi class to SynSM?

Using a delphi class from JavaScript via RTTI would be very helpful!
e.g. i have a delphi class like this:

type
  TApp = class
  public
    procedure alert(msg: string);
  end;

and can call this class like this:

  app.alert('hello world');

This can be done with previous implementations like
http://delphi-javascript.googlecode.com/svn/trunk

vote +1!

Best regards
Dirk

Offline

#5 2014-06-16 19:16:10

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,660
Website

Re: How to register a delphi class to SynSM?

This would need the enhanced RTTI, so would work only with Delphi 2010 and up.

Offline

#6 2014-06-19 07:33:58

edwinsn
Member
Registered: 2010-07-02
Posts: 1,218

Re: How to register a delphi class to SynSM?

ab wrote:

This would need the enhanced RTTI, so would work only with Delphi 2010 and up.

Arnaud, I'm not sure, but from the past discussions I remember mpv had such a plan, or has this feature (as demonstrated by tueddy above) been implemented?


Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.

Offline

#7 2014-06-19 07:44:25

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,660
Website

Re: How to register a delphi class to SynSM?

I did not have news from mpv since weeks.
Hope everything is OK in his part of Ukraine.

There is indeed some custom JavaScript virtual object, ready to access Delphi class properties and methods.
But it is not tested nor fully integrated yet.

Offline

#8 2014-06-19 08:14:34

edwinsn
Member
Registered: 2010-07-02
Posts: 1,218

Re: How to register a delphi class to SynSM?

ab, I wish mpv is well. Has the .dll source code of mozjs-24.dll wrapper been published yet? If we don't have that, we'll be stuck.


Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.

Offline

#9 2014-06-19 08:20:02

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,660
Website

Re: How to register a delphi class to SynSM?

No, sadly we did not have the source code of the dll yet.

Offline

#10 2014-06-19 10:28:06

edwinsn
Member
Registered: 2010-07-02
Posts: 1,218

Re: How to register a delphi class to SynSM?

I wish mpv will see this discussion and will reply.


Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.

Offline

#11 2014-07-03 10:07:00

mpv
Member
From: Ukraine
Registered: 2012-03-24
Posts: 1,571
Website

Re: How to register a delphi class to SynSM?

@edwinsn - we prepare all patches and build instruction for SpiderMonkey - I send sources to AB.
@tueddy & win2014 - Yes, we add ability to share Delphi classes with SpiderMonkey. For my main product (commercial) we already done this year ago and now we migrate this part of sources to the Syn*. The main problem is support of both "old" RTTI and new RTTI. I think we solve it in a month.
Our implementation is much speed-efficient compared to http://delphi-javascript.googlecode.com/svn/trunk

Offline

#12 2014-07-03 10:31:38

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,660
Website

Re: How to register a delphi class to SynSM?

Nice hearing back from you, mpv!
smile

We are waiting for your input!
Thanks for sharing.

Offline

#13 2014-07-07 09:58:53

tueddy
Member
Registered: 2010-08-03
Posts: 11

Re: How to register a delphi class to SynSM?

Hi mvp,

thanks for information! Looking forward,
Best regards
tueddy

Offline

#14 2014-07-12 06:00:05

win2014
Member
Registered: 2014-06-10
Posts: 31

Re: How to register a delphi class to SynSM?

mpv wrote:

@edwinsn - we prepare all patches and build instruction for SpiderMonkey - I send sources to AB.
@tueddy & win2014 - Yes, we add ability to share Delphi classes with SpiderMonkey. For my main product (commercial) we already done this year ago and now we migrate this part of sources to the Syn*. The main problem is support of both "old" RTTI and new RTTI. I think we solve it in a month.
Our implementation is much speed-efficient compared to http://delphi-javascript.googlecode.com/svn/trunk

Seems good news! Exciting!
I write some "processor-oriented" code fix my question, even they looks ugly, but works.

Offline

Board footer

Powered by FluxBB