const char *title;
const char *icon_name;
const char *role;
+ Eina_Stringshare *name;
Evas_Object *main_menu;
eina_stringshare_del(sd->title);
eina_stringshare_del(sd->icon_name);
eina_stringshare_del(sd->role);
+ eina_stringshare_del(sd->name);
evas_object_del(sd->icon);
evas_object_del(sd->main_menu);
const char *name,
Elm_Win_Type type)
{
- Evas_Object *obj = eo_add(MY_CLASS, parent, elm_obj_win_constructor(name, type));
+ Evas_Object *obj = eo_add(MY_CLASS, parent,
+ elm_obj_win_name_set(name),
+ elm_obj_win_type_set(type));
return obj;
}
{
return eo_add(MY_CLASS, NULL,
elm_obj_win_fake_canvas_set(ee),
- elm_obj_win_constructor(NULL, ELM_WIN_FAKE));
+ elm_obj_win_name_set(NULL),
+ elm_obj_win_type_set(ELM_WIN_FAKE));
}
static void
return EO_CALLBACK_CONTINUE;
}
-EOLIAN static void
-_elm_win_constructor(Eo *obj, Elm_Win_Data *sd, const char *name, Elm_Win_Type type)
+static void
+_elm_win_finalize_internal(Eo *obj, Elm_Win_Data *sd, const char *name, Elm_Win_Type type)
{
sd->obj = obj; // in ctor
}
TRAP(sd, name_class_set, name, _elm_appname);
+ TRAP(sd, title_set, sd->title);
ecore_evas_callback_delete_request_set(sd->ee, _elm_win_delete_request);
ecore_evas_callback_state_change_set(sd->ee, _elm_win_state_change);
ecore_evas_callback_focus_in_set(sd->ee, _elm_win_focus_in);
/* Do nothing. */
}
+EOLIAN static Eo *
+_elm_win_eo_base_finalize(Eo *obj, Elm_Win_Data *_pd)
+{
+ _elm_win_finalize_internal(obj, _pd, _pd->name, _pd->type);
+ eo_do_super(obj, MY_CLASS, obj = eo_finalize());
+ return obj;
+}
+
EOLIAN static void
_elm_win_fake_canvas_set(Eo *obj EINA_UNUSED, Elm_Win_Data *pd, Ecore_Evas *oee)
{
pd->ee = oee;
}
+EOLIAN static void
+_elm_win_type_set(Eo *obj, Elm_Win_Data *sd, Elm_Win_Type type)
+{
+ Eina_Bool finalized;
+ if (eo_do_ret(obj, finalized, eo_finalized_get()))
+ {
+ ERR("This function is only allowed during construction.");
+ return;
+ }
+ sd->type = type;
+}
+
EOLIAN static Elm_Win_Type
_elm_win_type_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
{
}
EOLIAN static void
+_elm_win_name_set(Eo *obj, Elm_Win_Data *sd, const char *name)
+{
+ Eina_Bool finalized;
+ if (eo_do_ret(obj, finalized, eo_finalized_get()))
+ {
+ ERR("This function is only allowed during construction.");
+ return;
+ }
+ sd->name = eina_stringshare_add(name);
+}
+
+EOLIAN static void
_elm_win_noblank_set(Eo *obj EINA_UNUSED, Elm_Win_Data *pd, Eina_Bool noblank)
{
noblank = !!noblank;
{
if (!title) return;
eina_stringshare_replace(&(sd->title), title);
- TRAP(sd, title_set, sd->title);
+ if (sd->ee)
+ TRAP(sd, title_set, sd->title);
if (sd->frame_obj)
edje_object_part_text_escaped_set
(sd->frame_obj, "elm.text.title", sd->title);
return: Evas_Object *;
}
}
+ @property name {
+ /*@
+ The window name.
+
+ The meaning of name depends on the underlying windowing system.
+
+ The window name is a constructing property that need to be set at
+ creation within @ref eo_add.
+
+ Example:
+ @code
+ win = eo_add(ELM_WIN_CLASS, NULL, elm_obj_win_name_set(ELM_WIN_BASIC));
+ @endcode
+
+ @note Once set, it can NOT be modified afterward.
+
+ @ingroup Win */
+
+ set {
+ /*@
+ Can only be used at creation time, within @ref eo_add.
+
+ @ingroup Win */
+ }
+ values {
+ const(char)* name @nullable;
+ }
+ }
@property type {
- get {
+ /*@
+ The type of the window.
+
+ It is a hint of how the Window Manager should handle it.
+
+ The window type is a constructing property that need to be set at
+ creation within @ref eo_add.
+
+ Example:
+ @code
+ win = eo_add(ELM_WIN_CLASS, NULL, elm_obj_win_type_set(ELM_WIN_BASIC));
+ @endcode
+
+ @note Once set, it can NOT be modified afterward.
+
+ @see Elm_Win_Type
+
+ @ingroup Win */
+
+ set {
/*@
- Get the type of a window.
+ Can only be used at creation time, within @ref eo_add.
+
+ @see Elm_Win_Type
- @return The type of a window object. If the object is not window object, return #ELM_WIN_UNKNOWN.
+ @ingroup Win */
+ }
+ get {
+ /*@
+ If the object is not window object, return #ELM_WIN_UNKNOWN.
@ingroup Win */
- return: Elm_Win_Type(-1);
+ }
+ values {
+ Elm_Win_Type type(-1);
}
}
@property noblank {
Ecore_Evas *oee;
}
}
- constructor {
- /*@ No description supplied by the EAPI. */
- legacy: null;
- params {
- @in const(char)* name;
- @in Elm_Win_Type type;
- }
- }
wm_manual_rotation_done_manual {
/*@
To notify the rotation done to WM manually.
implements {
class.constructor;
Eo.Base.constructor;
+ Eo.Base.finalize;
Evas.Object_Smart.hide;
Evas.Object_Smart.show;
Evas.Object_Smart.move;
Elm_Interface_Atspi_Widget_Action.elm_actions.get;
}
constructors {
- .constructor;
+ .name;
+ .type;
}
events {
delete,request;