Skip to main content

phoneME advanced where to attach the native Qt window

10 replies [Last post]
sharmarajesh
Offline
Joined: 2007-07-04

Hi All
I am trying to find how to attach the native Qt window in java environment and from where to update this window in java .

I created a native window from java methods but it is not displaying anything

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
fabio_bernardo
Offline
Joined: 2010-12-06

Hi, I'm trying to write a Xlet which use the phoneMe advanced and I have a little problem with the graphic, because I want to set the size of the container of the phoneme advanced to 1280x720 but every time I set the size, nothing change.

I'm using QT like graphic toolkit.

Could someone help me?

sharmarajesh
Offline
Joined: 2007-07-04

Hi Hinkmond,
I am facing problem in event handling. When i click a Button in DemoFrame. All the the information about the event are passed correctly in java through callVoidMethod(). But no action is taken place in demo frame i.e. no event is originated the event for displaying the demo frame is happened correctly but the event like mouse button pressed, released etc are not working. can you help me how can i found where the exact problem is.

Thanks in advance for the help

Regards,

Rajesh Sharma

Hinkmond Wong

phonemeadvanced@mobileandembedded.org wrote:
> Hi Hinkmond,
> I am facing problem in event handling. When i click a Button in DemoFrame. All the the information about the event are passed correctly in java through callVoidMethod(). But no action is taken place in demo frame i.e. no event is originated the event for displaying the demo frame is happened correctly but the event like mouse button pressed, released etc are not working. can you help me how can i found where the exact problem is.
>
> Thanks in advance for the help
>
>

Is this the same bug as what Lorenzo is reporting?

See:
http://forums.java.net/jive/thread.jspa?messageID=246770

Hinkmond

---------------------------------------------------------------------
To unsubscribe, e-mail: advanced-unsubscribe@phoneme.dev.java.net
For additional commands, e-mail: advanced-help@phoneme.dev.java.net

sharmarajesh
Offline
Joined: 2007-07-04

Hi Hinkmond,
You are very correct, That is the only point where i am little bit confused. I am successfully passed all the data to the native(gtk) side, every demo (graphics,font etc) are correctly displayed on the native side by using gtk_main()) but i am still not be able to understand how can i display the window which created in the PBP by using java without using gtk_main(). I searched this concept in the Qt as well as in microwindow code. still i am not be able to find at what point in java without using gtk_main() how can i display the window.

Thanks in advance for your kind help

Best Regards,

Rajesh Sharma

Hinkmond Wong

phonemeadvanced@mobileandembedded.org wrote:
> Hi Hinkmond,
> You are very correct, That is the only point where i am little bit confused. I am successfully passed all the data to the native(gtk) side, every demo (graphics,font etc) are correctly displayed on the native side by using gtk_main()) but i am still not be able to understand how can i display the window which created in the PBP by using java without using gtk_main(). I searched this concept in the Qt as well as in microwindow code. still i am not be able to find at what point in java without using gtk_main() how can i display the window.
>
>
>

Hi Rajesh,

You might want to check with GTK-specific message boards instead of this
Java-specific message board for better answers to your questions. The
question you are asking is outside the scope of phoneME and instead gets
down into the details of GTK.

You might want to check with this GTK forum instead:

http://www.gtkforums.com/

Hope this helps!

Hinkmond

---------------------------------------------------------------------
To unsubscribe, e-mail: advanced-unsubscribe@phoneme.dev.java.net
For additional commands, e-mail: advanced-help@phoneme.dev.java.net

sharmarajesh
Offline
Joined: 2007-07-04

Hi Hinkmond,

Thanks for reply. That's very helpfull for me. After reading all the three files suggested by you as well as well as the source code of phoneMe advanced many of my doubt are clear except only fews.

1) After calling the paint(g) from Container.java control is passed to the paint method of the specific component and then call the native method for drawing operation.
Now if i want to use gtk instead of qt. I required to call gtk_main() for display the data on the screen. I check the complete PP code I found they are calling gtk_main() anf gtk_quit() for every component. So please suggest me in personal basis profile where i should place the gtk_main() for displaying the final data on the screen from native side.
Thanks in advance for your help.

Regards

Rajesh Sharma

Hinkmond Wong

Hi Rajesh,

phonemeadvanced@mobileandembedded.org wrote:
> Hi Hinkmond,
>
> Thanks for reply. That's very helpfull for me. After reading all the three files suggested by you as well as well as the source code of phoneMe advanced many of my doubt are clear except only fews.
>
> 1) After calling the paint(g) from Container.java control is passed to the paint method of the specific component and then call the native method for drawing operation.
> Now if i want to use gtk instead of qt. I required to call gtk_main() for display the data on the screen. I check the complete PP code I found they are calling gtk_main() anf gtk_quit() for every component. So please suggest me in personal basis profile where i should place the gtk_main() for displaying the final data on the screen from native side.
> Thanks in advance for your help.

I think that's where the misunderstanding is. In the Personal Basis
Profile model of AWT Peers (see all the Qt files I pointed you to), you
want to wrap the AWT graphics Peer objects around the native primitive
calls. You do not want to have Personal Basis Profile call gtk_main(),
since that is not a GTK native primitive call for PBP to wrap around.
Instead, that would be starting GTK as a parallel window, instead of a
GTK native window that is embedded inside PBP that PBP can then take
control of and call into.

So, the use of gtk_main() and gtk_quit() is incompatible with the
fundamental design of the PBP Peer Model.

Instead, look at the PP GTK porting code to get a sense of what the PBP
GTK code should do with GTK:

https://phoneme.dev.java.net/svn/phoneme/components/cdc/trunk/src/share/...

Hinkmond

---------------------------------------------------------------------
To unsubscribe, e-mail: advanced-unsubscribe@phoneme.dev.java.net
For additional commands, e-mail: advanced-help@phoneme.dev.java.net

Hinkmond Wong

phonemeadvanced@mobileandembedded.org wrote:
> Hi All
> I am trying to find how to attach the native Qt window in java environment and from where to update this window in java .
>
> I created a native window from java methods but it is not displaying anything
> [Message sent by forum member 'sharmarajesh' (sharmarajesh)]
>

Hi Sharma,

That would not be the proper design pattern for phoneME. Instead, the
design is to follow the AWT peer model which wraps around Qt (not attach
to Qt).

For more info, you can take a look at the files in:

https://phoneme.dev.java.net/svn/phoneme/components/cdc/trunk/src/share/...

Hinkmond

---------------------------------------------------------------------
To unsubscribe, e-mail: advanced-unsubscribe@phoneme.dev.java.net
For additional commands, e-mail: advanced-help@phoneme.dev.java.net

sharmarajesh
Offline
Joined: 2007-07-04

Hi Hinkmond,
Thanks for the reply. I am discussing about the personal basis profile not the personal profile. I check the complete basis folder of phoneMe but i am not be able to find out. How the data from java files are passed to Native screen. I able to find out how the native screen is created fron java files but not able to find how the data is passed to native screen when paint(Graphics g) is called from component.

Regards,
Rajesh Sharma

Hinkmond Wong

phonemeadvanced@mobileandembedded.org wrote:
> Hi Hinkmond,
> Thanks for the reply. I am discussing about the personal basis profile not the personal profile. I check the complete basis folder of phoneMe but i am not be able to find out. How the data from java files are passed to Native screen. I able to find out how the native screen is created fron java files but not able to find how the data is passed to native screen when paint(Graphics g) is called from component.
>
> Regards,
> Rajesh Sharma
>
>

Hi Rajesh,

If you are looking at Personal Basis Profile (basis), you can browse the
basis AWT Peer port to Qt at the following location:

https://phoneme.dev.java.net/svn/phoneme/components/cdc/trunk/src/share/...

Look at QtApplication.cpp and QtBackEnd.cpp to see how Java AWT wraps
around the Qt native objects. Then look at QtImage.cpp to see how a
QPainter qp object is used inside the Java basis AWT port to see how
Java calls into Qt to draw (Ex. Java_java_awt_QtImage_pDrawImage())

Hinkmond

---------------------------------------------------------------------
To unsubscribe, e-mail: advanced-unsubscribe@phoneme.dev.java.net
For additional commands, e-mail: advanced-help@phoneme.dev.java.net