summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristopher Michael <cpmichael1@comcast.net>2012-01-03 01:45:22 +0000
committerChristopher Michael <cpmichael1@comcast.net>2012-01-03 01:45:22 +0000
commitc123bc4f4a065f9c98ec6a5745fdc4c38231a367 (patch)
treecdf55466cfb304ea39df6db3c8886fc82ac6c77a /src
parent57eb194ef20b3777245e13fa0a4ad9884348460e (diff)
Elm: Add wayland_shm engine for Elm. Add config entries for the
Wayland Engine. Give elm window some 'framespace' and borders for wayland_shm. NB: This means that you can now build & run elm apps for Wayland :) SVN revision: 66767
Diffstat (limited to 'src')
-rw-r--r--src/lib/elm_config.c3
-rw-r--r--src/lib/elm_priv.h1
-rw-r--r--src/lib/elm_win.c34
3 files changed, 36 insertions, 2 deletions
diff --git a/src/lib/elm_config.c b/src/lib/elm_config.c
index b14fc161a..36c4664cc 100644
--- a/src/lib/elm_config.c
+++ b/src/lib/elm_config.c
@@ -35,6 +35,7 @@ const char *_elm_engines[] = {
35 "ews", 35 "ews",
36 "opengl_cocoa", 36 "opengl_cocoa",
37 "psl1ght", 37 "psl1ght",
38 "wayland_shm",
38 NULL 39 NULL
39}; 40};
40 41
@@ -1199,6 +1200,8 @@ _env_get(void)
1199 eina_stringshare_replace(&_elm_config->engine, s); 1200 eina_stringshare_replace(&_elm_config->engine, s);
1200 else if ((!strcasecmp(s, "ews"))) 1201 else if ((!strcasecmp(s, "ews")))
1201 eina_stringshare_replace(&_elm_config->engine, ELM_EWS); 1202 eina_stringshare_replace(&_elm_config->engine, ELM_EWS);
1203 else if ((!strcasecmp(s, "wayland_shm")))
1204 eina_stringshare_replace(&_elm_config->engine, ELM_WAYLAND_SHM);
1202 } 1205 }
1203 1206
1204 s = getenv("ELM_VSYNC"); 1207 s = getenv("ELM_VSYNC");
diff --git a/src/lib/elm_priv.h b/src/lib/elm_priv.h
index 67497eab5..6b0f9bf7e 100644
--- a/src/lib/elm_priv.h
+++ b/src/lib/elm_priv.h
@@ -89,6 +89,7 @@ extern const char *_elm_engines[];
89#define ELM_EWS (_elm_engines[13]) 89#define ELM_EWS (_elm_engines[13])
90#define ELM_OPENGL_COCOA (_elm_engines[14]) 90#define ELM_OPENGL_COCOA (_elm_engines[14])
91#define ELM_SOFTWARE_PSL1GHT (_elm_engines[15]) 91#define ELM_SOFTWARE_PSL1GHT (_elm_engines[15])
92#define ELM_WAYLAND_SHM (_elm_engines[16])
92 93
93#define ELM_FONT_TOKEN_STYLE ":style=" 94#define ELM_FONT_TOKEN_STYLE ":style="
94 95
diff --git a/src/lib/elm_win.c b/src/lib/elm_win.c
index b4bdc3557..8b9644b4c 100644
--- a/src/lib/elm_win.c
+++ b/src/lib/elm_win.c
@@ -323,6 +323,7 @@ _elm_win_focus_in(Ecore_Evas *ee)
323 _elm_win_focus_highlight_reconfigure_job_start(win); 323 _elm_win_focus_highlight_reconfigure_job_start(win);
324 if (win->frame_obj) 324 if (win->frame_obj)
325 { 325 {
326 edje_object_signal_emit(win->frame_obj, "elm,action,focus", "elm");
326 } 327 }
327 else if (win->img_obj) 328 else if (win->img_obj)
328 { 329 {
@@ -346,6 +347,7 @@ _elm_win_focus_out(Ecore_Evas *ee)
346 _elm_win_focus_highlight_reconfigure_job_start(win); 347 _elm_win_focus_highlight_reconfigure_job_start(win);
347 if (win->frame_obj) 348 if (win->frame_obj)
348 { 349 {
350 edje_object_signal_emit(win->frame_obj, "elm,action,unfocus", "elm");
349 } 351 }
350 else if (win->img_obj) 352 else if (win->img_obj)
351 { 353 {
@@ -459,6 +461,7 @@ _elm_win_obj_callback_hide(void *data, Evas *e __UNUSED__, Evas_Object *obj __UN
459 461
460 if (win->frame_obj) 462 if (win->frame_obj)
461 { 463 {
464 evas_object_hide(win->frame_obj);
462 } 465 }
463 else if (win->img_obj) 466 else if (win->img_obj)
464 { 467 {
@@ -588,14 +591,15 @@ _elm_win_obj_intercept_show(void *data, Evas_Object *obj)
588 // sizes BEFORE we show the window to make sure it initially appears at 591 // sizes BEFORE we show the window to make sure it initially appears at
589 // our desired size (ie min size is known first) 592 // our desired size (ie min size is known first)
590 evas_smart_objects_calculate(evas_object_evas_get(obj)); 593 evas_smart_objects_calculate(evas_object_evas_get(obj));
591 evas_object_show(obj);
592 if (win->frame_obj) 594 if (win->frame_obj)
593 { 595 {
596 evas_object_show(win->frame_obj);
594 } 597 }
595 else if (win->img_obj) 598 else if (win->img_obj)
596 { 599 {
597 evas_object_show(win->img_obj); 600 evas_object_show(win->img_obj);
598 } 601 }
602 evas_object_show(obj);
599} 603}
600 604
601static void 605static void
@@ -614,6 +618,11 @@ _elm_win_obj_callback_move(void *data, Evas *e __UNUSED__, Evas_Object *obj, voi
614 } 618 }
615 if (win->frame_obj) 619 if (win->frame_obj)
616 { 620 {
621 Evas_Coord x, y;
622
623 evas_object_geometry_get(obj, &x, &y, NULL, NULL);
624 win->screen.x = x;
625 win->screen.y = y;
617 } 626 }
618 else if (win->img_obj) 627 else if (win->img_obj)
619 { 628 {
@@ -688,13 +697,14 @@ _elm_win_resize_job(void *data)
688 w = MIN(w, sw); 697 w = MIN(w, sw);
689 h = MIN(h, sh); 698 h = MIN(h, sh);
690 } 699 }
691 evas_object_resize(win->win_obj, w, h);
692 if (win->frame_obj) 700 if (win->frame_obj)
693 { 701 {
702 evas_object_resize(win->frame_obj, w, h);
694 } 703 }
695 else if (win->img_obj) 704 else if (win->img_obj)
696 { 705 {
697 } 706 }
707 evas_object_resize(win->win_obj, w, h);
698 EINA_LIST_FOREACH(win->subobjs, l, obj) 708 EINA_LIST_FOREACH(win->subobjs, l, obj)
699 { 709 {
700 evas_object_move(obj, 0, 0); 710 evas_object_move(obj, 0, 0);
@@ -1535,6 +1545,18 @@ elm_win_add(Evas_Object *parent, const char *name, Elm_Win_Type type)
1535 { 1545 {
1536 win->ee = ecore_evas_ews_new(0, 0, 1, 1); 1546 win->ee = ecore_evas_ews_new(0, 0, 1, 1);
1537 } 1547 }
1548 else if (ENGINE_COMPARE(ELM_WAYLAND_SHM))
1549 {
1550 win->ee = ecore_evas_wayland_shm_new(NULL, 0, 0, 1, 1, 0);
1551 win->evas = ecore_evas_get(win->ee);
1552 evas_output_framespace_set(win->evas, 0, 22, 0, 26);
1553
1554 win->frame_obj = edje_object_add(win->evas);
1555 _elm_theme_set(NULL, win->frame_obj, "border", "base", "default");
1556 evas_object_is_frame_object_set(win->frame_obj, EINA_TRUE);
1557 evas_object_move(win->frame_obj, 0, 0);
1558 evas_object_resize(win->frame_obj, 1, 1);
1559 }
1538 else if (!strncmp(_elm_config->engine, "shot:", 5)) 1560 else if (!strncmp(_elm_config->engine, "shot:", 5))
1539 { 1561 {
1540 win->ee = ecore_evas_buffer_new(1, 1); 1562 win->ee = ecore_evas_buffer_new(1, 1);
@@ -1583,6 +1605,12 @@ elm_win_add(Evas_Object *parent, const char *name, Elm_Win_Type type)
1583 evas_object_layer_set(win->win_obj, 50); 1605 evas_object_layer_set(win->win_obj, 50);
1584 evas_object_pass_events_set(win->win_obj, EINA_TRUE); 1606 evas_object_pass_events_set(win->win_obj, EINA_TRUE);
1585 1607
1608 if (win->frame_obj)
1609 {
1610// evas_object_clip_set(win->win_obj, win->frame_obj);
1611 evas_object_stack_below(win->frame_obj, win->win_obj);
1612 }
1613
1586 if (type == ELM_WIN_INLINED_IMAGE) 1614 if (type == ELM_WIN_INLINED_IMAGE)
1587 elm_widget_parent2_set(win->win_obj, parent); 1615 elm_widget_parent2_set(win->win_obj, parent);
1588 ecore_evas_object_associate(win->ee, win->win_obj, 1616 ecore_evas_object_associate(win->ee, win->win_obj,
@@ -1721,6 +1749,8 @@ elm_win_title_set(Evas_Object *obj, const char *title)
1721 win = elm_widget_data_get(obj); 1749 win = elm_widget_data_get(obj);
1722 if (!win) return; 1750 if (!win) return;
1723 ecore_evas_title_set(win->ee, title); 1751 ecore_evas_title_set(win->ee, title);
1752 if (win->frame_obj)
1753 edje_object_part_text_set(win->frame_obj, "elm.text.title", title);
1724} 1754}
1725 1755
1726EAPI const char * 1756EAPI const char *