summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVitor Sousa <vitorsousasilva@gmail.com>2015-04-17 19:28:51 -0300
committerVitor Sousa <vitorsousasilva@gmail.com>2015-05-07 15:59:50 -0300
commitf235d0542e5a9deec8197e59ad6d8d1eab824828 (patch)
tree9d84ccc35c0835f5e8885175819c35e0171f8dc0
parentcd8da71dc14d1de5d3771cf69be998eddf96ef88 (diff)
elm_win_standard: Add elm_win_standard class
This commit adds the Eolian class elm_win_standard. It is basically a derivation from elm_win that creates a default background. The intent is to replace the legacy functions elm_win_util_standard_add and elm_win_util_dialog_add by functions accessible via Eo API functions such as eo_add and eo_do. To fully replace an elm_win_util_standard_add call, use: eo_add(ELM_WIN_STANDARD_CLASS, NULL, elm_obj_win_name_set("example"), elm_obj_win_type_set(ELM_WIN_BASIC), elm_obj_win_title_set("Example"));
-rw-r--r--src/lib/Elementary.h.in1
-rw-r--r--src/lib/Makefile.am5
-rw-r--r--src/lib/elm_win_standard.c36
-rw-r--r--src/lib/elm_win_standard.eo7
-rw-r--r--src/lib/elm_win_standard.h3
5 files changed, 52 insertions, 0 deletions
diff --git a/src/lib/Elementary.h.in b/src/lib/Elementary.h.in
index 3ec825996..cd17bbfd3 100644
--- a/src/lib/Elementary.h.in
+++ b/src/lib/Elementary.h.in
@@ -261,6 +261,7 @@ EAPI extern Elm_Version *elm_version;
261#include <elm_video.h> 261#include <elm_video.h>
262#include <elm_web.h> 262#include <elm_web.h>
263#include <elm_win.h> 263#include <elm_win.h>
264#include <elm_win_standard.h>
264 265
265/* include deprecated calls last of all */ 266/* include deprecated calls last of all */
266#include <elm_deprecated.h> 267#include <elm_deprecated.h>
diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am
index 8c137e8c3..859b0ef4e 100644
--- a/src/lib/Makefile.am
+++ b/src/lib/Makefile.am
@@ -385,6 +385,8 @@ elm_win.h \
385elm_win_common.h \ 385elm_win_common.h \
386elm_win_eo.h \ 386elm_win_eo.h \
387elm_win_legacy.h \ 387elm_win_legacy.h \
388elm_win_standard.h \
389elm_win_standard.eo.h \
388elm_helper.h 390elm_helper.h
389includesubdir = $(includedir)/elementary-@VMAJ@/ 391includesubdir = $(includedir)/elementary-@VMAJ@/
390 392
@@ -502,6 +504,7 @@ elm_video.c \
502elm_web2.c \ 504elm_web2.c \
503elm_widget.c \ 505elm_widget.c \
504elm_win.c \ 506elm_win.c \
507elm_win_standard.c \
505elm_helper.c \ 508elm_helper.c \
506els_box.c \ 509els_box.c \
507els_cursor.c \ 510els_cursor.c \
@@ -619,6 +622,7 @@ elm_video.eo \
619elm_web.eo \ 622elm_web.eo \
620elm_widget.eo \ 623elm_widget.eo \
621elm_win.eo \ 624elm_win.eo \
625elm_win_standard.eo \
622elm_widget_item.eo \ 626elm_widget_item.eo \
623elm_color_item.eo \ 627elm_color_item.eo \
624elm_dayselector_item.eo \ 628elm_dayselector_item.eo \
@@ -747,6 +751,7 @@ elementaryeolianfiles_DATA = \
747 elm_video.eo \ 751 elm_video.eo \
748 elm_web.eo \ 752 elm_web.eo \
749 elm_win.eo \ 753 elm_win.eo \
754 elm_win_standard.eo \
750 elm_widget_item.eo \ 755 elm_widget_item.eo \
751 elm_color_item.eo \ 756 elm_color_item.eo \
752 elm_dayselector_item.eo \ 757 elm_dayselector_item.eo \
diff --git a/src/lib/elm_win_standard.c b/src/lib/elm_win_standard.c
new file mode 100644
index 000000000..23fddce4c
--- /dev/null
+++ b/src/lib/elm_win_standard.c
@@ -0,0 +1,36 @@
1#ifdef HAVE_CONFIG_H
2# include "elementary_config.h"
3#endif
4
5#define ELM_INTERFACE_ATSPI_ACCESSIBLE_PROTECTED
6#define ELM_INTERFACE_ATSPI_WIDGET_ACTION_PROTECTED
7#define ELM_WIN_PROTECTED
8
9#include <Elementary.h>
10
11#include "elm_priv.h"
12
13#define MY_CLASS ELM_WIN_STANDARD_CLASS
14
15EOLIAN static Eo *
16_elm_win_standard_eo_base_finalize(Eo *obj, void *pd EINA_UNUSED)
17{
18 eo_do_super(obj, MY_CLASS, obj = eo_finalize());
19 if (!obj)
20 return NULL;
21
22 Evas_Object *bg = eo_add(ELM_BG_CLASS, obj);
23 if (!bg)
24 {
25 ERR("Cannot create background.");
26 evas_object_del(obj);
27 return NULL;
28 }
29 eo_do(bg, evas_obj_size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND));
30 eo_do(obj, elm_obj_win_resize_object_add(bg));
31 eo_do(bg, efl_gfx_visible_set(EINA_TRUE));
32
33 return obj;
34}
35
36#include "elm_win_standard.eo.c"
diff --git a/src/lib/elm_win_standard.eo b/src/lib/elm_win_standard.eo
new file mode 100644
index 000000000..e33aa4399
--- /dev/null
+++ b/src/lib/elm_win_standard.eo
@@ -0,0 +1,7 @@
1class Elm.Win_Standard (Elm.Win)
2{
3 data: null;
4 implements {
5 Eo.Base.finalize;
6 }
7}
diff --git a/src/lib/elm_win_standard.h b/src/lib/elm_win_standard.h
new file mode 100644
index 000000000..2222bbb68
--- /dev/null
+++ b/src/lib/elm_win_standard.h
@@ -0,0 +1,3 @@
1#ifdef EFL_EO_API_SUPPORT
2#include <elm_win_standard.eo.h>
3#endif