src/solaris/native/sun/awt/awt_util.c

Print this page


   1 /*
   2  * Copyright (c) 1995, 2003, 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


  39 #include <Xm/MenuShell.h>
  40 #include <Xm/List.h>
  41 #include <Xm/Form.h>
  42 #include <Xm/RowColumn.h>
  43 #include <Xm/MwmUtil.h>
  44 #endif /* XAWT */
  45 #include <jni.h>
  46 #include <jni_util.h>
  47 #include <sys/time.h>
  48 
  49 #include "awt_xembed.h"
  50 
  51 
  52 #ifndef XAWT
  53 #if MOTIF_VERSION!=1
  54     #include <Xm/GrabShell.h>
  55 #endif
  56 #endif
  57 
  58 #include "java_awt_event_MouseWheelEvent.h"
  59 
  60 /*
  61  * Since X reports protocol errors asynchronously, we often need to
  62  * install an error handler that acts like a callback.  While that
  63  * specialized handler is installed we save original handler here.
  64  */
  65 XErrorHandler xerror_saved_handler;
  66 
  67 /*
  68  * A place for error handler to report the error code.
  69  */
  70 unsigned char xerror_code;
  71 
  72 extern jint getModifiers(uint32_t state, jint button, jint keyCode);
  73 extern jint getButton(uint32_t button);
  74 
  75 static int32_t winmgr_running = 0;
  76 static Atom OLDecorDelAtom = 0;
  77 static Atom MWMHints = 0;
  78 static Atom DTWMHints = 0;
  79 static Atom decor_list[9];
  80 
  81 #ifndef MAX
  82 #define MAX(a,b) ((a) > (b) ? (a) : (b))
  83 #endif
  84 
  85 #ifndef MIN
  86 #define MIN(a,b) ((a) < (b) ? (a) : (b))
  87 #endif
  88 
  89 #ifndef XAWT
  90 /*


   1 /*
   2  * Copyright (c) 1995, 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


  39 #include <Xm/MenuShell.h>
  40 #include <Xm/List.h>
  41 #include <Xm/Form.h>
  42 #include <Xm/RowColumn.h>
  43 #include <Xm/MwmUtil.h>
  44 #endif /* XAWT */
  45 #include <jni.h>
  46 #include <jni_util.h>
  47 #include <sys/time.h>
  48 
  49 #include "awt_xembed.h"
  50 
  51 
  52 #ifndef XAWT
  53 #if MOTIF_VERSION!=1
  54     #include <Xm/GrabShell.h>
  55 #endif
  56 #endif
  57 
  58 #include "java_awt_event_MouseWheelEvent.h"












  59 
  60 extern jint getModifiers(uint32_t state, jint button, jint keyCode);
  61 extern jint getButton(uint32_t button);
  62 
  63 static int32_t winmgr_running = 0;
  64 static Atom OLDecorDelAtom = 0;
  65 static Atom MWMHints = 0;
  66 static Atom DTWMHints = 0;
  67 static Atom decor_list[9];
  68 
  69 #ifndef MAX
  70 #define MAX(a,b) ((a) > (b) ? (a) : (b))
  71 #endif
  72 
  73 #ifndef MIN
  74 #define MIN(a,b) ((a) < (b) ? (a) : (b))
  75 #endif
  76 
  77 #ifndef XAWT
  78 /*