summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lib/Elementary.h.in1
-rw-r--r--src/lib/Makefile.am5
-rw-r--r--src/lib/elm_win.c51
-rw-r--r--src/lib/elm_win.eo58
-rw-r--r--src/lib/elm_win_standard.c34
-rw-r--r--src/lib/elm_win_standard.eo7
-rw-r--r--src/lib/elm_win_standard.h3
7 files changed, 144 insertions, 15 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.c b/src/lib/elm_win.c
index 8674105ea..ddc3134e7 100644
--- a/src/lib/elm_win.c
+++ b/src/lib/elm_win.c
@@ -174,6 +174,7 @@ struct _Elm_Win_Data
174 const char *title; 174 const char *title;
175 const char *icon_name; 175 const char *icon_name;
176 const char *role; 176 const char *role;
177 Eina_Stringshare *name;
177 178
178 Evas_Object *main_menu; 179 Evas_Object *main_menu;
179 180
@@ -1796,6 +1797,7 @@ _elm_win_evas_object_smart_del(Eo *obj, Elm_Win_Data *sd)
1796 eina_stringshare_del(sd->title); 1797 eina_stringshare_del(sd->title);
1797 eina_stringshare_del(sd->icon_name); 1798 eina_stringshare_del(sd->icon_name);
1798 eina_stringshare_del(sd->role); 1799 eina_stringshare_del(sd->role);
1800 eina_stringshare_del(sd->name);
1799 evas_object_del(sd->icon); 1801 evas_object_del(sd->icon);
1800 evas_object_del(sd->main_menu); 1802 evas_object_del(sd->main_menu);
1801 1803
@@ -2946,7 +2948,9 @@ elm_win_add(Evas_Object *parent,
2946 const char *name, 2948 const char *name,
2947 Elm_Win_Type type) 2949 Elm_Win_Type type)
2948{ 2950{
2949 Evas_Object *obj = eo_add(MY_CLASS, parent, elm_obj_win_constructor(name, type)); 2951 Evas_Object *obj = eo_add(MY_CLASS, parent,
2952 elm_obj_win_name_set(name),
2953 elm_obj_win_type_set(type));
2950 return obj; 2954 return obj;
2951} 2955}
2952 2956
@@ -2955,7 +2959,8 @@ elm_win_fake_add(Ecore_Evas *ee)
2955{ 2959{
2956 return eo_add(MY_CLASS, NULL, 2960 return eo_add(MY_CLASS, NULL,
2957 elm_obj_win_fake_canvas_set(ee), 2961 elm_obj_win_fake_canvas_set(ee),
2958 elm_obj_win_constructor(NULL, ELM_WIN_FAKE)); 2962 elm_obj_win_name_set(NULL),
2963 elm_obj_win_type_set(ELM_WIN_FAKE));
2959} 2964}
2960 2965
2961static void 2966static void
@@ -3053,8 +3058,8 @@ _accel_is_gl(void)
3053 return EINA_FALSE; 3058 return EINA_FALSE;
3054} 3059}
3055 3060
3056EOLIAN static void 3061static void
3057_elm_win_constructor(Eo *obj, Elm_Win_Data *sd, const char *name, Elm_Win_Type type) 3062_elm_win_construct(Eo *obj, Elm_Win_Data *sd, const char *name, Elm_Win_Type type)
3058{ 3063{
3059 sd->obj = obj; // in ctor 3064 sd->obj = obj; // in ctor
3060 3065
@@ -3521,6 +3526,7 @@ _elm_win_constructor(Eo *obj, Elm_Win_Data *sd, const char *name, Elm_Win_Type t
3521 } 3526 }
3522 3527
3523 TRAP(sd, name_class_set, name, _elm_appname); 3528 TRAP(sd, name_class_set, name, _elm_appname);
3529 TRAP(sd, title_set, sd->title);
3524 ecore_evas_callback_delete_request_set(sd->ee, _elm_win_delete_request); 3530 ecore_evas_callback_delete_request_set(sd->ee, _elm_win_delete_request);
3525 ecore_evas_callback_state_change_set(sd->ee, _elm_win_state_change); 3531 ecore_evas_callback_state_change_set(sd->ee, _elm_win_state_change);
3526 ecore_evas_callback_focus_in_set(sd->ee, _elm_win_focus_in); 3532 ecore_evas_callback_focus_in_set(sd->ee, _elm_win_focus_in);
@@ -3637,12 +3643,34 @@ _elm_win_eo_base_constructor(Eo *obj EINA_UNUSED, Elm_Win_Data *_pd EINA_UNUSED)
3637 /* Do nothing. */ 3643 /* Do nothing. */
3638} 3644}
3639 3645
3646EOLIAN static Eo *
3647_elm_win_eo_base_finalize(Eo *obj, Elm_Win_Data *_pd)
3648{
3649 _elm_win_construct(obj, _pd, _pd->name, _pd->type);
3650
3651 eo_do_super(obj, MY_CLASS, eo_finalize());
3652
3653 return obj;
3654}
3655
3640EOLIAN static void 3656EOLIAN static void
3641_elm_win_fake_canvas_set(Eo *obj EINA_UNUSED, Elm_Win_Data *pd, Ecore_Evas *oee) 3657_elm_win_fake_canvas_set(Eo *obj EINA_UNUSED, Elm_Win_Data *pd, Ecore_Evas *oee)
3642{ 3658{
3643 pd->ee = oee; 3659 pd->ee = oee;
3644} 3660}
3645 3661
3662EOLIAN static void
3663_elm_win_type_set(Eo *obj, Elm_Win_Data *sd, Elm_Win_Type type)
3664{
3665 Eina_Bool finalized;
3666 if (eo_do_ret(obj, finalized, eo_finalized_get()))
3667 {
3668 ERR("This function is only allowed during construction.");
3669 return;
3670 }
3671 sd->type = type;
3672}
3673
3646EOLIAN static Elm_Win_Type 3674EOLIAN static Elm_Win_Type
3647_elm_win_type_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd) 3675_elm_win_type_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
3648{ 3676{
@@ -3650,6 +3678,18 @@ _elm_win_type_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
3650} 3678}
3651 3679
3652EOLIAN static void 3680EOLIAN static void
3681_elm_win_name_set(Eo *obj, Elm_Win_Data *sd, const char *name)
3682{
3683 Eina_Bool finalized;
3684 if (eo_do_ret(obj, finalized, eo_finalized_get()))
3685 {
3686 ERR("This function is only allowed during construction.");
3687 return;
3688 }
3689 sd->name = eina_stringshare_add(name);
3690}
3691
3692EOLIAN static void
3653_elm_win_noblank_set(Eo *obj EINA_UNUSED, Elm_Win_Data *pd, Eina_Bool noblank) 3693_elm_win_noblank_set(Eo *obj EINA_UNUSED, Elm_Win_Data *pd, Eina_Bool noblank)
3654{ 3694{
3655 noblank = !!noblank; 3695 noblank = !!noblank;
@@ -3738,7 +3778,8 @@ _elm_win_title_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, const char *title)
3738{ 3778{
3739 if (!title) return; 3779 if (!title) return;
3740 eina_stringshare_replace(&(sd->title), title); 3780 eina_stringshare_replace(&(sd->title), title);
3741 TRAP(sd, title_set, sd->title); 3781 if (sd->ee)
3782 TRAP(sd, title_set, sd->title);
3742 if (sd->frame_obj) 3783 if (sd->frame_obj)
3743 edje_object_part_text_escaped_set 3784 edje_object_part_text_escaped_set
3744 (sd->frame_obj, "elm.text.title", sd->title); 3785 (sd->frame_obj, "elm.text.title", sd->title);
diff --git a/src/lib/elm_win.eo b/src/lib/elm_win.eo
index 8f348699a..ccba7017f 100644
--- a/src/lib/elm_win.eo
+++ b/src/lib/elm_win.eo
@@ -1131,7 +1131,49 @@ class Elm_Win (Elm_Widget, Elm_Interface_Atspi_Window,
1131 return: Evas_Object *; 1131 return: Evas_Object *;
1132 } 1132 }
1133 } 1133 }
1134
1135 name {
1136 set {
1137 /*@
1138 Set the window name.
1139
1140 The window name is a constructing property that need to be
1141 set at creation within eo_add.
1142
1143 Example:
1144 @code
1145 win = eo_add(ELM_WIN_CLASS, NULL, elm_obj_win_type_set(ELM_WIN_BASIC));
1146 @endcode
1147
1148 @note Once set, it can NOT be modified afterward.
1149
1150 @see Elm_Win_Type
1151
1152 @ingroup Win */
1153 }
1154 values {
1155 const(char)* name @nullable;
1156 }
1157 }
1134 type { 1158 type {
1159 set {
1160 /*@
1161 Set the window type.
1162
1163 The window type is a constructing property that need to be
1164 set at creation within eo_add.
1165
1166 Example:
1167 @code
1168 win = eo_add(ELM_WIN_CLASS, NULL, elm_obj_win_type_set(ELM_WIN_BASIC));
1169 @endcode
1170
1171 @note Once set, it can NOT be modified afterward.
1172
1173 @see Elm_Win_Type
1174
1175 @ingroup Win */
1176 }
1135 get { 1177 get {
1136 /*@ 1178 /*@
1137 Get the type of a window. 1179 Get the type of a window.
@@ -1139,7 +1181,9 @@ class Elm_Win (Elm_Widget, Elm_Interface_Atspi_Window,
1139 @return The type of a window object. If the object is not window object, return #ELM_WIN_UNKNOWN. 1181 @return The type of a window object. If the object is not window object, return #ELM_WIN_UNKNOWN.
1140 1182
1141 @ingroup Win */ 1183 @ingroup Win */
1142 return: Elm_Win_Type(-1); 1184 }
1185 values {
1186 Elm_Win_Type type;
1143 } 1187 }
1144 } 1188 }
1145 noblank { 1189 noblank {
@@ -1195,14 +1239,6 @@ class Elm_Win (Elm_Widget, Elm_Interface_Atspi_Window,
1195 } 1239 }
1196 } 1240 }
1197 methods { 1241 methods {
1198 constructor {
1199 /*@ No description supplied by the EAPI. */
1200 legacy: null;
1201 params {
1202 @in const(char)* name;
1203 @in Elm_Win_Type type;
1204 }
1205 }
1206 wm_manual_rotation_done_manual { 1242 wm_manual_rotation_done_manual {
1207 /*@ 1243 /*@
1208 To notify the rotation done to WM manually. 1244 To notify the rotation done to WM manually.
@@ -1354,6 +1390,7 @@ class Elm_Win (Elm_Widget, Elm_Interface_Atspi_Window,
1354 implements { 1390 implements {
1355 class.constructor; 1391 class.constructor;
1356 Eo.Base.constructor; 1392 Eo.Base.constructor;
1393 Eo.Base.finalize;
1357 Evas.Object_Smart.hide; 1394 Evas.Object_Smart.hide;
1358 Evas.Object_Smart.show; 1395 Evas.Object_Smart.show;
1359 Evas.Object_Smart.move; 1396 Evas.Object_Smart.move;
@@ -1371,7 +1408,8 @@ class Elm_Win (Elm_Widget, Elm_Interface_Atspi_Window,
1371 Elm_Interface_Atspi_Widget_Action.elm_actions.get; 1408 Elm_Interface_Atspi_Widget_Action.elm_actions.get;
1372 } 1409 }
1373 constructors { 1410 constructors {
1374 .constructor; 1411 .name;
1412 .type;
1375 } 1413 }
1376 events { 1414 events {
1377 delete,request; 1415 delete,request;
diff --git a/src/lib/elm_win_standard.c b/src/lib/elm_win_standard.c
new file mode 100644
index 000000000..e449cc3f4
--- /dev/null
+++ b/src/lib/elm_win_standard.c
@@ -0,0 +1,34 @@
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, eo_finalize());
19
20 Evas_Object *bg = eo_add(ELM_BG_CLASS, obj);
21 if (!bg)
22 {
23 ERR("Cannot create background.");
24 evas_object_del(obj);
25 return NULL;
26 }
27 eo_do(bg, evas_obj_size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND));
28 eo_do(obj, elm_obj_win_resize_object_add(bg));
29 eo_do(bg, efl_gfx_visible_set(EINA_TRUE));
30
31 return obj;
32}
33
34#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..845866044
--- /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