blob: 1515290145d8bf6b4302a1b04a9906f8b1833055 [file] [log] [blame]
Jeff Brown349703e2010-06-22 01:27:15 -07001/*
2 * Copyright (C) 2010 The Android Open Source Project
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
17package com.android.server;
18
19import android.view.InputChannel;
20
21/**
22 * Describes input-related window properties for use by the input dispatcher.
Jeff Brown349703e2010-06-22 01:27:15 -070023 * @hide
24 */
25public final class InputWindow {
Jeff Brown928e0542011-01-10 11:17:36 -080026 // The window handle.
27 public InputWindowHandle inputWindowHandle;
28
Jeff Brown349703e2010-06-22 01:27:15 -070029 // The input channel associated with the window.
30 public InputChannel inputChannel;
Jeff Brown928e0542011-01-10 11:17:36 -080031
Jeff Brown519e0242010-09-15 15:18:56 -070032 // The window name.
33 public String name;
Jeff Brown928e0542011-01-10 11:17:36 -080034
Jeff Brown349703e2010-06-22 01:27:15 -070035 // Window layout params attributes. (WindowManager.LayoutParams)
36 public int layoutParamsFlags;
37 public int layoutParamsType;
Jeff Brown928e0542011-01-10 11:17:36 -080038
Jeff Brown349703e2010-06-22 01:27:15 -070039 // Dispatching timeout.
40 public long dispatchingTimeoutNanos;
Jeff Brown928e0542011-01-10 11:17:36 -080041
Jeff Brown85a31762010-09-01 17:01:00 -070042 // Window frame area.
Jeff Brown349703e2010-06-22 01:27:15 -070043 public int frameLeft;
44 public int frameTop;
Jeff Brown85a31762010-09-01 17:01:00 -070045 public int frameRight;
46 public int frameBottom;
Jeff Brown928e0542011-01-10 11:17:36 -080047
Jeff Brown85a31762010-09-01 17:01:00 -070048 // Window visible frame area.
49 public int visibleFrameLeft;
50 public int visibleFrameTop;
51 public int visibleFrameRight;
52 public int visibleFrameBottom;
Jeff Brown928e0542011-01-10 11:17:36 -080053
Jeff Brown349703e2010-06-22 01:27:15 -070054 // Window touchable area.
55 public int touchableAreaLeft;
56 public int touchableAreaTop;
57 public int touchableAreaRight;
58 public int touchableAreaBottom;
Jeff Brown928e0542011-01-10 11:17:36 -080059
Jeff Brown349703e2010-06-22 01:27:15 -070060 // Window is visible.
61 public boolean visible;
Jeff Brown928e0542011-01-10 11:17:36 -080062
Jeff Brown519e0242010-09-15 15:18:56 -070063 // Window can receive keys.
64 public boolean canReceiveKeys;
Jeff Brown928e0542011-01-10 11:17:36 -080065
Jeff Brown349703e2010-06-22 01:27:15 -070066 // Window has focus.
67 public boolean hasFocus;
Jeff Brown928e0542011-01-10 11:17:36 -080068
Jeff Brown349703e2010-06-22 01:27:15 -070069 // Window has wallpaper. (window is the current wallpaper target)
70 public boolean hasWallpaper;
Jeff Brown928e0542011-01-10 11:17:36 -080071
Jeff Brown349703e2010-06-22 01:27:15 -070072 // Input event dispatching is paused.
73 public boolean paused;
Jeff Brown928e0542011-01-10 11:17:36 -080074
Jeff Brown519e0242010-09-15 15:18:56 -070075 // Window layer.
76 public int layer;
Jeff Brown928e0542011-01-10 11:17:36 -080077
Jeff Brown349703e2010-06-22 01:27:15 -070078 // Id of process and user that owns the window.
79 public int ownerPid;
80 public int ownerUid;
Jeff Brown928e0542011-01-10 11:17:36 -080081
Jeff Brown349703e2010-06-22 01:27:15 -070082 public void recycle() {
Jeff Brown928e0542011-01-10 11:17:36 -080083 inputWindowHandle = null;
Jeff Brown349703e2010-06-22 01:27:15 -070084 inputChannel = null;
85 }
86}