1 /*
   2  * Copyright (c) 2010, 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
  23  * questions.
  24  */
  25 package com.sun.glass.ui.win;
  26 
  27 import com.sun.glass.ui.Application;
  28 import com.sun.glass.ui.Pixels;
  29 import com.sun.glass.ui.View;
  30 import com.sun.glass.ui.Window;
  31 import java.security.AccessController;
  32 import java.security.PrivilegedAction;
  33 
  34 import java.util.Map;
  35 
  36 /**
  37  * MS Windows platform implementation class for View.
  38  */
  39 final class WinView extends View {
  40 
  41     private native static void _initIDs();
  42     static {
  43         _initIDs();
  44         multiClickTime = _getMultiClickTime_impl();
  45         multiClickMaxX = _getMultiClickMaxX_impl();
  46         multiClickMaxY = _getMultiClickMaxY_impl();
  47     }
  48 
  49     // Constants
  50     private static final long multiClickTime;
  51     private static final int multiClickMaxX, multiClickMaxY;
  52 
  53     protected WinView() {
  54         super();
  55     }
  56 
  57     native private static long _getMultiClickTime_impl();
  58     native private static int _getMultiClickMaxX_impl();
  59     native private static int _getMultiClickMaxY_impl();
  60 
  61     static long getMultiClickTime_impl() {
  62         return multiClickTime;
  63     }
  64 
  65     static int getMultiClickMaxX_impl() {
  66         return multiClickMaxX;
  67     }
  68 
  69     static int getMultiClickMaxY_impl() {
  70         return multiClickMaxY;
  71     }
  72 
  73     @Override
  74     protected int _getNativeFrameBuffer(long ptr) {
  75         return 0;
  76     }
  77 
  78     @Override native protected void _enableInputMethodEvents(long ptr, boolean enable);
  79     @Override native protected void _finishInputMethodComposition(long ptr);
  80 
  81     @Override native protected long _create(Map caps);
  82     @Override native protected long _getNativeView(long ptr);
  83     @Override native protected int _getX(long ptr);
  84     @Override native protected int _getY(long ptr);
  85     @Override native protected void _setParent(long ptr, long parentPtr);
  86     @Override native protected boolean _close(long ptr);
  87     @Override native protected void _scheduleRepaint(long ptr);
  88     @Override native protected void _begin(long ptr);
  89     @Override native protected void _end(long ptr);
  90     @Override native protected void _uploadPixels(long ptr, Pixels pixels);
  91     @Override native protected boolean _enterFullscreen(long ptr, boolean animate, boolean keepRatio, boolean hideCursor);
  92     @Override native protected void _exitFullscreen(long ptr, boolean animate);
  93 
  94 }
  95