1 /* //device/java/android/android/view/IWindowSession.aidl 2 ** 3 ** Copyright 2006, The Android Open Source Project 4 ** 5 ** Licensed under the Apache License, Version 2.0 (the "License"); 6 ** you may not use this file except in compliance with the License. 7 ** You may obtain a copy of the License at 8 ** 9 ** http://www.apache.org/licenses/LICENSE-2.0 10 ** 11 ** Unless required by applicable law or agreed to in writing, software 12 ** distributed under the License is distributed on an "AS IS" BASIS, 13 ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 ** See the License for the specific language governing permissions and 15 ** limitations under the License. 16 */ 17 18 package android.view; 19 20 import android.content.ClipData; 21 import android.content.res.Configuration; 22 import android.graphics.Rect; 23 import android.graphics.Region; 24 import android.os.Bundle; 25 import android.view.InputChannel; 26 import android.view.IWindow; 27 import android.view.MotionEvent; 28 import android.view.WindowManager; 29 import android.view.Surface; 30 31 /** 32 * System private per-application interface to the window manager. 33 * 34 * {@hide} 35 */ 36 interface IWindowSession { add(IWindow window, int seq, in WindowManager.LayoutParams attrs, in int viewVisibility, out Rect outContentInsets, out InputChannel outInputChannel)37 int add(IWindow window, int seq, in WindowManager.LayoutParams attrs, 38 in int viewVisibility, out Rect outContentInsets, 39 out InputChannel outInputChannel); addWithoutInputChannel(IWindow window, int seq, in WindowManager.LayoutParams attrs, in int viewVisibility, out Rect outContentInsets)40 int addWithoutInputChannel(IWindow window, int seq, in WindowManager.LayoutParams attrs, 41 in int viewVisibility, out Rect outContentInsets); remove(IWindow window)42 void remove(IWindow window); 43 44 /** 45 * Change the parameters of a window. You supply the 46 * new parameters, it returns the new frame of the window on screen (the 47 * position should be ignored) and surface of the window. The surface 48 * will be invalid if the window is currently hidden, else you can use it 49 * to draw the window's contents. 50 * 51 * @param window The window being modified. 52 * @param seq Ordering sequence number. 53 * @param attrs If non-null, new attributes to apply to the window. 54 * @param requestedWidth The width the window wants to be. 55 * @param requestedHeight The height the window wants to be. 56 * @param viewVisibility Window root view's visibility. 57 * @param insetsPending Set to true if the client will be later giving 58 * internal insets; as a result, the window will not impact other window 59 * layouts until the insets are given. 60 * @param outFrame Rect in which is placed the new position/size on 61 * screen. 62 * @param outContentInsets Rect in which is placed the offsets from 63 * <var>outFrame</var> in which the content of the window should be 64 * placed. This can be used to modify the window layout to ensure its 65 * contents are visible to the user, taking into account system windows 66 * like the status bar or a soft keyboard. 67 * @param outVisibleInsets Rect in which is placed the offsets from 68 * <var>outFrame</var> in which the window is actually completely visible 69 * to the user. This can be used to temporarily scroll the window's 70 * contents to make sure the user can see it. This is different than 71 * <var>outContentInsets</var> in that these insets change transiently, 72 * so complex relayout of the window should not happen based on them. 73 * @param outConfiguration New configuration of window, if it is now 74 * becoming visible and the global configuration has changed since it 75 * was last displayed. 76 * @param outSurface Object in which is placed the new display surface. 77 * 78 * @return int Result flags: {@link WindowManagerImpl#RELAYOUT_SHOW_FOCUS}, 79 * {@link WindowManagerImpl#RELAYOUT_FIRST_TIME}. 80 */ relayout(IWindow window, int seq, in WindowManager.LayoutParams attrs, int requestedWidth, int requestedHeight, int viewVisibility, boolean insetsPending, out Rect outFrame, out Rect outContentInsets, out Rect outVisibleInsets, out Configuration outConfig, out Surface outSurface)81 int relayout(IWindow window, int seq, in WindowManager.LayoutParams attrs, 82 int requestedWidth, int requestedHeight, int viewVisibility, 83 boolean insetsPending, out Rect outFrame, out Rect outContentInsets, 84 out Rect outVisibleInsets, out Configuration outConfig, 85 out Surface outSurface); 86 87 /** 88 * Called by a client to report that it ran out of graphics memory. 89 */ outOfMemory(IWindow window)90 boolean outOfMemory(IWindow window); 91 92 /** 93 * Give the window manager a hint of the part of the window that is 94 * completely transparent, allowing it to work with the surface flinger 95 * to optimize compositing of this part of the window. 96 */ setTransparentRegion(IWindow window, in Region region)97 void setTransparentRegion(IWindow window, in Region region); 98 99 /** 100 * Tell the window manager about the content and visible insets of the 101 * given window, which can be used to adjust the <var>outContentInsets</var> 102 * and <var>outVisibleInsets</var> values returned by 103 * {@link #relayout relayout()} for windows behind this one. 104 * 105 * @param touchableInsets Controls which part of the window inside of its 106 * frame can receive pointer events, as defined by 107 * {@link android.view.ViewTreeObserver.InternalInsetsInfo}. 108 */ setInsets(IWindow window, int touchableInsets, in Rect contentInsets, in Rect visibleInsets, in Region touchableRegion)109 void setInsets(IWindow window, int touchableInsets, in Rect contentInsets, 110 in Rect visibleInsets, in Region touchableRegion); 111 112 /** 113 * Return the current display size in which the window is being laid out, 114 * accounting for screen decorations around it. 115 */ getDisplayFrame(IWindow window, out Rect outDisplayFrame)116 void getDisplayFrame(IWindow window, out Rect outDisplayFrame); 117 finishDrawing(IWindow window)118 void finishDrawing(IWindow window); 119 setInTouchMode(boolean showFocus)120 void setInTouchMode(boolean showFocus); getInTouchMode()121 boolean getInTouchMode(); 122 performHapticFeedback(IWindow window, int effectId, boolean always)123 boolean performHapticFeedback(IWindow window, int effectId, boolean always); 124 125 /** 126 * Allocate the drag's thumbnail surface. Also assigns a token that identifies 127 * the drag to the OS and passes that as the return value. A return value of 128 * null indicates failure. 129 */ prepareDrag(IWindow window, int flags, int thumbnailWidth, int thumbnailHeight, out Surface outSurface)130 IBinder prepareDrag(IWindow window, int flags, 131 int thumbnailWidth, int thumbnailHeight, out Surface outSurface); 132 133 /** 134 * Initiate the drag operation itself 135 */ performDrag(IWindow window, IBinder dragToken, float touchX, float touchY, float thumbCenterX, float thumbCenterY, in ClipData data)136 boolean performDrag(IWindow window, IBinder dragToken, float touchX, float touchY, 137 float thumbCenterX, float thumbCenterY, in ClipData data); 138 139 /** 140 * Report the result of a drop action targeted to the given window. 141 * consumed is 'true' when the drop was accepted by a valid recipient, 142 * 'false' otherwise. 143 */ reportDropResult(IWindow window, boolean consumed)144 void reportDropResult(IWindow window, boolean consumed); 145 146 /** 147 * Tell the OS that we've just dragged into a View that is willing to accept the drop 148 */ dragRecipientEntered(IWindow window)149 void dragRecipientEntered(IWindow window); 150 151 /** 152 * Tell the OS that we've just dragged *off* of a View that was willing to accept the drop 153 */ dragRecipientExited(IWindow window)154 void dragRecipientExited(IWindow window); 155 156 /** 157 * For windows with the wallpaper behind them, and the wallpaper is 158 * larger than the screen, set the offset within the screen. 159 * For multi screen launcher type applications, xstep and ystep indicate 160 * how big the increment is from one screen to another. 161 */ setWallpaperPosition(IBinder windowToken, float x, float y, float xstep, float ystep)162 void setWallpaperPosition(IBinder windowToken, float x, float y, float xstep, float ystep); 163 wallpaperOffsetsComplete(IBinder window)164 void wallpaperOffsetsComplete(IBinder window); 165 sendWallpaperCommand(IBinder window, String action, int x, int y, int z, in Bundle extras, boolean sync)166 Bundle sendWallpaperCommand(IBinder window, String action, int x, int y, 167 int z, in Bundle extras, boolean sync); 168 wallpaperCommandComplete(IBinder window, in Bundle result)169 void wallpaperCommandComplete(IBinder window, in Bundle result); 170 } 171