blob: 2c2cdfe8ae77b27fc92e90ac3b5dc940f1dfbdee [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
Jeff Brownfbf09772011-01-16 14:06:57 -080019import android.graphics.Region;
Jeff Brown349703e2010-06-22 01:27:15 -070020import android.view.InputChannel;
21
22/**
23 * Describes input-related window properties for use by the input dispatcher.
Jeff Brown349703e2010-06-22 01:27:15 -070024 * @hide
25 */
26public final class InputWindow {
Jeff Brown928e0542011-01-10 11:17:36 -080027 // The window handle.
28 public InputWindowHandle inputWindowHandle;
29
Jeff Brown349703e2010-06-22 01:27:15 -070030 // The input channel associated with the window.
31 public InputChannel inputChannel;
Jeff Brown928e0542011-01-10 11:17:36 -080032
Jeff Brown519e0242010-09-15 15:18:56 -070033 // The window name.
34 public String name;
Jeff Brown928e0542011-01-10 11:17:36 -080035
Jeff Brown349703e2010-06-22 01:27:15 -070036 // Window layout params attributes. (WindowManager.LayoutParams)
37 public int layoutParamsFlags;
38 public int layoutParamsType;
Jeff Brown928e0542011-01-10 11:17:36 -080039
Jeff Brown349703e2010-06-22 01:27:15 -070040 // Dispatching timeout.
41 public long dispatchingTimeoutNanos;
Jeff Brown928e0542011-01-10 11:17:36 -080042
Jeff Brownfbf09772011-01-16 14:06:57 -080043 // Window frame.
Jeff Brown349703e2010-06-22 01:27:15 -070044 public int frameLeft;
45 public int frameTop;
Jeff Brown85a31762010-09-01 17:01:00 -070046 public int frameRight;
47 public int frameBottom;
Jeff Brown928e0542011-01-10 11:17:36 -080048
Jeff Brownfbf09772011-01-16 14:06:57 -080049 // Window touchable region.
50 public final Region touchableRegion = new Region();
Jeff Brown928e0542011-01-10 11:17:36 -080051
Jeff Brown349703e2010-06-22 01:27:15 -070052 // Window is visible.
53 public boolean visible;
Jeff Brown928e0542011-01-10 11:17:36 -080054
Jeff Brown519e0242010-09-15 15:18:56 -070055 // Window can receive keys.
56 public boolean canReceiveKeys;
Jeff Brown928e0542011-01-10 11:17:36 -080057
Jeff Brown349703e2010-06-22 01:27:15 -070058 // Window has focus.
59 public boolean hasFocus;
Jeff Brown928e0542011-01-10 11:17:36 -080060
Jeff Brown349703e2010-06-22 01:27:15 -070061 // Window has wallpaper. (window is the current wallpaper target)
62 public boolean hasWallpaper;
Jeff Brown928e0542011-01-10 11:17:36 -080063
Jeff Brown349703e2010-06-22 01:27:15 -070064 // Input event dispatching is paused.
65 public boolean paused;
Jeff Brown928e0542011-01-10 11:17:36 -080066
Jeff Brown519e0242010-09-15 15:18:56 -070067 // Window layer.
68 public int layer;
Jeff Brown928e0542011-01-10 11:17:36 -080069
Jeff Brown349703e2010-06-22 01:27:15 -070070 // Id of process and user that owns the window.
71 public int ownerPid;
72 public int ownerUid;
Jeff Brown928e0542011-01-10 11:17:36 -080073
Jeff Brown349703e2010-06-22 01:27:15 -070074 public void recycle() {
Jeff Brown928e0542011-01-10 11:17:36 -080075 inputWindowHandle = null;
Jeff Brown349703e2010-06-22 01:27:15 -070076 inputChannel = null;
77 }
78}