summaryrefslogtreecommitdiff
path: root/src/lib/ecore_wl2
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2017-08-30 09:04:05 -0400
committerChris Michael <cp.michael@samsung.com>2017-08-30 09:10:55 -0400
commit2ed81b0948fb3475ce1edab9177ec578c4a020e5 (patch)
treedad4c1bf0d418d65e02b7e69e4fc6d8be87f66d6 /src/lib/ecore_wl2
parentf90d0d150163beb546e78c52786d6c2eb7706e8d (diff)
ecore-wl2: Formatting
NB: No functional changes Signed-off-by: Chris Michael <cp.michael@samsung.com>
Diffstat (limited to 'src/lib/ecore_wl2')
-rw-r--r--src/lib/ecore_wl2/ecore_wl2_window.c59
1 files changed, 36 insertions, 23 deletions
diff --git a/src/lib/ecore_wl2/ecore_wl2_window.c b/src/lib/ecore_wl2/ecore_wl2_window.c
index c9e77daa53..566ea99de7 100644
--- a/src/lib/ecore_wl2/ecore_wl2_window.c
+++ b/src/lib/ecore_wl2/ecore_wl2_window.c
@@ -320,6 +320,8 @@ _ecore_wl2_window_shell_surface_init(Ecore_Wl2_Window *window)
320 _ecore_wl2_window_zxdg_popup_create(window); 320 _ecore_wl2_window_zxdg_popup_create(window);
321 else 321 else
322 { 322 {
323 struct zxdg_toplevel_v6 *ptop = NULL;
324
323 window->zxdg_toplevel = 325 window->zxdg_toplevel =
324 zxdg_surface_v6_get_toplevel(window->zxdg_surface); 326 zxdg_surface_v6_get_toplevel(window->zxdg_surface);
325 zxdg_toplevel_v6_set_user_data(window->zxdg_toplevel, window); 327 zxdg_toplevel_v6_set_user_data(window->zxdg_toplevel, window);
@@ -334,15 +336,11 @@ _ecore_wl2_window_shell_surface_init(Ecore_Wl2_Window *window)
334 window->zxdg_set_min_size = zxdg_toplevel_v6_set_min_size; 336 window->zxdg_set_min_size = zxdg_toplevel_v6_set_min_size;
335 window->zxdg_set_max_size = zxdg_toplevel_v6_set_max_size; 337 window->zxdg_set_max_size = zxdg_toplevel_v6_set_max_size;
336 338
337 { 339 if (window->parent)
338 struct zxdg_toplevel_v6 *ptop = NULL; 340 ptop = window->parent->zxdg_toplevel;
339
340 if (window->parent)
341 ptop = window->parent->zxdg_toplevel;
342 341
343 if (ptop) 342 if (ptop)
344 zxdg_toplevel_v6_set_parent(window->zxdg_toplevel, ptop); 343 zxdg_toplevel_v6_set_parent(window->zxdg_toplevel, ptop);
345 }
346 344
347 if (window->maximized) 345 if (window->maximized)
348 zxdg_toplevel_v6_set_maximized(window->zxdg_toplevel); 346 zxdg_toplevel_v6_set_maximized(window->zxdg_toplevel);
@@ -615,6 +613,7 @@ ecore_wl2_window_move(Ecore_Wl2_Window *window, Ecore_Wl2_Input *input)
615{ 613{
616 EINA_SAFETY_ON_NULL_RETURN(window); 614 EINA_SAFETY_ON_NULL_RETURN(window);
617 EINA_SAFETY_ON_NULL_RETURN(window->display->inputs); 615 EINA_SAFETY_ON_NULL_RETURN(window->display->inputs);
616
618 if (!input) 617 if (!input)
619 input = EINA_INLIST_CONTAINER_GET(window->display->inputs, Ecore_Wl2_Input); 618 input = EINA_INLIST_CONTAINER_GET(window->display->inputs, Ecore_Wl2_Input);
620 619
@@ -630,6 +629,7 @@ ecore_wl2_window_resize(Ecore_Wl2_Window *window, Ecore_Wl2_Input *input, int lo
630{ 629{
631 EINA_SAFETY_ON_NULL_RETURN(window); 630 EINA_SAFETY_ON_NULL_RETURN(window);
632 EINA_SAFETY_ON_NULL_RETURN(window->display->inputs); 631 EINA_SAFETY_ON_NULL_RETURN(window->display->inputs);
632
633 if (!input) 633 if (!input)
634 input = EINA_INLIST_CONTAINER_GET(window->display->inputs, Ecore_Wl2_Input); 634 input = EINA_INLIST_CONTAINER_GET(window->display->inputs, Ecore_Wl2_Input);
635 635
@@ -1053,7 +1053,6 @@ EAPI Eina_Bool
1053ecore_wl2_window_shell_surface_exists(Ecore_Wl2_Window *window) 1053ecore_wl2_window_shell_surface_exists(Ecore_Wl2_Window *window)
1054{ 1054{
1055 EINA_SAFETY_ON_NULL_RETURN_VAL(window, EINA_FALSE); 1055 EINA_SAFETY_ON_NULL_RETURN_VAL(window, EINA_FALSE);
1056
1057 return !!window->zxdg_surface; 1056 return !!window->zxdg_surface;
1058} 1057}
1059 1058
@@ -1310,6 +1309,7 @@ ecore_wl2_window_aux_hint_del(Ecore_Wl2_Window *win, int id)
1310 if ((win->surface) && (win->display->wl.efl_aux_hints)) 1309 if ((win->surface) && (win->display->wl.efl_aux_hints))
1311 efl_aux_hints_del_aux_hint(win->display->wl.efl_aux_hints, win->surface, id); 1310 efl_aux_hints_del_aux_hint(win->display->wl.efl_aux_hints, win->surface, id);
1312} 1311}
1312
1313EAPI void 1313EAPI void
1314ecore_wl2_window_focus_skip_set(Ecore_Wl2_Window *window, Eina_Bool focus_skip) 1314ecore_wl2_window_focus_skip_set(Ecore_Wl2_Window *window, Eina_Bool focus_skip)
1315{ 1315{
@@ -1351,15 +1351,18 @@ ecore_wl2_window_aspect_set(Ecore_Wl2_Window *window, int w, int h, unsigned int
1351 EINA_SAFETY_ON_NULL_RETURN(window); 1351 EINA_SAFETY_ON_NULL_RETURN(window);
1352 EINA_SAFETY_ON_TRUE_RETURN(w < 1); 1352 EINA_SAFETY_ON_TRUE_RETURN(w < 1);
1353 EINA_SAFETY_ON_TRUE_RETURN(h < 1); 1353 EINA_SAFETY_ON_TRUE_RETURN(h < 1);
1354 if ((window->aspect.aspect == aspect) && 1354
1355 (window->aspect.w == w) && 1355 if ((window->aspect.aspect == aspect) && (window->aspect.w == w) &&
1356 (window->aspect.h == h)) return; 1356 (window->aspect.h == h))
1357 return;
1358
1357 window->aspect.w = w; 1359 window->aspect.w = w;
1358 window->aspect.h = h; 1360 window->aspect.h = h;
1359 window->aspect.aspect = aspect; 1361 window->aspect.aspect = aspect;
1360 window->aspect.set = 1; 1362 window->aspect.set = 1;
1361 if (window->display->wl.efl_hints && window->zxdg_toplevel) 1363 if (window->display->wl.efl_hints && window->zxdg_toplevel)
1362 efl_hints_set_aspect(window->display->wl.efl_hints, window->zxdg_toplevel, w, h, aspect); 1364 efl_hints_set_aspect(window->display->wl.efl_hints,
1365 window->zxdg_toplevel, w, h, aspect);
1363} 1366}
1364 1367
1365static void 1368static void
@@ -1382,12 +1385,14 @@ static struct wl_callback_listener _frame_listener =
1382 _frame_cb 1385 _frame_cb
1383}; 1386};
1384 1387
1385EAPI void ecore_wl2_window_commit(Ecore_Wl2_Window *window, Eina_Bool flush) 1388EAPI void
1389ecore_wl2_window_commit(Ecore_Wl2_Window *window, Eina_Bool flush)
1386{ 1390{
1387 EINA_SAFETY_ON_NULL_RETURN(window); 1391 EINA_SAFETY_ON_NULL_RETURN(window);
1388 EINA_SAFETY_ON_NULL_RETURN(window->surface); 1392 EINA_SAFETY_ON_NULL_RETURN(window->surface);
1389 1393
1390 if (window->commit_pending) ERR("Commit before previous commit processed"); 1394 if (window->commit_pending)
1395 ERR("Commit before previous commit processed");
1391 1396
1392 window->commit_pending = EINA_TRUE; 1397 window->commit_pending = EINA_TRUE;
1393 window->callback = wl_surface_frame(window->surface); 1398 window->callback = wl_surface_frame(window->surface);
@@ -1396,14 +1401,16 @@ EAPI void ecore_wl2_window_commit(Ecore_Wl2_Window *window, Eina_Bool flush)
1396 if (flush) wl_surface_commit(window->surface); 1401 if (flush) wl_surface_commit(window->surface);
1397} 1402}
1398 1403
1399EAPI Eina_Bool ecore_wl2_window_pending_get(Ecore_Wl2_Window *window) 1404EAPI Eina_Bool
1405ecore_wl2_window_pending_get(Ecore_Wl2_Window *window)
1400{ 1406{
1401 EINA_SAFETY_ON_NULL_RETURN_VAL(window, EINA_FALSE); 1407 EINA_SAFETY_ON_NULL_RETURN_VAL(window, EINA_FALSE);
1402 1408
1403 return window->commit_pending; 1409 return window->commit_pending;
1404} 1410}
1405 1411
1406EAPI Ecore_Wl2_Frame_Cb_Handle *ecore_wl2_window_frame_callback_add(Ecore_Wl2_Window *window, Ecore_Wl2_Frame_Cb cb, void *data) 1412EAPI Ecore_Wl2_Frame_Cb_Handle *
1413ecore_wl2_window_frame_callback_add(Ecore_Wl2_Window *window, Ecore_Wl2_Frame_Cb cb, void *data)
1407{ 1414{
1408 Ecore_Wl2_Frame_Cb_Handle *callback; 1415 Ecore_Wl2_Frame_Cb_Handle *callback;
1409 1416
@@ -1415,19 +1422,23 @@ EAPI Ecore_Wl2_Frame_Cb_Handle *ecore_wl2_window_frame_callback_add(Ecore_Wl2_Wi
1415 callback->cb = cb; 1422 callback->cb = cb;
1416 callback->data = data; 1423 callback->data = data;
1417 callback->win = window; 1424 callback->win = window;
1418 window->frame_callbacks = eina_list_append(window->frame_callbacks, callback); 1425 window->frame_callbacks =
1426 eina_list_append(window->frame_callbacks, callback);
1419 return callback; 1427 return callback;
1420} 1428}
1421 1429
1422EAPI void ecore_wl2_window_frame_callback_del(Ecore_Wl2_Frame_Cb_Handle *handle) 1430EAPI void
1431ecore_wl2_window_frame_callback_del(Ecore_Wl2_Frame_Cb_Handle *handle)
1423{ 1432{
1424 EINA_SAFETY_ON_NULL_RETURN(handle); 1433 EINA_SAFETY_ON_NULL_RETURN(handle);
1425 1434
1426 handle->win->frame_callbacks = eina_list_remove(handle->win->frame_callbacks, handle); 1435 handle->win->frame_callbacks =
1436 eina_list_remove(handle->win->frame_callbacks, handle);
1427 free(handle); 1437 free(handle);
1428} 1438}
1429 1439
1430EAPI void ecore_wl2_window_buffer_attach(Ecore_Wl2_Window *win, struct wl_buffer *buffer, int x, int y, Eina_Bool implicit) 1440EAPI void
1441ecore_wl2_window_buffer_attach(Ecore_Wl2_Window *win, struct wl_buffer *buffer, int x, int y, Eina_Bool implicit)
1431{ 1442{
1432 EINA_SAFETY_ON_NULL_RETURN(win); 1443 EINA_SAFETY_ON_NULL_RETURN(win);
1433 EINA_SAFETY_ON_NULL_RETURN(win->surface); 1444 EINA_SAFETY_ON_NULL_RETURN(win->surface);
@@ -1435,6 +1446,8 @@ EAPI void ecore_wl2_window_buffer_attach(Ecore_Wl2_Window *win, struct wl_buffer
1435 /* FIXME: Haven't given any thought to x and y since we always use 0... */ 1446 /* FIXME: Haven't given any thought to x and y since we always use 0... */
1436 if (!implicit) wl_surface_attach(win->surface, buffer, x, y); 1447 if (!implicit) wl_surface_attach(win->surface, buffer, x, y);
1437 win->buffer = buffer; 1448 win->buffer = buffer;
1438 if (!implicit && !buffer) win->has_buffer = EINA_FALSE; 1449 if (!implicit && !buffer)
1439 else win->has_buffer = EINA_TRUE; 1450 win->has_buffer = EINA_FALSE;
1451 else
1452 win->has_buffer = EINA_TRUE;
1440} 1453}