elm_win: add enum for elm_win_modal set and elm_win_urgent set

1. remain iconified, maximized, fullscreen property
2. remain sticky property
3. change return value type of modal from bool to enum for the future.
4. merge urgent_set and demand_attention
5. remain activate method
This commit is contained in:
Ji-Youn Park 2016-06-01 20:17:30 +08:30
parent 9dc1140343
commit 57c67067e5
3 changed files with 255 additions and 106 deletions

View File

@ -4587,22 +4587,6 @@ _elm_win_iconified_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
return sd->iconified;
}
EOLIAN static void
_elm_win_withdrawn_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, Eina_Bool withdrawn)
{
// sd->withdrawn = withdrawn;
TRAP(sd, withdrawn_set, withdrawn);
#ifdef HAVE_ELEMENTARY_X
_elm_win_xwin_update(sd);
#endif
}
EOLIAN static Eina_Bool
_elm_win_withdrawn_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
{
return sd->withdrawn;
}
EOLIAN static void
_elm_win_available_profiles_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, const char **profiles, unsigned int count)
{
@ -4710,67 +4694,57 @@ _elm_win_profile_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
}
EOLIAN static void
_elm_win_urgent_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, Eina_Bool urgent)
_elm_win_urgent_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, Elm_Win_Urgent_Mode urgent)
{
if (sd->urgent == urgent)
return;
sd->urgent = urgent;
TRAP(sd, urgent_set, urgent);
Eina_Bool urgent_tmp = !!urgent;
if (sd->urgent == urgent_tmp) return;
sd->urgent = urgent_tmp;
TRAP(sd, urgent_set, urgent_tmp);
#ifdef HAVE_ELEMENTARY_X
_elm_win_xwin_update(sd);
#endif
}
EOLIAN static Eina_Bool
EOLIAN static Elm_Win_Urgent_Mode
_elm_win_urgent_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
{
return sd->urgent;
if (sd->urgent) return ELM_WIN_URGENT_MODE_URGENT;
return ELM_WIN_URGENT_MODE_NONE;
}
EOLIAN static void
_elm_win_demand_attention_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, Eina_Bool demand_attention)
_elm_win_modal_set(Eo *obj, Elm_Win_Data *sd, Elm_Win_Modal_Mode modal)
{
sd->demand_attention = demand_attention;
TRAP(sd, demand_attention_set, demand_attention);
#ifdef HAVE_ELEMENTARY_X
_elm_win_xwin_update(sd);
#endif
}
Eina_Bool modal_tmp = !!modal;
EOLIAN static Eina_Bool
_elm_win_demand_attention_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
{
return sd->demand_attention;
}
EOLIAN static void
_elm_win_modal_set(Eo *obj, Elm_Win_Data *sd, Eina_Bool modal)
{
if (sd->modal_count) return;
const Eina_List *l;
Evas_Object *current;
if ((modal) && (!sd->modal) && (evas_object_visible_get(obj)))
if ((modal_tmp) && (!sd->modal) && (evas_object_visible_get(obj)))
{
INCREMENT_MODALITY()
}
else if ((!modal) && (sd->modal) && (evas_object_visible_get(obj)))
else if ((!modal_tmp) && (sd->modal) && (evas_object_visible_get(obj)))
{
DECREMENT_MODALITY()
}
sd->modal = modal;
TRAP(sd, modal_set, modal);
sd->modal = modal_tmp;
TRAP(sd, modal_set, modal_tmp);
#ifdef HAVE_ELEMENTARY_X
_elm_win_xwin_update(sd);
#endif
}
EOLIAN static Eina_Bool
EOLIAN static Elm_Win_Modal_Mode
_elm_win_modal_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
{
return sd->modal;
if (sd->modal) return ELM_WIN_MODAL_MODE_MODAL;
return ELM_WIN_MODAL_MODE_NONE;
}
EOLIAN static void
@ -6242,4 +6216,108 @@ elm_win_icon_name_get(const Evas_Object *obj)
return sd->icon_name;
}
EAPI void
elm_win_withdrawn_set(Evas_Object *obj, Eina_Bool withdrawn)
{
ELM_WIN_CHECK(obj);
ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
// sd->withdrawn = withdrawn;
TRAP(sd, withdrawn_set, withdrawn);
#ifdef HAVE_ELEMENTARY_X
_elm_win_xwin_update(sd);
#endif
}
EAPI Eina_Bool
elm_win_withdrawn_get(const Evas_Object *obj)
{
ELM_WIN_CHECK(obj) EINA_FALSE;
ELM_WIN_DATA_GET_OR_RETURN(obj, sd, EINA_FALSE);
return sd->withdrawn;
}
EAPI void
elm_win_urgent_set(Evas_Object *obj, Eina_Bool urgent)
{
ELM_WIN_CHECK(obj);
ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
if (sd->urgent == urgent)
return;
sd->urgent = urgent;
TRAP(sd, urgent_set, urgent);
#ifdef HAVE_ELEMENTARY_X
_elm_win_xwin_update(sd);
#endif
}
EAPI Eina_Bool
elm_win_urgent_get(const Evas_Object *obj)
{
ELM_WIN_CHECK(obj) EINA_FALSE;
ELM_WIN_DATA_GET_OR_RETURN(obj, sd, EINA_FALSE);
return sd->urgent;
}
EAPI void
elm_win_demand_attention_set(Evas_Object *obj, Eina_Bool demand_attention)
{
ELM_WIN_CHECK(obj);
ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
sd->demand_attention = demand_attention;
TRAP(sd, demand_attention_set, demand_attention);
#ifdef HAVE_ELEMENTARY_X
_elm_win_xwin_update(sd);
#endif
}
EAPI Eina_Bool
elm_win_demand_attention_get(const Evas_Object *obj)
{
ELM_WIN_CHECK(obj) EINA_FALSE;
ELM_WIN_DATA_GET_OR_RETURN(obj, sd, EINA_FALSE);
return sd->demand_attention;
}
EAPI void
elm_win_modal_set(Evas_Object *obj, Eina_Bool modal)
{
ELM_WIN_CHECK(obj);
ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
if (sd->modal_count) return;
const Eina_List *l;
Evas_Object *current;
if ((modal) && (!sd->modal) && (evas_object_visible_get(obj)))
{
INCREMENT_MODALITY()
}
else if ((!modal) && (sd->modal) && (evas_object_visible_get(obj)))
{
DECREMENT_MODALITY()
}
sd->modal = modal;
TRAP(sd, modal_set, modal);
#ifdef HAVE_ELEMENTARY_X
_elm_win_xwin_update(sd);
#endif
}
EAPI Eina_Bool
elm_win_modal_get(const Evas_Object *obj)
{
ELM_WIN_CHECK(obj) EINA_FALSE;
ELM_WIN_DATA_GET_OR_RETURN(obj, sd, EINA_FALSE);
return sd->modal;
}
#include "elm_win.eo.c"

View File

@ -144,6 +144,22 @@ enum Elm.Illume_Command
close [[Closes the currently active window]]
}
enum Elm.Win.Modal_Mode
{
[[Defines the mode of a modal window]]
none, [[The window is not modal window.]]
modal [[The window is modal window.]]
}
enum Elm.Win.Urgent_Mode
{
[[Defines the mode of a urgent window.]]
none, [[The window is not a urgent window.]]
urgent [[The window is a urgent window.]]
}
class Elm.Win (Elm.Widget, Elm.Interface.Atspi.Window,
Elm.Interface.Atspi_Widget_Action, Efl.Pack,
Efl.Input.State, Efl.Input.Interface, Efl.Screen)
@ -433,26 +449,58 @@ class Elm.Win (Elm.Widget, Elm.Interface.Atspi.Window,
maximized: bool; [[If true, the window is maximized.]]
}
}
@property fullscreen {
set {
[[Set the fullscreen state of a window.]]
}
get {
[[Get the fullscreen state of a window.]]
}
values {
fullscreen: bool; [[If $true, the window is fullscreen.]]
}
}
@property sticky {
set {
[[Set the sticky state of the window.
Hints the Window Manager that the window in $obj should be
left fixed at its position even when the virtual desktop
it's on moves or changes.
]]
}
get {
[[Get the sticky state of the window.]]
}
values {
sticky: bool; [[If true, the window's sticky state is enabled.]]
}
}
@property urgent {
set {
[[Set the urgent state of a window.]]
legacy: null;
}
get {
[[Get the urgent state of a window.]]
legacy: null;
}
values {
urgent: Elm.Win.Urgent_Mode;
[[The mode of a urgent window, one of #Elm_Win_Urgent_Mode.]]
}
}
@property modal {
set {
[[Set the modal state of a window.]]
legacy: null;
}
get {
[[Get the modal state of a window.]]
legacy: null;
}
values {
modal: bool; [[If true, the window is modal.]]
}
}
@property withdrawn {
set {
[[Set the withdrawn state of a window.]]
}
get {
[[Get the withdrawn state of a window.]]
}
values {
withdrawn: bool; [[If true, the window is withdrawn.]]
modal: Elm.Win.Modal_Mode; [[The mode of a window, one of #Elm_Win_Modal_Mode.]]
}
}
@property role {
@ -573,33 +621,6 @@ class Elm.Win (Elm.Widget, Elm.Interface.Atspi.Window,
$false otherwise.]]
}
}
@property urgent {
set {
[[Set the urgent state of a window.]]
}
get {
[[Get the urgent state of a window.]]
}
values {
urgent: bool; [[If true, the window is urgent.]]
}
}
@property sticky {
set {
[[Set the sticky state of the window.
Hints the Window Manager that the window in $obj should be
left fixed at its position even when the virtual desktop
it's on moves or changes.
]]
}
get {
[[Get the sticky state of the window.]]
}
values {
sticky: bool; [[If true, the window's sticky state is enabled.]]
}
}
@property aspect {
set {
[[Set the aspect ratio of a window.]]
@ -612,17 +633,6 @@ class Elm.Win (Elm.Widget, Elm.Interface.Atspi.Window,
otherwise it is width divided by height.]]
}
}
@property demand_attention {
set {
[[Set the demand_attention state of a window.]]
}
get {
[[Get the demand_attention state of a window.]]
}
values {
demand_attention: bool; [[If true, the window is demand_attention.]]
}
}
@property layer {
set {
[[Set the layer of the window.
@ -681,17 +691,6 @@ class Elm.Win (Elm.Widget, Elm.Interface.Atspi.Window,
shaped: bool; [[If $true, the window is shaped.]]
}
}
@property fullscreen {
set {
[[Set the fullscreen state of a window.]]
}
get {
[[Get the fullscreen state of a window.]]
}
values {
fullscreen: bool; [[If $true, the window is fullscreen.]]
}
}
@property size_base {
set {
[[Set the base window size used with stepping calculation

View File

@ -734,3 +734,75 @@ EAPI void elm_win_icon_name_set(Evas_Object *obj, const char *icon_name);
*/
EAPI const char *elm_win_icon_name_get(const Evas_Object *obj);
/**
* @brief Set the withdrawn state of a window.
*
* @param[in] withdrawn If true, the window is withdrawn.
*
* @ingroup Elm_Win
*/
EAPI void elm_win_withdrawn_set(Evas_Object *obj, Eina_Bool withdrawn);
/**
* @brief Get the withdrawn state of a window.
*
* @return If true, the window is withdrawn.
*
* @ingroup Elm_Win
*/
EAPI Eina_Bool elm_win_withdrawn_get(const Evas_Object *obj);
/**
* @brief Set the urgent state of a window.
*
* @param[in] urgent If true, the window is urgent.
*
* @ingroup Elm_Win
*/
EAPI void elm_win_urgent_set(Evas_Object *obj, Eina_Bool urgent);
/**
* @brief Get the urgent state of a window.
*
* @return If true, the window is urgent.
*
* @ingroup Elm_Win
*/
EAPI Eina_Bool elm_win_urgent_get(const Evas_Object *obj);
/**
* @brief Set the demand_attention state of a window.
*
* @param[in] demand_attention If true, the window is demand_attention.
*
* @ingroup Elm_Win
*/
EAPI void elm_win_demand_attention_set(Evas_Object *obj, Eina_Bool demand_attention);
/**
* @brief Get the demand_attention state of a window.
*
* @return If true, the window is demand_attention.
*
* @ingroup Elm_Win
*/
EAPI Eina_Bool elm_win_demand_attention_get(const Evas_Object *obj);
/**
* @brief Set the modal state of a window.
*
* @param[in] modal If true, the window is modal.
*
* @ingroup Elm_Win
*/
EAPI void elm_win_modal_set(Evas_Object *obj, Eina_Bool modal);
/**
* @brief Get the modal state of a window.
*
* @return If true, the window is modal.
*
* @ingroup Elm_Win
*/
EAPI Eina_Bool elm_win_modal_get(const Evas_Object *obj);