2 * Copyright (C) 2013 Canonical Ltd
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
16 * Authored by: Thomas Voss <thomas.voss@canonical.com>
19 #ifndef INPUT_STACK_COMPATIBILITY_LAYER_H_
20 #define INPUT_STACK_COMPATIBILITY_LAYER_H_
29 #define MAX_POINTER_COUNT 16
31 typedef int64_t nsecs_t
;
42 // Generic event properties
49 // Information specific to key/motion event types
52 struct HardwareSwitchEvent
55 uint32_t policy_flags
;
56 int32_t switch_values
;
80 struct PointerCoordinates
91 struct PointerCoordinates pointer_coordinates
[MAX_POINTER_COUNT
];
96 typedef void (*on_new_event_callback
)(struct Event
* event
, void* context
);
98 struct AndroidEventListener
100 on_new_event_callback on_new_event
;
104 struct InputStackConfiguration
106 bool enable_touch_point_visualization
;
107 int default_layer_for_touch_point_visualization
;
108 int input_area_width
;
109 int input_area_height
;
112 void android_input_stack_initialize(
113 struct AndroidEventListener
* listener
,
114 struct InputStackConfiguration
* input_stack_configuration
);
116 void android_input_stack_loop_once();
117 void android_input_stack_start();
118 void android_input_stack_start_waiting_for_flag(bool* flag
);
119 void android_input_stack_stop();
120 void android_input_stack_shutdown();
126 #endif // INPUT_STACK_COMPATIBILITY_LAYER_H_