|
View:
New views
15 Messages
—
Rating Filter:
Alert me
|
|
|
GtkWindow XIDHi,
I'm trying to use gstreamer in a simple java-gnome app by using gstreamer-java. But to be able to embed a video into a Window I've to get back its native xid. So, I modified Java-gnome to implement this: in GtkWindow.java I added: static public final long getWindowXID (Window w){ return pointerOf(w); } and in Window.java I added: public long getWindowXID (){ return GtkWindow.getWindowXID(this); } But when I use this id to embed the video X says BadWindow. Am I getting the xid the right way ? Thanks in advance ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ java-gnome-hackers mailing list java-gnome-hackers@... https://lists.sourceforge.net/lists/listinfo/java-gnome-hackers |
|
|
Re: GtkWindow XIDOn Sat, Oct 24, 2009 at 2:52 PM, Goundy <goundy@...> wrote: -- Hi, the XID has to be taken from GdkDrawable, from which GdkWindow inherits. You used a GtkWindow, instead of GdkWindow. I've checked the doc of GdkDrawable [1] and it is missing the accessor for xid wich in C is provide by the function gdk_x11_drawable_get_xid [2]. Without that accesor you will not be able to take the XID of a window. Here's an example on how to embed Gstreamer in a custom Gtk2 application: http://github.com/potyl/perl-GStreamer-Interfaces/blob/master/examples/gst-video-sample.pl The code in Perl, but you should be able to understand easily what's going on. [1] http://java-gnome.sourceforge.net/4.0/doc/api/org/gnome/gdk/Drawable.html [2] http://library.gnome.org/devel/gdk/unstable/gdk-X-Window-System-Interaction.html#gdk-x11-drawable-get-xid Emmanuel Rodriguez ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ java-gnome-hackers mailing list java-gnome-hackers@... https://lists.sourceforge.net/lists/listinfo/java-gnome-hackers |
|
|
Re: GtkWindow XIDEmmanuel Rodriguez thank you very much, you helped lot
Emmanuel Rodriguez wrote: > > > the XID has to be taken from GdkDrawable, from which GdkWindow > inherits. You used a GtkWindow, instead of GdkWindow. I've checked the > doc of GdkDrawable [1] and it is missing the accessor for xid wich in > C is provide by the function gdk_x11_drawable_get_xid [2]. Without > that accesor you will not be able to take the XID of a window. > > > > -- > Emmanuel Rodriguez Exception in thread "main" java.lang.UnsatisfiedLinkError: org.gnome.gdk.GdkDrawable.gdk_x11_drawable_get_xid(J)I at org.gnome.gdk.GdkDrawable.gdk_x11_drawable_get_xid(Native Method) at org.gnome.gdk.GdkDrawable.getXID(GdkDrawable.java:508) And I added a call to that native function as: GdkWindow.java: static final long getXID(Drawable self) { long result; if (self == null) { throw new IllegalArgumentException("self can't be null"); } synchronized (lock) { result = gdk_x11_drawable_get_xid(pointerOf(self)); return result; } } Any ideas ? Thanks ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ java-gnome-hackers mailing list java-gnome-hackers@... https://lists.sourceforge.net/lists/listinfo/java-gnome-hackers |
|
|
Re: GtkWindow XIDGoundy wrote:
> Emmanuel Rodriguez thank you very much, you helped lot > > Emmanuel Rodriguez wrote: >> >> >> the XID has to be taken from GdkDrawable, from which GdkWindow >> inherits. You used a GtkWindow, instead of GdkWindow. I've checked >> the doc of GdkDrawable [1] and it is missing the accessor for xid >> wich in C is provide by the function gdk_x11_drawable_get_xid [2]. >> Without that accesor you will not be able to take the XID of a window. >> >> >> >> -- >> Emmanuel Rodriguez > The only problem now is that I'm getting: > Exception in thread "main" java.lang.UnsatisfiedLinkError: > org.gnome.gdk.GdkDrawable.gdk_x11_drawable_get_xid(J)I > at org.gnome.gdk.GdkDrawable.gdk_x11_drawable_get_xid(Native Method) > at org.gnome.gdk.GdkDrawable.getXID(GdkDrawable.java:508) > > And I added a call to that native function as: > > GdkWindow.java: > > static final long getXID(Drawable self) { > long result; > > if (self == null) { > throw new IllegalArgumentException("self can't be null"); > } > > synchronized (lock) { > result = gdk_x11_drawable_get_xid(pointerOf(self)); > > return result; > } > } > > Any ideas ? > Thanks > ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ java-gnome-hackers mailing list java-gnome-hackers@... https://lists.sourceforge.net/lists/listinfo/java-gnome-hackers |
|
|
Re: GtkWindow XIDOn Sat, Oct 24, 2009 at 4:22 PM, Goundy <goundy@...> wrote: -- Emmanuel Rodriguez thank you very much, you helped lot java-gnome is probably not linking against gdk-x11 Try to see if you can link it with gdk-x11-2.0 from pkg-config You can find the exact linker flags by running: pkg-config --libs gdk-x11-2.0 Emmanuel Rodriguez ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ java-gnome-hackers mailing list java-gnome-hackers@... https://lists.sourceforge.net/lists/listinfo/java-gnome-hackers |
|
|
Re: GtkWindow XIDMorning,
Emmanuel Rodriguez wrote: > > > java-gnome is probably not linking against gdk-x11 > Try to see if you can link it with gdk-x11-2.0 from pkg-config > > You can find the exact linker flags by running: > > pkg-config --libs gdk-x11-2.0 > > goundy@localhost ~ $ pkg-config --libs gdk-x11-2.0 -lgdk-x11-2.0 -lgdk_pixbuf-2.0 -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 That's kinda weird. ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ java-gnome-hackers mailing list java-gnome-hackers@... https://lists.sourceforge.net/lists/listinfo/java-gnome-hackers |
|
|
Re: GtkWindow XIDOn Sun, Oct 25, 2009 at 12:34 PM, Goundy <goundy@...> wrote: ldd tmp/libgtkjni-*.so | grep gdk-x11-2.0Morning, No exactly, this just means that you have the libraries installed, but java-gnome might not be using them (linked).
Check with ldd if the java-gnome .so is linked with gdk-x11 If ldd doesn't show the file then it isn't linked. Try to link it your self by hand: rm tmp/libgtkjni-*.so LDFLAGS=`pkg-config --libs gdk-x11-2.0` build/faster If ldd shows the file in the dependency list then there's something strange going on. -- Emmanuel Rodriguez ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ java-gnome-hackers mailing list java-gnome-hackers@... https://lists.sourceforge.net/lists/listinfo/java-gnome-hackers |
|
|
Re: GtkWindow XIDEmmanuel Rodriguez wrote:
> No exactly, this just means that you have the libraries installed, but > java-gnome might not be using them (linked). > > Check with ldd if the java-gnome .so is linked with gdk-x11 > ldd tmp/libgtkjni-*.so | grep gdk-x11-2.0 > > If ldd doesn't show the file then it isn't linked. Try to link it your > self by hand: > rm tmp/libgtkjni-*.so > LDFLAGS=`pkg-config --libs gdk-x11-2.0` build/faster > > If ldd shows the file in the dependency list then there's something > strange going on. > | grep gdk-x11 libgdk-x11-2.0.so.0 => /usr/lib/libgdk-x11-2.0.so.0 (0xb78ec000) that's odd :°) Btw, I haven't modified any .def file yet, I just added the new accessor in GdkDrawable.java and then linked (in eclipse) the java-gnome project to my testing project. ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ java-gnome-hackers mailing list java-gnome-hackers@... https://lists.sourceforge.net/lists/listinfo/java-gnome-hackers |
|
|
Re: GtkWindow XIDOn Sun, Oct 25, 2009 at 2:42 PM, Goundy <goundy@...> wrote:
Are you sure then that eclipse is picking up the right gtkjini.so file? Did you install your new bindings? -- Emmanuel Rodriguez ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ java-gnome-hackers mailing list java-gnome-hackers@... https://lists.sourceforge.net/lists/listinfo/java-gnome-hackers |
|
|
Re: GtkWindow XIDEmmanuel Rodriguez wrote:
> > Are you sure then that eclipse is picking up the right gtkjini.so file? > Did you install your new bindings? > Oh my! when I rebuild my branch, actually my method is being erased as the GdkDrawable file gets replace by the new generated one which doesn't contain my method. I guess I have to edit the source .def file to keep my method right ? ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ java-gnome-hackers mailing list java-gnome-hackers@... https://lists.sourceforge.net/lists/listinfo/java-gnome-hackers |
|
|
Re: GtkWindow XIDOn Sun, Oct 25, 2009 at 2:57 PM, Goundy <goundy@...> wrote:
I wish that someone else that's using the bindings could help you :( -- Emmanuel Rodriguez ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ java-gnome-hackers mailing list java-gnome-hackers@... https://lists.sourceforge.net/lists/listinfo/java-gnome-hackers |
|
|
Re: GtkWindow XIDOn Sun, Oct 25, 2009 at 3:59 PM, Goundy <goundy@...> wrote: --
That fix the first problem: the function is now generated. Is fine, it gives: Edit the file jni/bindings_java.h and add the following include after the other ones already there: #include <gdk/gdkx.h> Emmanuel Rodriguez ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ java-gnome-hackers mailing list java-gnome-hackers@... https://lists.sourceforge.net/lists/listinfo/java-gnome-hackers |
|
|
Re: GtkWindow XIDEmmanuel Rodriguez wrote:
> On Sun, Oct 25, 2009 at 2:57 PM, Goundy <goundy@... > <mailto:goundy@...>> wrote: > > Emmanuel Rodriguez wrote: > > > Are you sure then that eclipse is picking up the right > gtkjini.so file? > Did you install your new bindings? > > > Oh my! when I rebuild my branch, actually my method is being > erased as the GdkDrawable file gets replace by the new generated > one which doesn't contain my method. > I guess I have to edit the source .def file to keep my method right ? > > I think so, I haven't used the java-gnome bindings in a long time. > I wish that someone else that's using the bindings could help you :( > > -- > Emmanuel Rodriguez Well, the generator is giving me: static final FIXME getXid(Drawable self) throws BlacklistedMethodError { throw new BlacklistedMethodError("long"); } and I have the following code in GdkDrawable.defs: (define-method get_xid (of-object "GdkDrawable") (c-name "gdk_x11_drawable_get_xid") (caller-owns-return #t) (return-type "long") ) Am I missing something here ? Thanks ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ java-gnome-hackers mailing list java-gnome-hackers@... https://lists.sourceforge.net/lists/listinfo/java-gnome-hackers |
|
|
Re: GtkWindow XIDGoundy wrote:
> Emmanuel Rodriguez wrote: >> On Sun, Oct 25, 2009 at 2:57 PM, Goundy <goundy@... >> <mailto:goundy@...>> wrote: >> >> Emmanuel Rodriguez wrote: >> >> >> Are you sure then that eclipse is picking up the right >> gtkjini.so file? >> Did you install your new bindings? >> >> >> Oh my! when I rebuild my branch, actually my method is being >> erased as the GdkDrawable file gets replace by the new generated >> one which doesn't contain my method. >> I guess I have to edit the source .def file to keep my method >> right ? >> >> I think so, I haven't used the java-gnome bindings in a long time. >> I wish that someone else that's using the bindings could help you :( >> >> -- >> Emmanuel Rodriguez > Okay thank you Emmanuel, you helped a lot :P > > Well, the generator is giving me: > > static final FIXME getXid(Drawable self) throws > BlacklistedMethodError { > throw new BlacklistedMethodError("long"); > } > > and I have the following code in GdkDrawable.defs: > > (define-method get_xid > (of-object "GdkDrawable") > (c-name "gdk_x11_drawable_get_xid") > (caller-owns-return #t) > (return-type "long") > ) > > Am I missing something here ? > Thanks > (define-method get_xid (of-object "GdkDrawable") (c-name "gdk_x11_drawable_get_xid") (caller-owns-return #t) (return-type "gulong") ) Is fine, it gives: static final long getXid(Drawable self) { long result; if (self == null) { throw new IllegalArgumentException("self can't be null"); } synchronized (lock) { result = gdk_x11_drawable_get_xid(pointerOf(self)); return result; } } private static native final long gdk_x11_drawable_get_xid(long self); But when I build java-gnome I get: generated/bindings/org/gnome/gdk/GdkDrawable.c: In function 'Java_org_gnome_gdk_GdkDrawable_gdk_1x11_1drawable_1get_1xid': generated/bindings/org/gnome/gdk/GdkDrawable.c:1044: error: implicit declaration of function 'gdk_x11_drawable_get_xid' compilation terminated due to -Wfatal-errors. make: *** [build-java] Error 1 Which is really weird... Ideas are welcome :) ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ java-gnome-hackers mailing list java-gnome-hackers@... https://lists.sourceforge.net/lists/listinfo/java-gnome-hackers |
|
|
Re: GtkWindow XIDEmmanuel Rodriguez wrote:
> > Edit the file jni/bindings_java.h and add the following include after > the other ones already there: > #include <gdk/gdkx.h> > > > -- > Emmanuel Rodriguez Emmanuel, You nailed it ! That worked \o/ Bad damn, I've been spending too much time for nothing... X is still giving a BadWindow... Anyway I better digg a bit arround this :) Thanks for help emmanuel ;) ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ java-gnome-hackers mailing list java-gnome-hackers@... https://lists.sourceforge.net/lists/listinfo/java-gnome-hackers |
| Free embeddable forum powered by Nabble | Forum Help |