Example #1
0
 void handleConfigureNotify(XEvent xev) {
   if (isXEmbedActive()) {
     XConfigureEvent ev = xev.get_xconfigure();
     if (xembedLog.isLoggable(PlatformLogger.FINER))
       xembedLog.finer("Bounds change on client: " + ev);
     if (xev.get_xany().get_window() == handle) {
       childResized();
     }
   }
 }
Example #2
0
 public void dispatchEvent(XEvent ev) {
   super.dispatchEvent(ev);
   switch (ev.get_type()) {
     case XConstants.CreateNotify:
       XCreateWindowEvent cr = ev.get_xcreatewindow();
       if (xembedLog.isLoggable(PlatformLogger.FINEST)) {
         xembedLog.finest("Message on embedder: " + cr);
       }
       if (xembedLog.isLoggable(PlatformLogger.FINER)) {
         xembedLog.finer(
             "Create notify for parent "
                 + Long.toHexString(cr.get_parent())
                 + ", window "
                 + Long.toHexString(cr.get_window()));
       }
       embedChild(cr.get_window());
       break;
     case XConstants.DestroyNotify:
       XDestroyWindowEvent dn = ev.get_xdestroywindow();
       if (xembedLog.isLoggable(PlatformLogger.FINEST)) {
         xembedLog.finest("Message on embedder: " + dn);
       }
       if (xembedLog.isLoggable(PlatformLogger.FINER)) {
         xembedLog.finer("Destroy notify for parent: " + dn);
       }
       childDestroyed();
       break;
     case XConstants.ReparentNotify:
       XReparentEvent rep = ev.get_xreparent();
       if (xembedLog.isLoggable(PlatformLogger.FINEST)) {
         xembedLog.finest("Message on embedder: " + rep);
       }
       if (xembedLog.isLoggable(PlatformLogger.FINER)) {
         xembedLog.finer(
             "Reparent notify for parent "
                 + Long.toHexString(rep.get_parent())
                 + ", window "
                 + Long.toHexString(rep.get_window())
                 + ", event "
                 + Long.toHexString(rep.get_event()));
       }
       if (rep.get_parent() == getWindow()) {
         // Reparented into us - embed it
         embedChild(rep.get_window());
       } else {
         // Reparented out of us - detach it
         childDestroyed();
       }
       break;
   }
 }
Example #3
0
 public void dispatchEvent(XEvent xev) {
   int type = xev.get_type();
   switch (type) {
     case XConstants.PropertyNotify:
       handlePropertyNotify(xev);
       break;
     case XConstants.ConfigureNotify:
       handleConfigureNotify(xev);
       break;
     case XConstants.ClientMessage:
       handleClientMessage(xev);
       break;
   }
 }
Example #4
0
 public void handlePropertyNotify(XEvent xev) {
   if (isXEmbedActive()) {
     XPropertyEvent ev = xev.get_xproperty();
     if (xembedLog.isLoggable(PlatformLogger.FINER))
       xembedLog.finer("Property change on client: " + ev);
     if (ev.get_atom() == XAtom.XA_WM_NORMAL_HINTS) {
       childResized();
     } else if (ev.get_atom() == XEmbedInfo.getAtom()) {
       processXEmbedInfo();
     } else if (ev.get_atom() == XDnDConstants.XA_XdndAware.getAtom()) {
       XDropTargetRegistry.getRegistry().unregisterXEmbedClient(getWindow(), xembed.handle);
       if (ev.get_state() == XConstants.PropertyNewValue) {
         XDropTargetRegistry.getRegistry().registerXEmbedClient(getWindow(), xembed.handle);
       }
     }
   } else {
     xembedLog.finer("XEmbed is not active");
   }
 }
Example #5
0
 public void handleClientMessage(XEvent xev) {
   super.handleClientMessage(xev);
   XClientMessageEvent msg = xev.get_xclient();
   if (xembedLog.isLoggable(PlatformLogger.FINER))
     xembedLog.finer("Client message to embedder: " + msg);
   if (msg.get_message_type() == xembed.XEmbed.getAtom()) {
     if (xembedLog.isLoggable(PlatformLogger.FINE))
       xembedLog.fine(xembed.XEmbedMessageToString(msg));
   }
   if (isXEmbedActive()) {
     switch ((int) msg.get_data(1)) {
       case XEMBED_REQUEST_FOCUS:
         requestXEmbedFocus();
         break;
       case XEMBED_FOCUS_NEXT:
         focusNext();
         break;
       case XEMBED_FOCUS_PREV:
         focusPrev();
         break;
       case XEMBED_REGISTER_ACCELERATOR:
         registerAccelerator(msg.get_data(2), msg.get_data(3), msg.get_data(4));
         break;
       case XEMBED_UNREGISTER_ACCELERATOR:
         unregisterAccelerator(msg.get_data(2));
         break;
       case NON_STANDARD_XEMBED_GTK_GRAB_KEY:
         grabKey(msg.get_data(3), msg.get_data(4));
         break;
       case NON_STANDARD_XEMBED_GTK_UNGRAB_KEY:
         ungrabKey(msg.get_data(3), msg.get_data(4));
         break;
     }
   } else {
     xembedLog.finer("But XEmbed is not Active!");
   }
 }