Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperLicht
CopperLicht + GWT

rox
Registered User
Quote
2010-08-02 14:29:03

It would be nice to use copperlicht in GWT, wouldnt it? For that we need to make wrapper classes for each copperlicht. I made script that uses copperlicht documentation to generate most of required stuff.

Note that hand tuning is still needed since documentation does not contain all required information. Would be great if devs would be willing to add some more info like variable types, so with minor modification script could be adjusted to generate complete gwt wrapper for copperlicht each time new version comes out.

CopperLicht class processed by script: http://roxoft.pastebin.com/XjTagcXL
PHP script: http://roxoft.pastebin.com/MLWjFn0D

For devs:
would it be possible to have method definitions in docs like:
CopperLicht(/*String*/ elementIdOfCanvas, /*Boolean*/ showInfoTexts, /*int*/ fps)
instead of:
CopperLicht(elementIdOfCanvas, showInfoTexts, fps)

and field definitions like:
/*Function*/ OnAfterDrawAll
instead of just:
OnAfterDrawAll


This is only idea that came to my mind.. and it would easily bring gwt port to copperlicht.. or maybe you have any ideas? maybe generating initial wrappers, hand-fixing them and later on maintaining them would be an option.. idk. any thoughts?




2010-08-04 update:
I improved script greatly. Code was cleaned up and much fixes added. Now all classes are processed and no syntax errors produced. With minor modifications of produced wrappers you can already run simple demo.

script: http://roxoft.pastebin.com/gK7VG...
test project with wrapper classes: http://roxaz.ivory-tower.de/publ...
🔎︎



niko
Moderator
Quote
2010-08-02 16:50:34

Wow, interesting. I'll see what I can do into that direction at the next release.


rox
Registered User
Quote
2010-08-04 11:45:32

well finally i can run simple demo made with GWT :] see first post for more info


on the other hand GWT is real pain in the rear end. subclassing is not possible afaik, and whats the use of library whose classes can not be subclassed? :| i have no idea how to solve this one..


hao1300
Guest
Quote
2010-08-13 17:24:45

wrote:
well finally i can run simple demo made with GWT :] see first post for more info


on the other hand GWT is real pain in the rear end. subclassing is not possible afaik, and whats the use of library whose classes can not be subclassed? :| i have no idea how to solve this one..


Subclassing in GWT is possible, you just have to make the methods final (you can't override that method in your subclass, nor would you need to if you are simply wrapping javascript code.)

I thought about your approach before, but I wasn't quite ready to commit myself to manually typing in the type for each method (tried this approach on the WebGL specification before and now it is quite difficult to maintain automatically... Please enlighten us if you can somehow figure out how to generate the types automatically!


rox
Registered User
Quote
2010-08-25 19:06:40

i mentioned in first post the lack of info... devs must put type info into documentation at least...

thing about subclassing is that sometimes we need method overriding that can not be done. say we have class Animator and AnimatorAnimateTexture. They both implement their own animateNode(n, timeMs) and AnimatorAnimateTexture cant have that method due to restrictions.

anyway few days ago i got an idea how to overcome limitations. idea is to make two sets of wrapper classes. first set would be so called native classes that invoke javascript code. they would not do any subclassing at all. while this set would be usable - it would not provide accurate information in code completion. for that 2nd set of wrapper classes should be made. classes would inherit each other and call functions from 1st set of wrapper classes. this way goal would be achieved, however each call would perform 2 calls if gwt compiler does not do this kind of optimizations.. about optimizations i dont know..

maybe anyone has better ideas?


bartolomiew
Registered User
Quote
2011-10-31 14:44:49

Hi all,
Anyone have downloaded the test project with wrapper classes mentioned in the first post ? The link is dead.
Or maybe I've missed something about GWT wrapper for Copperlicht ?

Thank you in advance


niko
Moderator
Quote
2011-11-01 02:10:56

I think this was just a temporary test project. All you can do is either hope the original author sees this thread or write something like this yourself.


bartolomiew
Registered User
Quote
2011-11-01 08:17:20

Thank you, I followed your advice and I developed my own wrapper.
The hardest part is starting.
I managed to wrap the tutorial 'Hello World', inspired by the project RaphaelGWT http://code.google.com/p/raphael...


tito100
Registered User
Quote
2013-06-24 23:05:54

Hi all.

Im made full port to gwt . All tutorials is worked.

http://copperlicht.mostka.com/

enjoy.


niko
Moderator
Quote
2013-06-26 08:30:33

Woha, that's very cool. :)


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "?nternational" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact