1 /******************************************************************************* 2 * Copyright 2011 See AUTHORS file. 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 ******************************************************************************/ 16 17 18 package com.badlogic.gdx.backends.lwjgl3; 19 20 import com.badlogic.gdx.ApplicationListener; 21 22 /** 23 * Receives notifications of various window events, such as iconficiation, 24 * focus loss and gain, and window close events. Can be set per window 25 * via {@link Lwjgl3ApplicationConfiguration} and {@link Lwjgl3WindowConfiguration}. 26 * Close events can be canceled by returning false. 27 * 28 * @author badlogic 29 * 30 */ 31 public interface Lwjgl3WindowListener { 32 /** 33 * Called when the window is iconified, i.e. its minimize button 34 * was clicked. The window's {@link ApplicationListener} will 35 * be paused 36 */ 37 void iconified(); 38 39 /** 40 * Called when the window is deiconified, i.e. its task bar 41 * icon was clicked. The window's {@link ApplicationListener} 42 * will be resumed. 43 */ 44 void deiconified(); 45 46 /** 47 * Called when the window lost focus to another window. The 48 * window's {@link ApplicationListener} will continue to be 49 * called. 50 */ 51 void focusLost(); 52 53 /** 54 * Called when the window gained focus. 55 */ 56 void focusGained(); 57 58 /** Called when the user requested to close the window, e.g. clicking 59 * the close button or pressing the window closing keyboard shortcut. 60 * 61 * @return whether the window should actually close **/ 62 boolean closeRequested(); 63 64 /** 65 * Called when external files are dropped into the window, 66 * e.g from the Desktop. 67 * 68 * @param files array with absolute paths to the files 69 */ 70 void filesDropped(String[] files); 71 72 } 73