2 * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
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.
25 typedef void *aul_window_info_h;
26 typedef void *aul_window_stack_h;
30 * This API creates the window stack handle.
32 * To get information of windows, the stack handle is needed.
34 * @param[out] handle Handle for the window stack
35 * @return 0 if success, negative value(<0) if fail
38 * aul_window_stack_del
40 * It should be freed by aul_window_stack_del function.
42 int aul_window_stack_get(aul_window_stack_h *handle);
46 * This API destroy the window stack handle.
48 * @param[in] handle Handle for the window stack
49 * @return 0 if success, negative value(<0) if fail
52 * aul_window_stack_get
54 int aul_window_stack_del(aul_window_stack_h handle);
58 * This API invokes iterator function for each window.
60 * @param[in] handle Handle for the window stack
61 * @param[in] iter_cb The iteration callback
62 * @param[in] data The data which will be sent to the iterator
63 * @return 0 if success, negative value(<0) if fail
66 int aul_window_stack_foreach(aul_window_stack_h handle,
67 void (*iter_cb)(aul_window_info_h info, void *data), void *data);
71 * This API gets the global resource ID from the window handle.
73 * @param[in] info Handle for the window
74 * @param[out] rid Global resource ID
76 * @return 0 if success, negative value(<0) if fail
79 int aul_window_stack_info_get_resource_id(aul_window_info_h info, unsigned int *rid);
83 * This API gets the process ID from the window handle.
85 * @param[in] info Handle for the window
86 * @param[out] pid Process ID
88 * @return 0 if success, negative value(<0) if fail
91 int aul_window_info_get_pid(aul_window_info_h info, int *pid);
95 * This API gets the process ID for its parent window from the window handle.
97 * @param[in] info Handle for the window
98 * @param[out] pid Process ID
100 * @return 0 if success, negative value(<0) if fail
103 * pid will be -1 when the parent window is not exist
106 int aul_window_info_get_parent_pid(aul_window_info_h info, int *ppid);
110 * This API gets the process ID for its ancestor window from the window handle.
112 * @param[in] info Handle for the window
113 * @param[out] pid Process ID
115 * @return 0 if success, negative value(<0) if fail
118 * pid will be -1 when the ancestor window is not exist
121 int aul_window_info_get_ancestor_pid(aul_window_info_h info, int *apid);
125 * This API gets the window visibility from the window handle.
127 * @param[in] info Handle for the window
128 * @param[out] visibility visibility
129 * 0 Fully visible state
130 * 1 Partially visible state
131 * 2 Invisible state by other window
134 * @return 0 if success, negative value(<0) if fail
137 int aul_window_info_get_visibility(aul_window_info_h info, int *visibility);
141 * This API gets the flag value of supporting alpha blending.
143 * @param[in] info Handle for the window
144 * @param[out] alpha The flag value of supporting alpha blending
146 * @return 0 if success, negative value(<0) if fail
149 int aul_window_info_has_alpha(aul_window_info_h info, bool *alpha);
153 * This API gets the flag value of the focused state.
155 * @param[in] info Handle for the window
156 * @param[out] focused The flag value of the focused state
158 * @return 0 if success, negative value(<0) if fail
161 int aul_window_info_is_focused(aul_window_info_h info, bool *focused);
163 typedef enum _aul_window_notification_level_e {
164 AUL_WINDOW_NOTIFICATION_LEVEL_NONE = 0,
165 AUL_WINDOW_NOTIFICATION_LEVEL_DEFAULT = 10,
166 AUL_WINDOW_NOTIFICATION_LEVEL_MEDIUM = 20,
167 AUL_WINDOW_NOTIFICATION_LEVEL_HIGH = 30,
168 AUL_WINDOW_NOTIFICATION_LEVEL_TOP = 40,
169 AUL_WINDOW_NOTIFICATION_LEVEL_PRIVILEGE = 99,
170 } aul_window_notification_level_e;
174 * This API gets the window notification level from the window handle.
176 * @param[in] info Handle for the window
177 * @param[out] level Notification level
178 * @return 0 if success, negative value(<0) if fail
181 int aul_window_info_get_notification_level(aul_window_info_h info,
182 aul_window_notification_level_e *level);
186 * This API gets the location and the size from window handle.
188 * @param[in] info Handle for the window
189 * @param[out] x Position x
190 * @param[out] y Position y
191 * @param[out] w Width
192 * @param[out] h Height
194 * @return 0 if success, negative value(<0) if fail
197 int aul_window_info_get_geometry(aul_window_info_h info, int *x, int *y, int *w, int *h);
202 * This API gets pid for the focused window.
204 * @param[out] pid focused pid
206 * @return 0 if success, negative value(<0) if fail
209 int aul_window_get_focused_pid(pid_t *pid);
212 * This API is only for Appfw internally.
214 int aul_window_attach(const char *parent_appid, const char *child_appid);
217 * This API is only for Appfw internally.
219 int aul_window_detach(const char *child_appid);
223 * This API gets the flag value of the opaque state.
225 * @param[in] info Handle for the window
226 * @param[out] opaque The flag value of the opaque state.
228 * @return 0 on success, otherwise a negative error value.
230 int aul_window_info_get_opaque(aul_window_info_h info, bool *opaque);