src/solaris/classes/sun/awt/X11/XEmbedCanvasPeer.java

Print this page


   1 /*
   2  * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


 637             result = true;
 638         }
 639 
 640         return result;
 641     }
 642 
 643     public void modalityPushed(ModalityEvent ev) {
 644         xembed.sendMessage(xembed.handle, XEMBED_MODALITY_ON);
 645     }
 646 
 647     public void modalityPopped(ModalityEvent ev) {
 648         xembed.sendMessage(xembed.handle, XEMBED_MODALITY_OFF);
 649     }
 650 
 651     public void handleClientMessage(XEvent xev) {
 652         super.handleClientMessage(xev);
 653         XClientMessageEvent msg = xev.get_xclient();
 654         if (xembedLog.isLoggable(PlatformLogger.Level.FINER)) {
 655             xembedLog.finer("Client message to embedder: " + msg);
 656         }
 657         if (msg.get_message_type() == xembed.XEmbed.getAtom()) {
 658             if (xembedLog.isLoggable(PlatformLogger.Level.FINE)) {
 659                 xembedLog.fine(xembed.XEmbedMessageToString(msg));
 660             }
 661         }
 662         if (isXEmbedActive()) {
 663             switch ((int)msg.get_data(1)) {
 664               case XEMBED_REQUEST_FOCUS:
 665                   requestXEmbedFocus();
 666                   break;
 667               case XEMBED_FOCUS_NEXT:
 668                   focusNext();
 669                   break;
 670               case XEMBED_FOCUS_PREV:
 671                   focusPrev();
 672                   break;
 673               case XEMBED_REGISTER_ACCELERATOR:
 674                   registerAccelerator(msg.get_data(2), msg.get_data(3), msg.get_data(4));
 675                   break;
 676               case XEMBED_UNREGISTER_ACCELERATOR:
 677                   unregisterAccelerator(msg.get_data(2));
 678                   break;
 679               case NON_STANDARD_XEMBED_GTK_GRAB_KEY:


   1 /*
   2  * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


 637             result = true;
 638         }
 639 
 640         return result;
 641     }
 642 
 643     public void modalityPushed(ModalityEvent ev) {
 644         xembed.sendMessage(xembed.handle, XEMBED_MODALITY_ON);
 645     }
 646 
 647     public void modalityPopped(ModalityEvent ev) {
 648         xembed.sendMessage(xembed.handle, XEMBED_MODALITY_OFF);
 649     }
 650 
 651     public void handleClientMessage(XEvent xev) {
 652         super.handleClientMessage(xev);
 653         XClientMessageEvent msg = xev.get_xclient();
 654         if (xembedLog.isLoggable(PlatformLogger.Level.FINER)) {
 655             xembedLog.finer("Client message to embedder: " + msg);
 656         }
 657         if (msg.get_message_type() == XEmbedHelper.XEmbed.getAtom()) {
 658             if (xembedLog.isLoggable(PlatformLogger.Level.FINE)) {
 659                 xembedLog.fine(XEmbedHelper.XEmbedMessageToString(msg));
 660             }
 661         }
 662         if (isXEmbedActive()) {
 663             switch ((int)msg.get_data(1)) {
 664               case XEMBED_REQUEST_FOCUS:
 665                   requestXEmbedFocus();
 666                   break;
 667               case XEMBED_FOCUS_NEXT:
 668                   focusNext();
 669                   break;
 670               case XEMBED_FOCUS_PREV:
 671                   focusPrev();
 672                   break;
 673               case XEMBED_REGISTER_ACCELERATOR:
 674                   registerAccelerator(msg.get_data(2), msg.get_data(3), msg.get_data(4));
 675                   break;
 676               case XEMBED_UNREGISTER_ACCELERATOR:
 677                   unregisterAccelerator(msg.get_data(2));
 678                   break;
 679               case NON_STANDARD_XEMBED_GTK_GRAB_KEY: