From: "Kelly Morrison" <[EMAIL PROTECTED]>
Subject: Attaching to native X Window

    I'm using the IRMASiteWindowed interface to attach a native window
to the player. It was easy in Microsoft Windows, but I'm having
problems in the X Window System: I can create a window and have it
briefly appear, but then it crashes. The IRMASiteWindowed
documentation says that I have to pass the native window events back
to the core, but I'm not sure how to do this. Currently, my code looks
something like this:

----- In my Site Supplier
code -----------------------------------------
...
PNxWindow window = NativeWindows::Instance()->GetWindow();
  hres = pSiteWindowed->AttachWindow(&window);
...

----- In my NativeWindows
code-----------------------------------------
...
PNxWindow _window;
Display *display = XOpenDisplay(NULL);
...
_window.display = (void *) display;
_window.x = 0;
... etc... rest of window initialization
...
Window win = XCreateSimpleWindow(display,
      RootWindow(display, 0),
      0, 0, 640, 480, 0,
      BlackPixel(display, 0),
      WhitePixel(display, 0));
_window.window = (void *) win;
XMapWindow(display, win);
return _window;
...

-----------------------------------------------------------------

I'm guessing that I have to add an event loop after the XMapWindow()
call and pass the events back to the client, similar to the following.
Am I on the right track? Thanks very much in advance!

XEvent xEvent;
PNxEvent pnEvent;
while (1) {
    XNextEvent(display, &xEvent);
    ... map XEvent fields into the PNxEvent fields...
    pClientEngine->EventOccurred(&pnEvent);
}

    -----> kell


*******************************************************
The RealForum is an email discussion group focused on using RealNetworks
products. The RealForum is a place to post messages about the best methods
for creating content using RealNetworks technologies and the planning and
implementation of streaming-media web sites.  Archives of RealForum can
be found at http://realforum.real.com

If you ever want to remove yourself from this mailing list,
you can send mail to <[EMAIL PROTECTED]> with the following
command in the body of your email message:

    unsubscribe realforum

or from another account, besides the address you subscribed with:

    unsubscribe realforum <[EMAIL PROTECTED]>

Reply via email to