elm_win: move shaped & title property from eo to legacy

1. remain borderless property.
2. shaped property was removed because wayland not support this.
3. remain noblank property.
4. remain role, name properties.
5. remove title property because it can be supported using name property
This commit is contained in:
Ji-Youn Park 2016-06-01 20:55:47 +08:30
parent 57c67067e5
commit 466d9fbaf1
3 changed files with 155 additions and 135 deletions

View File

@ -4271,24 +4271,6 @@ _elm_win_efl_container_content_iterate(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
return &it->iterator;
}
EOLIAN static void
_elm_win_title_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, const char *title)
{
if (!title) return;
eina_stringshare_replace(&(sd->title), 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);
}
EOLIAN static const char*
_elm_win_title_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
{
return sd->title;
}
EOLIAN static void
_elm_win_role_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, const char *role)
{
@ -4426,21 +4408,6 @@ _elm_win_borderless_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
return ecore_evas_borderless_get(sd->ee);
}
EOLIAN static void
_elm_win_shaped_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, Eina_Bool shaped)
{
TRAP(sd, shaped_set, shaped);
#ifdef HAVE_ELEMENTARY_X
_elm_win_xwin_update(sd);
#endif
}
EOLIAN static Eina_Bool
_elm_win_shaped_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
{
return ecore_evas_shaped_get(sd->ee);
}
EOLIAN static void
_elm_win_alpha_set(Eo *obj, Elm_Win_Data *sd, Eina_Bool enabled)
{
@ -6320,4 +6287,49 @@ elm_win_modal_get(const Evas_Object *obj)
return sd->modal;
}
EAPI void
elm_win_shaped_set(Evas_Object *obj, Eina_Bool shaped)
{
ELM_WIN_CHECK(obj);
ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
TRAP(sd, shaped_set, shaped);
#ifdef HAVE_ELEMENTARY_X
_elm_win_xwin_update(sd);
#endif
}
EAPI Eina_Bool
elm_win_shaped_get(const Evas_Object *obj)
{
ELM_WIN_CHECK(obj) EINA_FALSE;
ELM_WIN_DATA_GET_OR_RETURN(obj, sd, EINA_FALSE);
return ecore_evas_shaped_get(sd->ee);
}
EAPI void
elm_win_title_set(Evas_Object *obj, const char *title)
{
ELM_WIN_CHECK(obj);
ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
if (!title) return;
eina_stringshare_replace(&(sd->title), 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);
}
EAPI const char*
elm_win_title_get(const Evas_Object *obj)
{
ELM_WIN_CHECK(obj) NULL;
ELM_WIN_DATA_GET_OR_RETURN(obj, sd, NULL);
return sd->title;
}
#include "elm_win.eo.c"

View File

@ -503,6 +503,46 @@ class Elm.Win (Elm.Widget, Elm.Interface.Atspi.Window,
modal: Elm.Win.Modal_Mode; [[The mode of a window, one of #Elm_Win_Modal_Mode.]]
}
}
@property noblank {
set {
[[Set the noblank property of a window.
The "noblank" property is a way to request the display on
which the windowis shown does not blank, screensave or
otherwise hide or obscure the window. It is intended for
uses such as media playback on a television where a user
may not want to be interrupted by an idle screen. The
noblank property may have no effect if the window is
iconified/minimized or hidden.
@since 1.11
]]
}
get {
[[Get the noblank property of a window.
@since 1.11
]]
}
values {
noblank: bool; [[If true, the window is set to noblank.]]
}
}
@property borderless {
set {
[[Set the borderless state of a window.
This function requests the Window Manager to not draw any
decoration around the window.
]]
}
get {
[[Get the borderless state of a window.]]
}
values {
borderless: bool; [[If true, the window is borderless.]]
}
}
@property role {
set {
[[Set the role of the window.]]
@ -519,6 +559,29 @@ class Elm.Win (Elm.Widget, Elm.Interface.Atspi.Window,
role: string; [[The role to set.]]
}
}
@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.
Note: Once set, it can NOT be modified afterward.
]]
/* FIXME-doc
Example:
@code
win = eo_add(ELM_WIN_CLASS, NULL, elm_obj_win_name_set(ELM_WIN_BASIC));
@endcode
*/
set {
[[Can only be used at creation time, within \@ref eo_add.]]
}
values {
name: string @nullable;
}
}
@property size_step {
set {
[[Set the window stepping used with sizing calculation.
@ -540,21 +603,6 @@ class Elm.Win (Elm.Widget, Elm.Interface.Atspi.Window,
h: int; [[The stepping height (0 disables).]]
}
}
@property borderless {
set {
[[Set the borderless state of a window.
This function requests the Window Manager to not draw any
decoration around the window.
]]
}
get {
[[Get the borderless state of a window.]]
}
values {
borderless: bool; [[If true, the window is borderless.]]
}
}
@property available_profiles {
set {
[[Set the array of available profiles to a window.
@ -578,22 +626,6 @@ class Elm.Win (Elm.Widget, Elm.Interface.Atspi.Window,
return: bool;
}
}
@property title {
set {
[[Set the title of the window.]]
}
get {
[[Get the title of the window.
The returned string is an internal one and should not be
freed or modified. It will also be invalid if a new title
is set or if the window is destroyed.
]]
}
values {
title: string; [[The title.]]
}
}
@property alpha {
set {
[[Set the alpha channel state of a window.
@ -602,9 +634,7 @@ class Elm.Win (Elm.Widget, Elm.Interface.Atspi.Window,
enabled possibly making parts of the window completely or
partially transparent. This is also subject to the underlying
system supporting it, like for example, running under a
compositing manager. If no compositing is available, enabling
this option will instead fallback to using shaped windows,
with @.shaped.set.
compositing manager.
Note: Alpha window can be enabled automatically by window
theme style's property. If "alpha" data.item is "1" or
@ -671,26 +701,6 @@ class Elm.Win (Elm.Widget, Elm.Interface.Atspi.Window,
profile: string; [[The string value of a window profile.]]
}
}
@property shaped {
set {
[[Set the shaped state of a window.
Shaped windows, when supported, will render the parts of the
window that has no content, transparent.
If $shaped is false, then it is strongly advised to have some
background object or cover the entire window in any other way,
or the parts of the canvas that have no data will show
framebuffer artifacts.
]]
}
get {
[[Get the shaped state of a window.]]
}
values {
shaped: bool; [[If $true, the window is shaped.]]
}
}
@property size_base {
set {
[[Set the base window size used with stepping calculation
@ -745,29 +755,6 @@ class Elm.Win (Elm.Widget, Elm.Interface.Atspi.Window,
return: Evas.Object; [[The inlined image object or $null if none exists.]]
}
}
@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.
Note: Once set, it can NOT be modified afterward.
]]
/* FIXME-doc
Example:
@code
win = eo_add(ELM_WIN_CLASS, NULL, elm_obj_win_name_set(ELM_WIN_BASIC));
@endcode
*/
set {
[[Can only be used at creation time, within \@ref eo_add.]]
}
values {
name: string @nullable;
}
}
@property type { /* FIXME: before finalize */
[[The type of the window.
@ -794,31 +781,6 @@ class Elm.Win (Elm.Widget, Elm.Interface.Atspi.Window,
type: Elm.Win.Type(Elm.Win.Type.unknown);
}
}
@property noblank {
set {
[[Set the noblank property of a window.
The "noblank" property is a way to request the display on
which the windowis shown does not blank, screensave or
otherwise hide or obscure the window. It is intended for
uses such as media playback on a television where a user
may not want to be interrupted by an idle screen. The
noblank property may have no effect if the window is
iconified/minimized or hidden.
@since 1.11
]]
}
get {
[[Get the noblank property of a window.
@since 1.11
]]
}
values {
noblank: bool; [[If true, the window is set to noblank.]]
}
}
@property fake_canvas @protected {
set {
[[Internal. Used to completent the fake window type.]]

View File

@ -806,3 +806,49 @@ EAPI void elm_win_modal_set(Evas_Object *obj, Eina_Bool modal);
*/
EAPI Eina_Bool elm_win_modal_get(const Evas_Object *obj);
/**
* @brief Set the shaped state of a window.
*
* Shaped windows, when supported, will render the parts of the window that has
* no content, transparent.
*
* If @c shaped is false, then it is strongly advised to have some background
* object or cover the entire window in any other way, or the parts of the
* canvas that have no data will show framebuffer artifacts.
*
* @param[in] shaped If @c true, the window is shaped.
*
* @ingroup Elm_Win
*/
EAPI void elm_win_shaped_set(Evas_Object *obj, Eina_Bool shaped);
/**
* @brief Get the shaped state of a window.
*
* @return If @c true, the window is shaped.
*
* @ingroup Elm_Win
*/
EAPI Eina_Bool elm_win_shaped_get(const Evas_Object *obj);
/**
* @brief Set the title of the window.
*
* @param[in] title The title.
*
* @ingroup Elm_Win
*/
EAPI void elm_win_title_set(Evas_Object *obj, const char *title);
/**
* @brief Get the title of the window.
*
* The returned string is an internal one and should not be freed or modified.
* It will also be invalid if a new title is set or if the window is destroyed.
*
* @return The title.
*
* @ingroup Elm_Win
*/
EAPI const char *elm_win_title_get(const Evas_Object *obj);