summaryrefslogtreecommitdiff
path: root/src/lib/ecore_evas
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2017-06-13 12:54:05 -0400
committerChris Michael <cp.michael@samsung.com>2017-06-13 12:57:29 -0400
commit0d5d15755920a9011d41f7d5af19ff4c212c7b19 (patch)
treee284c44ff23e505652655db78fcf37e03f912ab7 /src/lib/ecore_evas
parent1d453eece4b9813f0a7a58f548e59be63fa95e7a (diff)
ecore-evas: Support auxiliary hints for ecore-evas-wayland
Small patch to support using Ecore_Evas_Interface_Wayland in order to add support for setting auxiliary hints on a surface @feature Signed-off-by: Chris Michael <cp.michael@samsung.com>
Diffstat (limited to 'src/lib/ecore_evas')
-rw-r--r--src/lib/ecore_evas/ecore_evas.c89
1 files changed, 70 insertions, 19 deletions
diff --git a/src/lib/ecore_evas/ecore_evas.c b/src/lib/ecore_evas/ecore_evas.c
index b5c9f35020..f375559c98 100644
--- a/src/lib/ecore_evas/ecore_evas.c
+++ b/src/lib/ecore_evas/ecore_evas.c
@@ -2304,20 +2304,38 @@ ecore_evas_aux_hint_add(Ecore_Evas *ee, const char *hint, const char *val)
2304 aux->hint = eina_stringshare_add(hint); 2304 aux->hint = eina_stringshare_add(hint);
2305 aux->val = eina_stringshare_add(val); 2305 aux->val = eina_stringshare_add(val);
2306 2306
2307 ee->prop.aux_hint.hints = eina_list_append(ee->prop.aux_hint.hints, aux); 2307 ee->prop.aux_hint.hints =
2308 eina_list_append(ee->prop.aux_hint.hints, aux);
2308 2309
2309 Eina_Strbuf *buf = _ecore_evas_aux_hints_string_get(ee); 2310 if (!strncmp(ee->driver, "wayland", 7))
2310 if (buf)
2311 { 2311 {
2312 if (ee->engine.func->fn_aux_hints_set) 2312 Ecore_Evas_Interface_Wayland *iface;
2313 ee->engine.func->fn_aux_hints_set(ee, eina_strbuf_string_get(buf));
2314 2313
2315 eina_strbuf_free(buf); 2314 iface = (Ecore_Evas_Interface_Wayland *)_ecore_evas_interface_get(ee, "wayland");
2315 EINA_SAFETY_ON_NULL_RETURN_VAL(iface, -1);
2316
2317 if (iface->aux_hint_add)
2318 iface->aux_hint_add(ee, aux->id, hint, val);
2316 2319
2317 ee->prop.aux_hint.id++; 2320 ee->prop.aux_hint.id++;
2318 2321
2319 return aux->id; 2322 return aux->id;
2320 } 2323 }
2324 else
2325 {
2326 Eina_Strbuf *buf = _ecore_evas_aux_hints_string_get(ee);
2327 if (buf)
2328 {
2329 if (ee->engine.func->fn_aux_hints_set)
2330 ee->engine.func->fn_aux_hints_set(ee, eina_strbuf_string_get(buf));
2331
2332 eina_strbuf_free(buf);
2333
2334 ee->prop.aux_hint.id++;
2335
2336 return aux->id;
2337 }
2338 }
2321 2339
2322 eina_stringshare_del(aux->hint); 2340 eina_stringshare_del(aux->hint);
2323 eina_stringshare_del(aux->val); 2341 eina_stringshare_del(aux->val);
@@ -2341,22 +2359,39 @@ ecore_evas_aux_hint_del(Ecore_Evas *ee, const int id)
2341 { 2359 {
2342 if (id == aux->id) 2360 if (id == aux->id)
2343 { 2361 {
2344 ee->prop.aux_hint.hints = eina_list_remove(ee->prop.aux_hint.hints, aux); 2362 ee->prop.aux_hint.hints =
2363 eina_list_remove(ee->prop.aux_hint.hints, aux);
2345 2364
2346 eina_stringshare_del(aux->hint); 2365 eina_stringshare_del(aux->hint);
2347 eina_stringshare_del(aux->val); 2366 eina_stringshare_del(aux->val);
2348 free(aux); 2367 free(aux);
2349 2368
2350 Eina_Strbuf *buf = _ecore_evas_aux_hints_string_get(ee); 2369 if (!strncmp(ee->driver, "wayland", 7))
2351 if (buf)
2352 { 2370 {
2353 if (ee->engine.func->fn_aux_hints_set) 2371 Ecore_Evas_Interface_Wayland *iface;
2354 ee->engine.func->fn_aux_hints_set(ee, eina_strbuf_string_get(buf)); 2372
2373 iface = (Ecore_Evas_Interface_Wayland *)_ecore_evas_interface_get(ee, "wayland");
2374 EINA_SAFETY_ON_NULL_RETURN_VAL(iface, EINA_FALSE);
2355 2375
2356 eina_strbuf_free(buf); 2376 if (iface->aux_hint_del)
2377 iface->aux_hint_del(ee, id);
2357 2378
2358 return EINA_TRUE; 2379 return EINA_TRUE;
2359 } 2380 }
2381 else
2382 {
2383 Eina_Strbuf *buf = _ecore_evas_aux_hints_string_get(ee);
2384 if (buf)
2385 {
2386 if (ee->engine.func->fn_aux_hints_set)
2387 ee->engine.func->fn_aux_hints_set(ee, eina_strbuf_string_get(buf));
2388
2389 eina_strbuf_free(buf);
2390
2391 return EINA_TRUE;
2392 }
2393 }
2394
2360 break; 2395 break;
2361 } 2396 }
2362 } 2397 }
@@ -2377,19 +2412,35 @@ ecore_evas_aux_hint_val_set(Ecore_Evas *ee, const int id, const char *val)
2377 { 2412 {
2378 eina_stringshare_del(aux->val); 2413 eina_stringshare_del(aux->val);
2379 aux->val = eina_stringshare_add(val); 2414 aux->val = eina_stringshare_add(val);
2380 aux->allowed = 0; 2415 aux->allowed = 0;
2381 aux->notified = 0; 2416 aux->notified = 0;
2382 2417
2383 Eina_Strbuf *buf = _ecore_evas_aux_hints_string_get(ee); 2418 if (!strncmp(ee->driver, "wayland", 7))
2384 if (buf)
2385 { 2419 {
2386 if (ee->engine.func->fn_aux_hints_set) 2420 Ecore_Evas_Interface_Wayland *iface;
2387 ee->engine.func->fn_aux_hints_set(ee, eina_strbuf_string_get(buf)); 2421
2422 iface = (Ecore_Evas_Interface_Wayland *)_ecore_evas_interface_get(ee, "wayland");
2423 EINA_SAFETY_ON_NULL_RETURN_VAL(iface, EINA_FALSE);
2388 2424
2389 eina_strbuf_free(buf); 2425 if (iface->aux_hint_change)
2426 iface->aux_hint_change(ee, id, val);
2390 2427
2391 return EINA_TRUE; 2428 return EINA_TRUE;
2392 } 2429 }
2430 else
2431 {
2432 Eina_Strbuf *buf = _ecore_evas_aux_hints_string_get(ee);
2433 if (buf)
2434 {
2435 if (ee->engine.func->fn_aux_hints_set)
2436 ee->engine.func->fn_aux_hints_set(ee, eina_strbuf_string_get(buf));
2437
2438 eina_strbuf_free(buf);
2439
2440 return EINA_TRUE;
2441 }
2442 }
2443
2393 break; 2444 break;
2394 } 2445 }
2395 } 2446 }