< prev index next >

src/java.desktop/unix/native/libawt_xawt/awt/awt_Robot.c

Print this page
rev 55756 : 8228468: awt_Robot.c : format string contains 0 within the string body
   1 /*
   2  * Copyright (c) 1999, 2017, 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


 133     int xoverlay = False;
 134     int eventBase, errorBase;
 135     if (checkXCompositeFunctions() &&
 136         compositeQueryExtension(display, &eventBase, &errorBase))
 137     {
 138         int major = 0;
 139         int minor = 0;
 140 
 141         compositeQueryVersion(display, &major, &minor);
 142         if (major > 0 || minor >= 3) {
 143             xoverlay = True;
 144         }
 145     }
 146 
 147     return xoverlay;
 148 }
 149 
 150 static jboolean isXCompositeDisplay(Display *display, int screenNumber) {
 151 
 152     char NET_WM_CM_Sn[25];
 153     snprintf(NET_WM_CM_Sn, sizeof(NET_WM_CM_Sn), "_NET_WM_CM_S%d\0", screenNumber);
 154 
 155     Atom managerSelection = XInternAtom(display, NET_WM_CM_Sn, 0);
 156     Window owner = XGetSelectionOwner(display, managerSelection);
 157 
 158     return owner != 0;
 159 }
 160 
 161 static XImage *getWindowImage(Display * display, Window window,
 162                               int32_t x, int32_t y,
 163                               int32_t w, int32_t h) {
 164     XImage         *image;
 165     int32_t        transparentOverlays;
 166     int32_t        numVisuals;
 167     XVisualInfo    *pVisuals;
 168     int32_t        numOverlayVisuals;
 169     OverlayInfo    *pOverlayVisuals;
 170     int32_t        numImageVisuals;
 171     XVisualInfo    **pImageVisuals;
 172     list_ptr       vis_regions;    /* list of regions to read from */
 173     list_ptr       vis_image_regions ;


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


 133     int xoverlay = False;
 134     int eventBase, errorBase;
 135     if (checkXCompositeFunctions() &&
 136         compositeQueryExtension(display, &eventBase, &errorBase))
 137     {
 138         int major = 0;
 139         int minor = 0;
 140 
 141         compositeQueryVersion(display, &major, &minor);
 142         if (major > 0 || minor >= 3) {
 143             xoverlay = True;
 144         }
 145     }
 146 
 147     return xoverlay;
 148 }
 149 
 150 static jboolean isXCompositeDisplay(Display *display, int screenNumber) {
 151 
 152     char NET_WM_CM_Sn[25];
 153     snprintf(NET_WM_CM_Sn, sizeof(NET_WM_CM_Sn), "_NET_WM_CM_S%d", screenNumber);
 154 
 155     Atom managerSelection = XInternAtom(display, NET_WM_CM_Sn, 0);
 156     Window owner = XGetSelectionOwner(display, managerSelection);
 157 
 158     return owner != 0;
 159 }
 160 
 161 static XImage *getWindowImage(Display * display, Window window,
 162                               int32_t x, int32_t y,
 163                               int32_t w, int32_t h) {
 164     XImage         *image;
 165     int32_t        transparentOverlays;
 166     int32_t        numVisuals;
 167     XVisualInfo    *pVisuals;
 168     int32_t        numOverlayVisuals;
 169     OverlayInfo    *pOverlayVisuals;
 170     int32_t        numImageVisuals;
 171     XVisualInfo    **pImageVisuals;
 172     list_ptr       vis_regions;    /* list of regions to read from */
 173     list_ptr       vis_image_regions ;


< prev index next >